* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1em 0;
}

header a {
    color: #fff;
    text-decoration: none;
}

header img {
    width: 100%;
    max-width: 100px;
    margin: 0 auto;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
    display: inline-block;
    vertical-align: middle;
}

header div{
    display: inline-block;
    vertical-align: middle;
    text-align: left;
}

header h1 {
    font-size: 2.5em;
    margin: 0;
    padding: 0 10px;
    display: block;
    color: #fff;
}

header h2 {
    font-size: 1.2em;
    margin: 0;
    padding: 0 18px;
    display: block;
    color: #fff;
}

header .user{
    position: absolute;
    top: 0;
    right: 0;
    padding: 10px;
    aspect-ratio: 1/1;
    cursor: pointer;
    overflow: hidden;
}

header .user img{
    width: 50px;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 50%;
}

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background-color: #444;
    position: sticky;
    top: 0;
    z-index: 10;
}

nav a,
nav input[type="submit"] {
    background-color: #555;
    color: #fff;
    border: none;
    text-decoration: none;
    padding: 10px 20px;
    margin: 0.5em 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

nav a:hover,
nav input[type="submit"]:hover {
    background-color: #666;
}

nav form {
    margin: 0.5em 10px;
}

nav a.nosite, nav a.nosite:hover {
    background-color: #555;
    color: #878787;
    pointer-events: none;
}

main {
    flex: 1;
    padding: 2em;
    text-align: center;
}

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 0.1em 0;
}

/* Form styles */

form {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

fieldset {
    border: 1px solid #ccc;
    padding: 20px;
    margin: 5px 10px;
    flex: 1;
}

legend {
    font-weight: bold;
}

label {
    display: block;
    margin-bottom: 10px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    vertical-align: top;
}

/*disabled inputs*/
input[type="text"]:disabled,
input[type="number"]:disabled,
input[type="email"]:disabled,
input[type="password"]:disabled,
select:disabled,
textarea:disabled {
    background-color: #eee;
}

input[type="radio"]:disabled+label,
input[type="checkbox"]:disabled+label {
    background-color: #ccc;
    border-color: #bbb;
    cursor: not-allowed;
}

input[type="radio"],
input[type="checkbox"] {
    display: none;
}

input[type="radio"]+label,
input[type="checkbox"]+label {
    display: inline-block;
    padding: 10px 20px;
    margin-right: 10px;
    background-color: #555;
    color: #fff;
    border: 2px solid #444;
    cursor: pointer;
    transition: background-color 0.3s;
}

input[type="radio"]+label:hover,
input[type="checkbox"]+label:hover {
    background-color: #666 !important;
}

input[type="radio"]:checked+label,
input[type="checkbox"]:checked+label {
    background-color: #a3a3a3;
    border-color: #777;
}


#content {
    flex-basis: 100%;
}

.btn,
button {
    background-color: #555;
    color: #fff;
    border: none;
    text-decoration: none;
    padding: 10px 20px;
    margin: 0 10px;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
    vertical-align: top;
    display: inline-block;
}

.btn:hover,
button:hover {
    background-color: #666;
}

.btn.red,
button.red {
    background-color: #f00;
}

.btn.red:hover,
button.red:hover {
    background-color: #f33;
}

#buttons {
    flex-basis: 100%;
    display: flex;
    justify-content: flex-end;
}

