@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Kode+Mono:wght@400&display=swap');

html {
    --logo-size: 3.5em;
    --header-height: 6em;
    --box-border-radius: .4em;
    --shadow-color: rgba(0,0,0,0.5);
    --box-shadow: 0 1em 3em 0 var(--shadow-color);
    --card-width: 24em;
    --gold-blur: .25em;
}

@import url('colors.css');

/* ------------------------------------------------------------ */

.hidden {
    display: none !important;
}

/* ------------------------------------------------------------ */

html {
    margin: 0;
    padding: 0;
    height: 100%;
    color: var(--font-color);
    background-color: var(--bg-color);
    font-family: 'Inter', 'Open+Sans', Helvetica, Arial, sans-serif;
    /* font-family: "SF Pro Text","SF Pro Icons","AOS Icons","Helvetica Neue",Helvetica,Arial,sans-serif; */
}

body {
    display: inline-block;
    min-height: 100vh;
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.site-logo {
    /*background: var(--small-logo) no-repeat; */
    content: var(--small-logo);
    background-repeat: no-repeat;
    background-size: contain;
    cursor: pointer;
    width: var(--logo-size);
    height: var(--logo-size);
    filter: drop-shadow(0 0 .2em var(--gold))
            drop-shadow(0 0 .4em var(--gold))
            drop-shadow(0 0 .6em var(--gold-hot));
    margin: 0 1em;
}

.currency-symbol {
    background-image: linear-gradient(to bottom, #666 0%, #aaa 20%, #fff 50%, #aaa 80%, #666 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    filter: drop-shadow(0 0 .2em var(--gold))
            drop-shadow(0 0 .4em var(--gold))
            drop-shadow(0 0 .6em var(--gold-hot));
}

.rotate-90 {
    transform: rotate(90deg);
    transition: transform 0.2s ease-in-out;
}

.rotate-180 {
    transform: rotate(180deg);
    transition: transform 0.2s ease-in-out;
}

.rotate-270 {
    transform: rotate(270deg);
    transition: transform 0.2s ease-in-out;
}

/* ------------------------------------------------------------ */

.smooth-menu {
    .menu-item {
        cursor: pointer;
    }

    .menu-highlight-bar {
        position: absolute;
        background: var(--active-font-color);
        transition: 0.24s ease;
        opacity: 0.7;
        pointer-events: none;
        display: none;
        mix-blend-mode: color-dodge;
    }
}

/* ------------------- checkbox that looks like a switch ------------------- */

.checkbox-slider {
    display: inline-block;
    height: 1.6em;
    width: 3em;
    border-radius: 1em;
    border: 1px solid var(--font-color);

    input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .checkbox-slider-knob {
        display: inline-block;
        width: 2em;
        height: 2em;
        background-color: white;
        border-radius: 50%;
        transform: translate(0, -0.2em);
        transition: transform var(--transition-duration, 0.5s) ease;
    }
}

.checkbox-slider:has(input:checked) {
    background-color: green;
    .checkbox-slider-knob {
        transform: translate(1.2em, -0.2em);
    }
}

/* ------------------------------------------------------------ */

.admin-menu-item {
    margin: 0.25em 0.5em;
    padding: 0.4em 0.75em;
    border-radius: var(--box-border-radius);
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;

    background-color: var(--content-bg-color);
    &.menu-selected {
        background-color: var(--link-font-color);
        color: var(--bg-color);
    }
}

.admin-menu-header {
    background-color: var(--bars-bg-color);
    font-weight: 600;
}

.counter {
    border-radius: 1em;
    padding: .2em;
    margin-top: -0.2em;
    margin-bottom: -0.2em;
    min-width: 1.2em;
    font-weight: 400;
    text-align: center;
    margin-left: auto;
}

.counter:empty {
    display: none;
}

/* ------------------------------------------------------------ */

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(var(--card-width), 100%), 1fr));
    gap: .5em;

    .card {
        min-width: var(--card-width);
        max-width: var(--card-width) * 1.5;
        margin: .4em;
        border: 1px solid var(--font-color);
        border-radius: var(--box-border-radius);
        background-color: var(--content-bg-color);
        h2 {
            border-top-left-radius: var(--box-border-radius);
            border-top-right-radius: var(--box-border-radius);
            background-color: var(--bars-bg-color);
            text-align: center;
            padding: .5em;
            margin: 0;
            font-size: 1.2em;
            font-weight: 600;
        }
        .card-content {
            padding: .5em;
            ul {
                list-style: none;
                padding: .5em;
                margin: 0;
            }
            /* Keep each list item on its own line and align name/value spans */
            ul > li {
                display: flex;
                align-items: baseline;
                justify-content: space-between;
                width: 100%;
                gap: .5em;
            }
        }
    }
}

/* ------------------------------------------------------------ */

.value-name {
     font-weight: 600;
}

.value-value {
    font-weight: 400;
    text-align: right;
    margin-left: auto;
}

