* {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Pattern animation */
    @keyframes animateBackground {
        0% {
            background-position: 0 0;
        }
        100% {
            background-position: 0 100%;
        }
    }
/*  */

body {
    line-height: 1.6;
    color: rgb(55, 55, 55);
    background-color: rgb(245, 245, 240);
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Header */
    header {
        z-index: 3;
        color: white;
        padding: 2rem;
        border-radius: 12px;
        margin-bottom: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    header.online {
        background: linear-gradient(135deg, rgb(0, 110, 255) 0%, rgb(21, 204, 4) 100%);
    }

    header.offline {
        background: linear-gradient(135deg, rgb(0, 110, 255) 0%, rgb(204, 4, 21) 100%);
    }
    header.loading {
        background: linear-gradient(135deg, rgb(0,110,255) 0%, rgb(121, 30, 196) 100%)
    }

    header.static {
        background: linear-gradient(135deg, rgb(0,110,255) 0%, rgb(121, 30, 196) 100%)
    }

    header:hover {
        transform: translateY(-1.5px);
        box-shadow: 0 6px 10px rgba(0,0,0,0.3);
    }

    .header-title {
        display: flex;
        align-items: center;
        justify-content: start;
    }

    .brand {
        max-height: 3rem;
        margin-right: 10px;
        margin-bottom: -5px;
    }

    source {
        margin-bottom: -5px;
    }

    header h1 {
        font-size: 2.5rem;
        font-weight: 600;
        letter-spacing: 1px;
    }

    .header-status {
        text-transform: uppercase;
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-weight: 600;
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .timer {
        font-size: 0.65rem;
        font-weight: 400;
    }
/*  */

.nav-menu {
    transition: transform 0.4s ease;
}

.nav-menu.hidden {
    transform: translateY(-1.8rem);
}

.nav-menu.show {
    transform: translateY(0.1rem);
}

.nav-menu ul {
    display: flex;
    flex-wrap: wrap;
}

.nav-menu li {
    font-size: 0.8rem;
    margin-top: -5px;
    background-color: rgb(100, 116, 139);
    color: white;
    list-style: none;
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    margin-left: 1rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-menu li:hover {
    transform: translateY(-2px);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-menu a {
    color: white;
    text-decoration: none;
}

.nav-menu a:hover {
    text-decoration: underline;
}

.nav-menu a:visited {
    color: rgb(230,230,230);
}

li.logout-link {
    background-color: rgb(200, 49, 49);
    margin-left: auto;
    margin-right: 1rem;
}
.logout-link a {
    color: white;
}

li.panel-link {
    margin-right: 0;
    margin-left: auto;
    background-color: rgb(0, 177, 150);
}

.search-bar {
    display: flex;
    background-color: rgb(248, 250, 252);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.5rem;
    justify-self: center;
    width: 70%;
}

.search-bar input {
    background: none;
    border: none;
    outline: none;
    padding: 0.5rem;
    font-size: 1rem;
    border-radius: 8px;
    min-width: 40svw;
}

/* Main */
    main {
        flex: 1;
        display: grid;
        gap: 2rem;
    }

    /* Sections */
    section {
        background-color: white;
        padding: 2rem;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
    }

    section h2 {
        font-size: 1.5rem;
        color: #374151;
    }

    section .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #e5e7eb;
        border-radius: 0;
        margin: 0;
        padding: 0;
        padding-bottom: 0.5rem;
        margin-bottom: 1.5rem;
    }

    section .section-header.dashboard-header h2 {
        font-size: 1.5rem;
        display: block;
    }

    .section-header button {
        font-size: 1rem;
        padding: 0.25rem 0.5rem;
        background-color: #2196F3;
        color: white;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
    }

    .section-list {
        z-index: 2;
        margin-top: -1.5rem;
    }

    .section-content {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }

    .section-vertical {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    /* nested section control buttons */
        .section-header-buttons {
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
            margin-bottom: -2.5rem;
            margin-right: 1rem;
            z-index: 1;
            transition: transform 0.3s ease, background-color 0.5s ease;
        }
        .section-header-buttons button {
            color: white;
            border: 1px solid #e5e7eb;
            padding: 0.8rem;
            font-size: 1.0rem;
            border-radius: 8px;
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
            background-color: rgb(100,116,139);
            transition: transform 0.3s ease, background-color 0.5s ease;
        }
        .section-header-buttons:hover {
            transform: translateY(-1.5rem);
            transition: transform 0.3s ease, filter 0.5s ease;
            filter: brightness(1.2);
        }

        .preview-canvas-section {
            padding-bottom: 1rem;
        }
    /*  */

/*  */

/* Canvas Styling */
        canvas.map-canvas {
            z-index: 2;
            width: 100%;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            background: #f8fafc;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        canvas.map-canvas.drag-over {
            border-color: #f38621;
            filter: brightness(0.4) invert(1);
            box-shadow: inset 0 0 10px black;
        }

        .instruction-text {
            text-align: center;
            font-size: 1rem;
            font-weight: 400;
            color: rgb(55, 55, 55);
        }

        canvas.preview-canvas {
            z-index: 2;
            width: 100%;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            background: #f8fafc;
        }

        .spacer {
            border-bottom: 1px solid #e5e7eb;
            margin-top: 10px;
            width: 100%;
        }

        /* error 'wiggle' animation */
        @keyframes wiggle {
            0% { transform: translateX(0); }
            25% { transform: translateX(-2px); }
            50% { transform: translateX(2px); }
            75% { transform: translateX(-2px); }
            100% { transform: translateX(0); }
        }

        .wiggle {
            padding-left: 0.3rem;
            color: red;
            font-weight: bold;
            position: absolute;
            animation: wiggle alternate 0.8s ease-in-out;
        }

/*  */

/* Contact Form */
        .contact-form select {
            padding: 0.5rem;
            font-size: 1rem;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
        }

        .contact-form textarea {
            padding: 0.5rem;
            font-size: 1rem;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            resize: vertical;
        }

        .contact-form input[type="file"]::file-selector-button {
            padding: 0.5rem;
            font-size: 1rem;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            background-color: white;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        .contact-form input[type="file"]::file-selector-button:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }

/*  */

/* Dashboard Styling */
        .dashboard-list {
            display: flex;
            align-items: center;
            flex-direction: column;
            gap: 1rem;
        }
        .preview-item {
            display: grid;
            grid-template-columns: 1fr 3fr 2fr;
            align-items: center;
            gap: 1rem;
            background-color: white;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
            padding: 1rem;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        .preview-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }

        .preview-item img {
            max-width: 100%;
            border-radius: 8px;
        }

        .preview-details {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .preview-actions {
            display: flex;
            align-items: stretch;
            justify-content: space-evenly;
        }

        .preview-item a {
            text-align: center;
            font-size: 1rem;
            padding: 0.5rem 1rem;
            background-color: #2196F3;
            color: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            text-decoration: none;
            transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
        }
        .preview-item a:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
            background-color: #1976D2;
        }

        .preview-item button {
            font-size: 1rem;
            padding: 0.5rem 1rem;
            background-color: #2196F3;
            color: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
        }
        .preview-item button:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
            background-color: #1976D2;
        }
/*  */

/* Pattern List */
        @keyframes animateBackground {
            0% {
                background-position: 0 0;
            }
            100% {
                background-position: 0 100%;
            }
        }

        .patterns-container {
            display: none;
        }

        .patterns-toolbar {
            text-align: center;
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            align-items: center;
            padding: 5px;
            padding-top: 0;
            margin-bottom: 10px;
            border-bottom: 1px solid #e5e7eb;
        }
        .patterns-toolbar label {
            font-size: 1.2rem;
            text-transform: capitalize;
        }

        .pattern-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 0.5rem;
            max-height: 110px;
            overflow-y: auto;
        }

        .pattern-item span {
            text-shadow: 1px 1px rgba(0,0,0,0.6);
            text-transform: capitalize;
            opacity: 0.8;
            color: white;
            font-size: 1rem;
            transition: opacity 0.3s ease;
        }

        .pattern-item {
            display: flex;
            align-items: center;
            justify-content: center;
            vertical-align: middle;
            padding: 0.2rem;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            cursor: pointer;
        }
        .pattern-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 2px 4px rgba(0,0,0,0.3);

            div.preview-background {
                box-shadow: inset 0 0 50px rgba(0,0,0,0.5);

                span {
                    opacity: 1;
                    filter: brightness(1.2);
                }
            }
        }

        .pattern-item.active {
            .preview-background {
                filter: brightness(0.8);
                animation-play-state: paused;
            }
        }

        .pattern-item .preview-background {
            display: flex;
            justify-content: center;
            height: 1.7rem;
            width: 15rem;
            margin: 3px;
            background-size: 275px 10000px;
            -webkit-animation-name: animateBackground;
            animation-name: animateBackground;
            -webkit-animation-duration: 5s;
            animation-duration: 5s;
            -webkit-animation-timing-function: steps(149, end);
            animation-timing-function: steps(149, end);
            -webkit-animation-iteration-count: infinite;
            animation-iteration-count: infinite;
            /* image-rendering: pixelated; */
            animation-play-state: running;
            unicode-bidi: isolate;
            border-radius: 7px;
            padding-bottom: 4px;
            border: 1px solid black;
            transition: box-shadow 0.3s ease;
        }
/*  */

/* toolbar */
        .toolbar-content {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
            gap: 1rem;
            justify-items: center;
            align-items: center;
            transition: opacity 0.3s ease;
        }
        .toolbar-content.active {
            display: grid;
            opacity: 1;
        }
        .toolbar-content.inactive {
            opacity: 0;
            display: none;
        }

        .toolbar-content.flex {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-evenly;
            gap: 1rem;
        }

        .toolbar-content .input-group {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .toolbar-content .input-group label {
            font-size: 1.25rem;
        }
        .toolbar-content .input-group input {
            font-size: 1.25rem;
            padding: 0.5rem 1rem;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .toolbar-content .input-group input[type="range"] {
            padding: 0;
        }
        
        .toolbar-content .input-group img {
            width: 1.75rem;
            height: 1.75rem;
        }
        
        .toolbar-content .input-group input:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }

        .toolbar-content .input-group input[type="range"]:hover {
            transform: translateY(-1px);
            box-shadow: none;
        }
/*  */

    .warning {
        border: 2px solid rgb(241, 211, 0);
        background: linear-gradient(180deg, #f8fafc 30%, rgba(255, 222, 0, 1) 100%);
    }

    .danger {
        border: 2px solid rgb(255, 59, 48);
        background: linear-gradient(180deg, #f8fafc 30%, rgba(255, 59, 48, 1) 100%);
    }

    .tooltip.update {
        position-anchor: --version-card;
    }

    .tooltip.warning {
        background: rgba(248, 250, 252, 0.9);
        position-anchor: --warnings-card;
    }

    .tooltip {
        display: none;
        z-index: 999;
        position: absolute;
        background-color: rgba(248, 250, 252, 0.9);
        border: 2px solid rgb(241, 211, 0);
        border-radius: 12px;
        padding: 1.2rem;
        opacity: 0;
        transition: opacity 0.3s ease;
        top: anchor(bottom);
        left: anchor(left);
        right: auto;
        margin: 0.3rem;
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
        width: 21rem;
        text-align: center;
    }

    .tooltip::content {
        z-index: 1000;
    }

    .tooltip p {
        z-index: 1000;
        font-size: 1rem;
        font-weight: 500;
    }

    .tooltip button {
        z-index: 1000;
        border-radius: 12px;
        font-size: 1rem;
        padding: 0.5rem;
        background-color: #2196F3;
        color: white;
        margin: 5px;
        border: 1px solid #e5e7eb;
    }

    .tooltip ul {
        list-style-type: none;
    }

    .tooltip li {
        text-transform: capitalize;
        display: inline-flex;
        align-items: center;
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 0.2rem;
    }
/*  */
    .indicator {
        width: 15px;
        height: 15px;
        border-radius: 50%;
        display: inline-block;
        margin-left: 0.3rem;
        background-color: rgb(175, 175, 175);
        box-shadow: 0 0 5px rgba(104, 104, 104, 0.7);
        anchor-name: --indicator;
        transition: filter 0.3s ease, transform 0.3s ease;
    }
    .indicator.online {
        background-color: rgb(21, 204, 4);
        box-shadow: 0 0 5px rgba(21, 204, 4, 0.7);
    }
    .indicator.offline {
        background-color: rgb(204, 4, 21);
        box-shadow: 0 0 5px rgba(204, 4, 21, 0.7);
    }
    .indicator:hover {
        filter: brightness(1.1);
        transform: translateY(-1px);
    }
    .indicator.warning {
        background-color: rgba(255, 222, 0, 1);
        box-shadow: 0 0 5px rgba(255, 222, 0, 0.7);
    }

    .indicator-tooltip {
        opacity: 0;
        position: absolute;
        position-anchor: --indicator;
        top: anchor(bottom);
        right: auto;
        left: anchor(center);
        border: 1px solid #e5e7eb;
        background-color: #f8fafc;
        padding: 0.5rem;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
        transition: opacity 0.3s ease;
    }
/*  */

/* Modals */
    .modal-backdrop {
        max-width: unset;
        max-height: unset;
        margin: 0;
        padding: 0;
        position: fixed;
        justify-items: center;
        align-content: center;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        border: none;
    }

    dialog.modal-backdrop[open] {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .modal {
        display: flex;
        flex-direction: column;
        align-self: center;
        justify-content: space-evenly;
        justify-self: center;
        gap: 1rem;
        position: absolute;
        border-radius: 12px;
        padding: 2rem;
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
        background-color: rgb(255, 255, 255);
        border: 1px solid #e5e7eb;
        max-width: 80%;
        max-height: 90%;
    }

    .modal h3 {
        border-bottom: 1px solid #e5e7eb;
    }

    .modal-content {
        display: flex;
        flex-direction: column;
        gap: 15px;
        overflow-y: scroll;
    }

    .modal input {
        border-radius: 5px;
        border: 1px solid #e5e7eb;
        padding: 0.3rem;
        font-size: 1.3rem;
    }

    .modal button {
        font-size: 1rem;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
        background-color: #2196F3;
        color: white;
        padding: 0.5rem;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .modal button:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
    
    .modal textarea {
        width: 100%;
        border-radius: 5px;
        border: 1px solid #e5e7eb;
        padding: 0.3rem;
        font-size: 1.3rem;
        resize: vertical;
    }

    .modal select {
        width: 100%;
        border-radius: 5px;
        border: 1px solid #e5e7eb;
        padding: 0.3rem;
        font-size: 1.3rem;
    }

    .modal img.help-gif {
        max-width: 80%;
        border-radius: 8px;
        align-self: center;
    }
/*  */

/* Popovers */
    .popover.user {
        background-color: rgb(248, 250, 252);
    }
    .popover {
        position: absolute;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
        background-color: rgb(255, 255, 255);
        border: 1px solid #e5e7eb;
    }
    .popover h3 {
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 1rem;
    }
    .popover-content {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        gap: 10px;
    }
    .popover-status-text {
        display: none;
        color: #a14611;
        font-size: 0.92rem;
    }
    .popover p {
        font-size: 0.92rem;
    }
    .popover input {
        border-radius: 5px;
        border: 1px solid #e5e7eb;
        padding: 0.3rem;
        font-size: 1.3rem;
    }
    .popover textarea {
        width: 100%;
        border-radius: 5px;
        border: 1px solid #e5e7eb;
        padding: 0.3rem;
        font-size: 1.3rem;
        resize: vertical;
    }
    .popover button {
        font-size: 1rem;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
        background-color: #2196F3;
        color: white;
        padding: 0.5rem;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .popover button:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }

    .popover.help {
        background-color: rgb(248, 250, 252);
        max-width: 400px;
        max-height: 300px;
        overflow-y: auto;
        transition: opacity 0.3s ease;
        opacity: 0;
    }
/*  */

/* Footer */
    footer {
        background: #374151;
        color: white;
        text-align: center;
        padding: 1rem;
        border-radius: 12px;
        margin-top: 2rem;
    }
/*  */

/* Login/Registry Page */
    .login-info {
        justify-self: center;
        width: 70%;
        text-align: center;
    }
    .login-info h2 {
        font-size: 3rem;
    }
    .login-info p {
        /* status message */
        white-space: break-spaces;
    }
    .login-list {
        text-align: center;
    }
    .login-item {
        justify-content: center;
        margin: 0.5rem;
    }
    .login-item label {
        font-size: 1.5rem;
    }
    .login-item input,
    .login-item select {
        width: 65%;
        padding: 0.5rem;
        font-size: 1.5rem;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        background-color: white;
    }
    .login-info button {
        font-size: 1.5rem;
        padding: 0.5rem;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        background-color: rgb(21, 204, 4);
        color: white;
    }
    .login-item select {
        appearance: none;
    }
    .login-item.checkbox input {
        width: auto;
    }

    .login-item.checkbox {
        align-items: center;
        justify-content: center;
        justify-self: center;
    }

    .login-item.checkbox label {
        font-size: 1rem;
    }

    .register-info {
        text-align: center;
    }
/*  */

/* Account Page */
    .account-info {
        display: grid;
    }

    .account-details {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: space-evenly;
    }

    .account-list {
        flex: 2;
        background-color: rgb(245, 245, 240);
        border-radius: 12px;
        padding: 1rem;
        border: 1px solid #e5e7eb;
    }

    .account-list h3 {
        border-bottom: 2px solid #e5e7eb;
    }

    .account-edit h3 {
        border-bottom: 2px solid #e5e7eb;
    }

    .account-list-title {
        font-weight: 600;
        margin-bottom: 1rem;
    }

    .account-edit {
        flex: 1;
        background-color: rgb(245, 245, 240);
        border-radius: 12px;
        padding: 1rem;
        border: 1px solid #e5e7eb;
    }

    .account-item {
        display: flex;
        flex-direction: column;
        background-color: white;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        justify-content: space-evenly;
        justify-items: center;
        margin: 1rem;
        padding: 2rem;   
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .account-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

    .image-drop-target {
        position: relative;
        cursor: copy;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 12px;
        align-self: center;
        width: 100%;
        height: 100px;
        background-color: rgb(240, 240, 240);
        border: 1px solid #e5e7eb;
        transition: all 0.3s ease;
    }
    .image-drop-target:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        filter: brightness(0.7);

        p {
            opacity: 0.5;
        }
        img {
            filter: opacity(0.2) brightness(0.5);
        }
    }
    .image-drop-target.drag-over {
        transform: translateY(-2px);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        filter: brightness(0.7);
        border: 1px solid rgb(131, 185, 255);
    }
    .image-drop-target.uploading {
        transform: none;
        filter: brightness(0.7);
        border: 1px solid #e5e7eb;
        box-shadow: none;

        p {
            opacity: 0.5;
        }

        img {
            filter: opacity(0.2) brightness(0.5);
        }
    }

    .image-drop-target p {
        z-index: 10;
        text-align: center;
        position: absolute;
        cursor: unset;
        opacity: 0.5;
        transition: opacity 0.3s ease;
    }

    .item-group {
        display: flex;
        align-items: center;
        justify-content: space-around;
        gap: 0.5rem;
    }

    .account-item label {
        font-size: 1.5rem;
        font-weight: 450;
    }

    .account-item input {
        flex: 5;
        font-size: 1.5rem;
        padding: 0.5rem;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        background-color: white;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .account-item input:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

    .account-item input:disabled {
        filter: brightness(0.95);
        color: black;
    }
    
    .account-item button {
        flex: 1;
        font-size: 1.5rem;
        padding: 0.5rem;
        background-color: #2196F3;
        border-radius: 12px;
        margin: 0.5rem;
        border: 1px solid #e5e7eb;
        color: white;

    }

    .account-item .account-logo {
        display: flex;
        align-self: center;
    }

    .account-item .account-input-item {
        display: flex;
        align-items: center;
    }

    .token-input {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        justify-content: center;
    }

    .token-input select {
        background-color: white;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 0.5rem;
        font-size: 1.5rem;
    }
/*  */

/* Alert/Notification Styles */
    .alert {
        opacity: 0;
        justify-self: center;
        width: 40%;
        left: 50%;
        transform: translateX(-50%);
        z-index: 999;
        top: 10rem;
        position: fixed;
        padding: 1rem;
        border-radius: 6px;
        margin: 1rem 0;
        margin-top: 0;
        font-weight: 500;
        transition: opacity 0.4s ease;
    }

    .alert.success {
        background: rgba(220, 252, 231, 0.75);
        color: #166534;
        border: 1px solid #bbf7d0;
    }

    .alert.error {
        background: rgba(254, 226, 226, 0.75);
        color: #991b1b;
        border: 1px solid #fecaca;
    }

    .alert.warning {
        background: rgba(255, 243, 194, 0.75);
        color: #78350f;
        border: 1px solid #fde68a;
    }

    .alert.info {
        background: rgba(219, 234, 254, 0.75);
        color: #1e40af;
        border: 1px solid #bfdbfe;
    }
/*  */

/* Buttons */
    button.big-button {
        font-size: 1rem;
        padding: 1rem;
        background: #2196F3;
        color: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease, opacity 0.3s ease;
    }
    button.danger {
        background: rgb(255, 59, 48);
    }
    button.warning {
        background: rgb(241, 211, 0);
        color: black;
    }
    button.big-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    }
    button:disabled {
        background: rgba(100,100,100,0.3);
        color: rgb(55,55,55);
        opacity: 0.5;
        box-shadow: inset 0 -1px 4px 2px rgba(0,0,0,0.2);
        cursor: default;
    }
    button:disabled:hover {
        transform: none;
        box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    }

    button.small-button {
        font-size: 1rem;
        padding: 0.5rem;
        background: #2196F3;
        color: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    button.small-button.danger {
        background: rgb(255, 59, 48);
    }
    button.small-button.warning {
        background: rgb(241, 211, 0);
        color: black;
    }
    button.small-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    }

    button.add-icon-button {
        min-width: 5px;
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        font-size: 1rem;
        padding: 0.5rem 1rem;
        background: #2196F3;
        color: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    button.add-button {
        padding: 5px;
        min-width: 5px;
        width: 3.5rem;
        height: 3.5rem;
        display: flex;
        justify-content: center;
        font-size: 2rem;
        background: white;
        color: #707070;
        border: 1px solid #e5e7eb;
        border-radius: 50%;
        transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    }

    .button-group {
        align-self: center;
        margin: 0 1rem;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .button-grid {
        align-self: center;
        display: grid;
        grid-template-columns: 1fr 1fr;
        justify-content: center;
        gap: 1rem;
    }

    .button-grid.full {
        width: 100%;
    }

    .button-label-group {
        display: grid;
        justify-items: center;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        align-items: center;
    }

    button.category-button {
        padding: 2rem 1rem;
        font-size: 1rem;
        background: #2196F3;
        color: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    }
    button.category-button.active {
        background: #5f8aad;
        /* filter: brightness(0.8); */
        color: white;
        transform: translateY(-1px);
    }

    button.icon-button {
        min-width: 5px;
        width: 3.5rem;
        height: 3.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        font-size: 1rem;
        padding: 0.5rem 1rem;
        background: #2196F3;
        color: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    }
    button.icon-button.big {
        width: 5rem;
        height: 5rem;
        border-radius: 12px;
    }
    button.icon-button img {
        width: 2.5rem;
        height: 2.5rem;
    }
    button.icon-button.big img {
        width: 4rem;
        height: 4rem;
    }
    button.icon-button:disabled img {
        filter: brightness(0.5);
    }
    button.icon-button:disabled {
        background: rgba(100,100,100,0.3);
        color: rgb(55,55,55);
        opacity: 0.5;
        box-shadow: inset 0 -1px 4px 2px rgba(0,0,0,0.2);
        cursor: default;
    }
    button.icon-button:disabled:hover {
        transform: none;
        box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    }
    button.icon-button.active {
        background: #5f8aad;
        filter: brightness(0.8);
        color: white;
        transform: translateY(-1px);
    }

    button {
        cursor: pointer;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    button:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    }

    button:active {
        filter: brightness(0.95);
        transform: translateY(-1px);
    }
/*  */

table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    padding: 0.5rem;
    text-align: left;
    border: 1px solid #e5e7eb;
}

thead > tr {
    background-color: rgb(0, 110, 255);
    color: white;
}

tbody > tr > td:last-of-type {
    text-align: right;
    align-items: flex-end;
}

tbody > tr:nth-of-type(even) {
    background-color: #f9fafb;
}

tbody > tr > td > button {
    margin: 0.2rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background-color: #2196F3;
    color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease
}

.user-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    align-items: center;
}

.user-preview-item {
    position: relative;
}
.user-preview-item img {
    cursor: pointer;
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    transition: filter 0.3s ease;
}
.user-preview-item a {
    display: none;
    position: absolute;
    text-decoration: none;
    bottom: 35%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    text-align: center;
    justify-self: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.user-preview-item:hover {
    img {
        filter: brightness(0.6);
    }

    a {
        display: block;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        line-height: 1;
    }
    .page-container {
        padding: 1rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        align-content: center;
    }
    
    .header-title {
        align-items: center;
        padding: 0;
    }
    
    header h1 {
        font-size: 2rem;
    }

    .login-info {
        width: 90%;
    }

    .login-info h2 {
        font-size: 2rem;
    }

    .login-item input,
    .login-item select {
        width: 85%;
    }
    
    section {
        padding: 1rem;
    }

    nav {
        justify-content: center;
    }

    .nav-menu {
        z-index: 3;
        width: 90%;
        justify-content: center;
        justify-items: center;
        align-self: center;
    }

    .nav-menu.hidden,
    .nav-menu.show {
        transform: none;
    }

    .nav-icon {
        cursor: pointer;
        justify-self: left;
        z-index: 4;
        padding: 5px;
        position: relative;
        anchor-name: --nav;
        content: "";
        height: 0.2rem;
        width: 2rem;
        border-block-start: 3px solid rgb(255, 255, 255);
        margin-top: -2rem;
        margin-left: 1rem;
        margin-bottom: 1.4rem;
        &::before,&::after {
            padding-top: 5px;
            content: "";
            height: 0.2rem;
            width: 2rem;
            border-block-start: 3px solid rgb(255, 255, 255);

            position: absolute;
            position-anchor: --nav;
            top: 0;
            left: 0;
        }
        &::before {
            transform: translateY(0.32rem);
        }
        &::after {
            transform: translateY(-0.7rem);
        }
    }

    .nav-menu.show .nav-icon {
        z-index: 4;
        padding: 5px;
        position: relative;
        anchor-name: --nav;
        content: "";
        height: 0.2rem;
        border: none;
        border-block-start: none;
        width: 2rem;
        margin-top: -2rem;
        margin-left: 1rem;
        margin-bottom: 1.4rem;
        &::before,&::after {
            padding-top: 5px;
            content: "";
            height: 0.2rem;
            width: 2rem;
            border-block-start: 3px solid rgb(255, 255, 255);

            position: absolute;
            position-anchor: --nav;
            top: 0;
            left: 0;
        }
        &::before {
            transform: translateX(-0.3rem) rotate(45deg);
        }
        &::after {
            transform: rotate(-45deg);
        }
    }

    .nav-menu ul {
        width: 100%;
        z-index: 0;
        transition: height 0.5s ease-in-out;
        margin: 0;
        overflow: hidden;
        height: 0;
        margin-bottom: 1rem;
        border-radius: 12px;
        justify-self: center;
        border-top-right-radius: 0;
        border-top-left-radius: 0;
    }

    .nav-menu.show ul {
        display: grid;
    }

    .nav-menu li {
        align-content: center;
        display: block;
        font-size: 0.8rem;
        color: white;
        list-style: none;
        border: none;
        padding: 0.5rem;
        margin: 0;
        letter-spacing: 0;
        border-radius: 0;
        border-bottom: 1px solid #e5e7eb;
    }
    li.logout-link {
        margin: 0;
        text-align: right;
    }

    .alert {
        top: 12rem;
        width: 80%;
    }

    footer {
        padding: 0.2rem;
        font-size: 1rem;
    }

    .detail-card {
        gap: 0.5rem;
        align-items: stretch;
        background-color: white;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        margin: 0.5rem;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .brightness-bar {
        flex-direction: unset;
        flex-wrap: nowrap;
    }

    .apply-pattern-button {
        padding: 0.5rem;
    }

    .select-card {
        padding: 1rem;
    }

    .select-card h4 {
        font-size: 1rem;
        letter-spacing: 0;
    }

    .controls-container {
        gap: 0.5rem;
    }

    .control-item {
        margin: 0.5rem;
    }

    section .section-header {
        padding-bottom: 0;
        margin-bottom: 1rem;
        justify-content: space-evenly;
    }

    .section-header .search-bar {
        width: 80%;
    }
    .search-bar input {
        width: 100%;
    }

    section .section-header.dashboard-header h2 {
        display: none;
    }

    .section-header-buttons {
        margin-bottom: -1.1rem;
    }

    .section-header-buttons:hover {
        transform: none;
    }

    .account-info {
        display: block;
        justify-self: center;
    }

    .account-details {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .account-item input {
        width: 100%;
        font-size: 1.2rem;
        flex: 5;
    }

    .account-item label {
        font-size: 1.2rem;
    }

    .account-item button {
        flex: 1;
        font-size: 1rem;
        padding: 0.5rem;
    }

    .item-group {
        display: flex;
    }

    .support-info {
        width: 100%;
    }

    .modal-backdrop {
        align-items: center;
        justify-items: center;
    }

    .modal {
        bottom: auto;
        right: auto;
    }

    .preview-item {
        display: flex;
        flex-direction: column;
    }
    .preview-item h3 {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #e5e7eb;
    }
    .preview-details {
        display: grid;
        grid-template-columns: 5fr 2fr;
        gap: 0.5rem;
    }
    .preview-actions {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        gap: 0.5rem;
    }

    table {
        font-size: 0.8rem;
        overflow: auto;
        display: block;
        max-width: 80svw;
        margin: 0 auto;
    }

    .toolbar-content .input-group {
        gap: 0.1rem;
    }

    .pattern-item span {
        margin-top: 5px;
        opacity: 1;
        filter: brightness(1.2);
    }

    .pattern-item {
        div.preview-background {
            box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
        }
    }
}

@media screen and (orientation: landscape) and (max-height: 450px) {
    body {
        line-height: 1;
    }
    .page-container {
        padding: 0;
    }
    main {
        margin: 1rem;
    }
    header {
        display: flex;
        flex-direction: row;
        justify-content: space-evenly;
        padding: 1rem;
        margin: 0;
        border-top-right-radius: 0;
        border-top-left-radius: 0;
    }
    nav {
        justify-content: center;
    }
    .nav-menu {
        z-index: 3;
        width: 90%;
        justify-content: center;
        justify-items: center;
        align-self: center;
    }

    .nav-menu.hidden,
    .nav-menu.show {
        transform: none;
    }

    .nav-icon {
        z-index: 4;
        padding: 5px;
        position: relative;
        anchor-name: --nav;
        content: "";
        height: 0.2rem;
        width: 2rem;
        border-block-start: 3px solid rgb(255, 255, 255);
        margin-top: -2rem;
        margin-left: 1rem;
        margin-bottom: 1.4rem;
        &::before,&::after {
            padding-top: 5px;
            content: "";
            height: 0.2rem;
            width: 2rem;
            border-block-start: 3px solid rgb(255, 255, 255);

            position: absolute;
            position-anchor: --nav;
            top: 0;
            left: 0;
        }
        &::before {
            transform: translateY(0.32rem);
        }
        &::after {
            transform: translateY(-0.7rem);
        }
    }

    .nav-menu.show .nav-icon {
        z-index: 4;
        padding: 5px;
        position: relative;
        anchor-name: --nav;
        content: "";
        height: 0.2rem;
        border: none;
        border-block-start: none;
        width: 2rem;
        margin-top: -2rem;
        margin-left: 1rem;
        margin-bottom: 1.4rem;
        &::before,&::after {
            padding-top: 5px;
            content: "";
            height: 0.2rem;
            width: 2rem;
            border-block-start: 3px solid rgb(255, 255, 255);

            position: absolute;
            position-anchor: --nav;
            top: 0;
            left: 0;
        }
        &::before {
            transform: translateX(-0.3rem) rotate(45deg);
        }
        &::after {
            transform: rotate(-45deg);
        }
    }

    .nav-menu ul {
        width: 100%;
        z-index: 0;
        transition: height 0.5s ease-in-out;
        margin: 0;
        overflow: hidden;
        height: 0;
        margin-bottom: 1rem;
        border-radius: 12px;
        justify-self: center;
        border-top-right-radius: 0;
        border-top-left-radius: 0;
    }

    .nav-menu.show ul {
        display: grid;
    }

    .nav-menu li {
        align-content: center;
        display: block;
        font-size: 0.8rem;
        color: white;
        list-style: none;
        border: none;
        padding: 0.5rem;
        margin: 0;
        letter-spacing: 0;
        border-radius: 0;
        border-bottom: 1px solid #e5e7eb;
    }
    li.logout-link {
        margin: 0;
    }

    footer {
        padding: 0;
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
    }

    .canvas-section {
        padding: 0.5rem;
    }
    .canvas-container {
        display: grid;
        grid-template-columns: 4fr 1fr;
    }
    .instruction-text {
        padding: 0.5rem;
    }
    .toolbar-content .input-group {
        gap: 0.1rem;
    }

    .preview-canvas-section {
        justify-self: center;
        width: 90%;
        padding: 1rem 2rem;
    }

    .patterns-section {
        justify-self: center;
        width: 90%;
    }

    .preview-item {
        display: grid;
        grid-template-columns: 2fr 3fr 2fr;
    }
    .preview-details {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    .pattern-item span {
        margin-top: 5px;
        opacity: 1;
        filter: brightness(1.2);
    }

    /* .pattern-item {
        div.preview-background {
            box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
        }
    } */
}