.controls {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.controls>* {
    margin: 0 10px;
    width: 100%;
    padding: 10px 20px;
}

.controls>*:first-child {
    margin-left: 0;
}

.controls>*:last-child {
    margin-right: 0;
}

.menuPlacementTool {
    border: 1px solid #000000;
    padding: 10px;
    transition: all 0.2s ease;
    display: block;
    margin-bottom: 20px;
}

.menuPlacementTool div {
    width: 100%;
    border: 1px solid #000000;
    margin-bottom: 8px;
    cursor: move;
    transition: all 0.2s ease;
    position: relative;
    padding: 5px 10px;
}

.menuPlacementTool div p {
    margin: 20px 50px;
    cursor: pointer;
}

.menuPlacementTool .inside {
    padding-bottom: 40px !important;
}

.menuPlacementTool .dragging {
    opacity: 0.2;
}

.menuPlacementTool .outside {
    margin-top: 40px !important;
}

.menuPlacementTool .outside::before {
    content: '';
    display: block;
    width: 100%;
    height: 40px;
    position: absolute;
    top: -40px;
    left: 0;
}

.menuPlacementTool button {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    padding-left: 20px;
    transition: all 0.2s ease;
    position: relative;
    margin: 0;
    color: black;
    background-color: inherit;
    border: 1px dashed #000000;
}

.menuPlacementTool button:hover {
    background-color: #000000;
    color: white;
}

.menuPlacementTool .red {
    outline-color: red;
}

/* Show the symbol when data-link is "0" and data-custom is not empty or if data-link is not "0" */
.menuPlacementTool div[data-link="0"][data-custom]:not([data-custom=""]) p:before, .menuPlacementTool div[data-link]:not([data-link="0"]):not([data-link=""]) p:before {
    content: "⎋";
    font-weight: 900;
    margin-right: 5px;
}

dialog {
    width: clamp(300px, 100%, 80vw);
    padding: 20px;
    position:relative;
}

.customFields {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.editor{
    min-width: 100px;
    min-height: 300px;
    border: 1px solid #ccc;
    overflow: hidden;
    text-align: left;
}

.editor-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
}

#imageUploadBox {
    cursor: pointer;
    width: 150px;
    height: 150px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 10px;
    border-radius: 10px;
    border: 2px solid transparent;
    /* Set border to transparent */
    background-image: linear-gradient(90deg, #aaa 50%, transparent 50%), linear-gradient(90deg, #aaa 50%, transparent 50%), linear-gradient(0deg, #aaa 50%, transparent 50%), linear-gradient(0deg, #aaa 50%, transparent 50%);
    background-size: 8px 4px, 8px 4px, 4px 8px, 4px 8px;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
    background-position: left top, right bottom, left top, right bottom;
    vertical-align: top;
    background-color: rgba(0, 0, 0, 0.1);
    position: relative;
}

#imageGenerate{
    margin-top: 10px;
}

#imageUploadBox.loading {
    animation: moveDashes 10s linear infinite;
    background-color: rgba(0, 255, 4, 0.1);
}

@keyframes moveDashes {
    0% {
        background-position: 0 0, 100% 100%, 0 0, 100% 100%;
    }

    100% {
        background-position: 100% 0, 0 100%, 0 100%, 100% 0;
    }
}

/* Container for the image */
.imageSelectBox {
    width: 150px;
    height: 150px;
    border: 2px solid #333;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: inline-block;
}
.imageGalleryBox {
    border: 2px solid #333;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: inline-block;
}
.imageGalleryBox .galleryName{
    display: block;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    text-align: center;
    padding: 5px 0;
    font-weight: bold;
    font-size: 14px;
}

/* The image itself */
.imageSelectBox img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Title overlay at the bottom of the image */
.imageSelectBox .info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    text-align: center;
    padding: 5px 0;
    font-weight: bold;
    font-size: 14px;
}
.imageSelectBox .title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.imageSelectBox .description {
    max-height: 0;
    overflow: auto;
    text-align: left;
    font-size: 12px;
    opacity: 0;
    padding: 0;
    /*transition height but delay overflow so it doesn't show scrollbars*/
    transition: all 0.5s ease-in-out;
    border-top: 1px solid #fff;
    cursor: pointer;
}

.imageSelectBox .info:hover .description {
    max-height: calc(100px - 20px);
    padding: 5px;
    opacity: 1;
}

.imageSelectBox .icons {
    position: absolute;
    top: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 0 0 0 5px;
    overflow: hidden;

}
.imageSelectBox svg {
    width: 20px;
    height: 20px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    padding: 3px 0;
    display: inline-block;
}

.imageSelectBox svg:hover {
    background-color: rgba(255, 0, 0, 0.6);
}

dialog .buttons{
    position: sticky;
    bottom: 0;
    right: 0;
    width: 100%;
    color: #fff;
    text-align: center;
    padding: 5px 0;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
}

.myCustomPattern {
    background-color: rgba(255, 255, 0, 0.7);
    border-radius: 2px;
}