@font-face {
    font-family: ringbearer;
    src: url(../fonts/ringbearer.ttf);
}
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }

/* Toast Notification Styles */
@keyframes toastIn {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100px);
        opacity: 0;
    }
}

:root {
  --present-dark-color: #155724;
  --present-main-color: color-mix(in hsl, var(--present-dark-color), #ffffff 30%);;
  --present-light-color: color-mix(in lab, var(--present-dark-color), #ffffff 90%);
  --absent-dark-color: #721c24;
  --absent-main-color: color-mix(in hsl, var(--absent-dark-color), #ffffff 30%);;
  --absent-light-color: color-mix(in lab, var(--absent-dark-color), #ffffff 90%);
  /* --pending-dark-color: #91741d; */
  --pending-dark-color: #856300;
  --pending-main-color: color-mix(in hsl, var(--pending-dark-color), #ffffff 30%);
  --pending-light-color: color-mix(in lab, var(--pending-dark-color), #ffffff 90%);
}


.adr-toast {
    position: fixed;
    bottom: -200px;
    top: 10px;
    left:  10px;
    right: 10px;
    background-color: #4c4c4c;
    color: #ffffff;
    padding: 11px 17px;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.85);
    z-index: 9999;
    transition: all 0.4s ease-in-out;
    border-left: 4px solid #ffff00;
    &.adr-toast-type-ok {
        border-left-color: #26d45f;
        & .adr-toast-title {
            color: #26d45f;
        }
    }
    &.adr-toast-type-warning {
        border-left-color: #ffc107;
        & .adr-toast-title {
            color: #ffc107;
        }
    }
    &.adr-toast-type-error {
        border-left-color: #dc3545;
        & .adr-toast-title {
            color: #dc3545;
        }
    }

    & .adr-toast-title {
        font-weight: bold;
        font-size: 16px;
        margin-bottom: 4px;
        color: #ffff00;
    }

    & .adr-toast-message {
        font-size: 14px;
        color: #ffffff;
    }
}

.adr-toast-visible {
    /*bottom: 20px;*/
    animation: toastIn 0.3s ease-in-out forwards;
    height: fit-content;
}

.adr-toast:not(.adr-toast-visible) {
    animation: toastOut 0.3s ease-in-out forwards;
    height: fit-content;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #000000;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    height: 100vh;

    & .underlay {
        position: fixed;
        display: block;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: -2;
        opacity: 0;
        background-color: rgba(0, 0, 0, 0.87);
        transition: all 2s ease-in-out;
        transition-property: opacity;
        transition-duration: 0.2s;
        transition-timing-function: ease-in-out;
    }

    /* Show underlay when a slot-game is open or game-creation-form is raised */
    &:has(.slot-game[open]),
    &:has(.game-creation-form.raised) {
        .underlay {
            z-index: 1;
            opacity: 1;
        }

    }
}


.overlay {
    position: absolute;
    display: block;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0;
    background-color: rgba(255, 255, 255, 0.8);
    transition: all 2s ease-in-out;
    transition-property: opacity;
    transition-duration: 0.2s;
    transition-timing-function: ease-in-out;
    .contentbox {
        width: 70%;
        height: 60%;
        margin: 20% auto;
        background: linear-gradient(45deg, #333, #111);
        border-radius: 1em;
        display: flex;
        flex-direction: column;
        align-items: center;
        .title{
            color: #f0f0f0;
            font-variant: small-caps;
            text-align: center;
            font-size: 2.4em;
            padding: 1.4em 0;
        }
        .spinner {
            width: 10em;
            padding: 15px;
            background: #f7e806;
            aspect-ratio: 1;
            border-radius: 50%;
            mask: conic-gradient(#0000, #000) subtract, linear-gradient(#000 0 0) content-box;
            box-sizing: border-box;
            animation: spin 1s linear infinite;
        }
    }
}
/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 84px;
    background-color: #ffff00;
    color: #000000;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0px 3px 8px 0px #5f542480;

    & .logo-section {
        display: flex;
        align-items: center;
        gap: 10px;

        & .logo {
            width: 64px;
            height: 64px;
            color: #ffff00;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 20px;
            margin: 10px 10px 10px 15px;
            & > img {
                width: 100%;
                height: 100%;
                object-fit: contain;
            }
        }
    }

    & .center-section {

        align-items: center;
        justify-content: center;
        & .topcenter > img {
            height: 22px;
            object-fit: contain;
            vertical-align: middle;
            margin-bottom: 6px;
            display:none;
        }
        & .midcenter {
            font-weight: bold;
            font-size: 36px;
            text-align: center;
            font-family: ringbearer;
            margin-bottom: 8px;

        }
    }

    & .user-section {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 5px;
        margin-right: 15px;

        & .username {
            font-size: 14px;
            font-weight: 500;
        }

        & .logout-btn {
            padding: 5px 15px;
            font-size: 12px;
        }
    }

}



.btn:active {
    background-color: #333333;
}

.btn {
    background-color: #000000;
    color: #ffff00;
    border: 2px solid #000000;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    user-select: none;

    text-align: center;
    padding: 6px 10px;
    border: 1px solid #333333;
    background: rgb(0, 0, 0);
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    /* flex-grow: 1;*/
    justify-content: space-between;

}

.login-btn {
    padding: 8px 20px;
    font-size: 14px;
}


.newgame-btn {
    padding: 0 10px 2px 0;
    margin: 0 0 6px 13px;
    font-size: 12px;
}

/* Main Container with Sliding Navigation */
.main-container {
    margin-top: 84px;
    margin-bottom: 55px;
    height: calc(100vh - 139px);
    overflow: hidden;
    & .panel-container {
        display: flex;
        height: 100%;
        transition: transform 0.4s ease-in-out;
    }
}


.main-container.view-details .panel-container {
    transform: translateX(-100%);
}

/* Main Content */
.main {
    width: 100%;
    flex-shrink: 0;
    padding: 0 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}


.main-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
}

.slide-back-btn {
    padding: 0;
    /* font-size: 19px; */
    /* white-space: nowrap; */
    /* color: #ffff00; */
    /* border-radius: 34px; */
    border: 0;
}

#detailsContent {
    background-color: #ffffff;
    color: #000000;
    padding: 15px;
    border-radius: 4px;
    min-height: 200px;
}

#detailsContent h2 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #000000;
}

#detailsContent h3 {
    font-size: 16px;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 10px;
    color: #333333;
}

#detailsContent hr {
    border: none;
    border-top: 1px solid #dddddd;
    margin: 15px 0;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
}

.player-name {
    font-weight: bold;
    flex: 1;
}

.player-status {
    padding: 3px 8px;
    background: #e9ecef;
    border-radius: 3px;
    font-size: 11px;
}

.player-owner {
    padding: 3px 8px;
    background: #ffc107;
    color: #333;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

.page-title {
    color: #ffff00;
    font-size: 24px;
    contain-intrinsic-block-size: auto 100px;
    /* margin: 10px 0; */
    padding-bottom: 5px;
    text-align: center;
}

.slots-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.main-slot-selected .slot-item {
    display: none;

}
.main-slot-selected .slot-item.slot-selected {
    display: flex;
}

.slot-item {
    background-color: #ffffff;
    color: #000000;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    -webkit-user-select: none;
    user-select: none;


    .slot-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

/*******************************
* Generic header with time info *
******************************/
.time-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px;
    background-color: yellow;

    & .name {
        font-size: 16px;
        font-weight: bold;
        padding-bottom: 5px;
    }

    & .time {
        display: flex;
        flex-direction: column;
        gap: 0px;
        text-align: right;

        .time-time {
            font-size: 10px;
            color: #333333;
            display: block;
            font-weight: 600;
        }

        .time-day {
            font-size: 11px;
            color: #666666;
            font-weight: 500;
        }
    }
}

/*******************************
* Game Creation Form *
******************************/
.game-creation-form {

    &.raised {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        animation: raiseForm 0.3s ease forwards;
        visibility: visible;
        display: flex;
        flex-direction: column;
        justify-content: stretch;
        margin: 0 15px;
        padding: 0;
        align-items: center;
        background-color: #ffffff;
        z-index: 2;
        gap: 8px;
    }

    & .header {
            background-color: #ffff00;
    }

    & .name {
        color: #000000;
    }

    & .time {
        color: #000000;

        .time-day {
            font-weight: 700;
        }
    }


    & .game-creation-form-inputzone {
        width: 100%;
        padding: 0 10px;
        & .game-name-input {
            flex: 1;
            width: 100%;
            box-sizing: border-box;
            padding: 6px 14px;
            margin: 18px 0 6px;
            font-size: 18px;
            border: 2px solid #ffff00;
            background-color: #ffffff;
            color: #000000;
            border-radius: 28px;
            outline: none;
            transition: border-color 0.2s;

            &::placeholder {
                color: #999999;
            }
        }
    }
    & .game-creation-form-buttonzone {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-evenly;
        padding: 12px 0;
        gap: 10px;


        & .cancel {
            background: #6c757d;
            color: white;
            border-color: #6c757d;
        }
        /*
        & .confirm {
            background: #28a745;
            color: white;
            border-color: #28a745;
        }
        */

        & .svgbtn {
            & svg {
                width: 40px;
                height: 40px;
                vertical-align: middle;
                & .outer {
                    fill:#ffff00;
                }
                & .inner {
                    fill:#000000;
                }
                & .glyph {
                    fill:#ffff00;
                }
            }
        }

    }

}

/*******************************
* Game Details *
******************************/
.game-details {
    color: #000000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #ffffff;


    & p {
        margin: 8px 0;
        font-size: 14px;
    }

    & .game-presence-stats {
        display: flex;
        gap: 8px;
        font-size: 12px;
        flex-wrap: wrap;
        padding: 0 8px;

        .stat-badge {
            display: flex;
            align-items: center;
            gap: 3px;
            padding: 4px 6px;
            background: #f8f9fa;
            border-radius: 4px;
        }

        .stat-badge-present {
            color: var(--present-dark-color);
            background-color: var(--present-light-color);
            & .icon {
                color: var(--present-main-color);
            }
        }

        .stat-badge-absent {
            color: var(--absent-dark-color);
            background-color: var(--absent-light-color);
            & .icon {
                color: var(--absent-main-color);
            }
        }

        .stat-badge-pending {
            color: var(--pending-dark-color);
            background-color: var(--pending-light-color);
            & .icon {
                color: var(--pending-main-color);
            }

        }
    }

    & .game-presence-list {
        display: flex;
        flex-direction: column;
        gap: 6px;
        overflow-y: auto;
        padding: 0 8px;

        & .presence-entry {
            display: flex;
            align-items: stretch;
            gap: 10px;
            padding: 2px 6px;
            background: #f8f9fa;
            border-radius: 4px;
            font-size: 13px;

            & .presence-icon svg {
                display: inline-block;
                width: 18px;
                height: 18px;
            }
            &.presence-status-present .presence-icon svg {
                & .circle {
                    fill: var(--present-main-color);
                    stroke: var(--present-main-color);
                }
                & .glyph {
                    stroke: white;
                }
            }
            &.presence-status-absent .presence-icon svg {
                & .circle {
                    fill: var(--absent-main-color);
                    stroke: var(--absent-main-color);
                }
                & .glyph {
                    stroke: white;
                }
            }
            &.presence-status-to_confirm .presence-icon svg {
                & .circle {
                    fill: var(--pending-main-color);
                    stroke: var(--pending-main-color);
                }
                & .glyph {
                    stroke: white;
                }
            }
        }

    }


}

.slot-game {
    margin-bottom: 3px;
    font-size: 14px;

    .content {
        border: 1px solid #cccccc;
        background-color: #ffffff;
        display: flex;
        flex-direction: column;
        padding: 8px 10px;
        gap: 10px;
        width: 100%;
        position: absolute;
    }

}



.game-presence-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 0 12px 8px;

    .presence-btn {
        padding: 6px 10px;
        border: 1px solid #ddd;
        background: white;
        border-radius: 4px;
        font-size: 11px;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.3s ease;
        text-transform: uppercase;
        flex-grow: 1;
        justify-content: space-between;

        &.present {
            background: #28a745;
            color: white;
            border-color: #28a745;
        }

        &.absent {
            background: #dc3545;
            color: white;
            border-color: #dc3545;
        }

        &.pending {
            background: #ffc107;
            color: #333;
            border-color: #ffc107;
        }

        &.unconcerned {
            background: #6c757d;
            color: white;
            border-color: #6c757d;
        }
    }
}


.slot-games {
    margin-top: 5px;
    padding: 0 15px;
}


.slot-footer {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;

    & .slot-location {
        /* margin-top: 10px; */
        font-size: 12px;
        color: #666666;
        padding: 0 8px 4px;
        display: flex;
        align-items: center;
        gap: 6px;

        & svg {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
        }
    }
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #ffff00;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-state-text {
    font-size: 16px;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55px;
    background-color: #ffff00;
    color: #000000;
    padding: 4px;
    text-align: center;
    font-size: 12px;
    /* border-top: 3px solid #ffffff; */
    box-shadow: 0px -3px 8px 0px #00000080;

    & .textlogo img {
        width: 60%;
        height: 100%;
        max-height: 36px;
        object-fit: contain;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #ffff00;
    font-size: 16px;
}

/* Error State */
.error {
    color: #ffffff;
    padding: 15px;
    margin: 15px;
    text-align: center;
    font-weight: bold;
}


.svgbtn {
    & svg {
        width: 40px;
        height: 40px;
        vertical-align: middle;
        & .outer {
            fill:#000;
        }
        & .inner {
            fill:#ffff00;
        }
        & .glyph {
            fill:#000;
        }
    }
}