/* ------------------------------------------------------------ */

.sortable-table {
    width: 100%;
    border-collapse: collapse;
    th, td {
        border: 0.5px solid var(--font-color);
        padding: .4em .6em;
    }
    th {
        background-color: var(--bars-bg-color);
        user-select: none;
        -webkit-user-select: none;
    }
    tr:nth-child(even) {
        background-color: var(--zebra-bg-color);
    }
    th[data-sort="asc"]::after {
        content: '\25B2'; /* ▲ */
    }
    th[data-sort="desc"]::after {
        content: '\25BC'; /* ▼ */
    }
    th[data-sort="none"]::after {
        content: '\25B2 \25BC'; /* ▲▼ */
    }
    th[data-sort]::after {
        margin-left: 0.5em;
        font-size: 64%;
    }
    th[data-sort] {
        cursor: pointer;
    }
}

/* ------------------------------------------------------------ */

.chat-preview {
    font-size: 60%;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.chat-timestamp {
    font-size: 64%;
    font-weight: 400;
}

.customer-chat-message {
    margin-right: auto;
    background-color: rgba(48, 255, 128, 0.4);
}

.support-chat-message {
    margin-left: auto;
    text-align: right;
    background-color: rgba(48, 128, 255, 0.4);
}

.system-chat-message {
    margin-left: auto;
    margin-right: auto;
    font-style: italic;
    font-weight: 400;
    text-align: center;
    background-color: rgba(255, 48, 48, 0.4);
}
.system-chat-message::before, .system-chat-message::after {
    content: ' ----- ';
}

.customer-chat-message, .support-chat-message, .system-chat-message {
    display: table;
    max-width: 80%;
    min-height: 1em;
    border-radius: 1em;
    padding: .4em 1em;
    margin-top: .2em;
    margin-bottom: .2em;
}

/* ------------------------------------------------------------ */

.overlay-container {
    background-color: var(--content-bg-color);
    z-index: 10000;
    border: 1px solid var(--font-color);
    border-radius: var(--box-border-radius);
    box-shadow: var(--box-shadow);

    .header {
        position: relative;
        top: 0;
        left: auto;
        right: auto;
        flex-shrink: 0;
        height: 1.6em;
        text-align: center;
        background-color: var(--bars-bg-color);
        border-radius: var(--box-border-radius) var(--box-border-radius) 0 0;
        padding: 0.5em 1em;
        font-size: 1.2em;
        font-weight: 600;
    }

    .content {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        flex: 1 1 auto;
        overflow-y: auto;
        padding: 2em;
    }

    .button-row {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        flex-shrink: 0;
        display: flex;
        justify-content: right;
        margin: 1em;
        gap: 1em;
        button {
            padding: 0.5em 1em;
            border-radius: 0.5em;
            border: 1px solid var(--font-color);
            background-color: var(--content-bg-color);
            color: var(--font-color);
            cursor: pointer;
        }
        button:hover {
            background-color: var(--link-font-color);
            color: var(--bg-color);
        }
    }

    .overlay-box-close {
        position: absolute;
        top: 0;
        right: 0;
        cursor: pointer;
        transition: transform 0.2s ease;
    }
    .overlay-box-close:hover {
        transform: scale(1.1) rotate(180deg);
    }
}

.centered-container {
    display: flex;
    flex-direction: column;
    position: fixed;
    width: 70%;
    height: 80%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    justify-content: center;
    align-items: center;
}

.message-box {
    display: flex;
    flex-direction: column;
    position: fixed;
    max-width: 40vw;
    max-height: 80vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 0.5em;
    border: 1px solid var(--font-color);
    background-color: var(--message-box-bg-color);
    color: var(--message-box-font-color);
    width: fit-content;
    min-width: 20em;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(.2em);
    -webkit-backdrop-filter: blur(.2em);
    transition: background-color .3s ease-in-out;
    z-index: 9999;
}

.tv-screen {
    animation: unfold .3s forwards;
    &.hidden {
        transform: scaleY(.01) scaleX(0.01);
        animation: unfold .3s backwards;
    }
}

@keyframes unfold {
    0% {
        transform: scaleY(.01) scaleX(0.01);
    }
    30% {
        transform: scaleY(.01) scaleX(1);
    }
    100% {
        transform: scaleY(1) scaleX(1);
    }
}

/* ------------------------------------------------------------ */

.notification-bars-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    pointer-events: none; /* Allow clicks to pass through container */
}

.notification-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #ffd700; /* Yellow background */
    color: #000;
    padding: 12px 40px 12px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto; /* Re-enable clicks on the bar itself */
    transition: top 0.3s ease;
}

.notification-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.notification-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #000;
    padding: 0;
    margin-left: 15px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

.notification-close:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.currency-flag-img {
    width: 60px;
    height: 40px;
    object-fit: contain;
}

.linkyLink {
    cursor: pointer;
    color: var(--link-font-color);
}
.linkyLink:hover {
    text-decoration: underline;
}
