body {
    position: relative;
    background: linear-gradient(180deg, #1a0f33 0%, #120926 45%, #080414 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    --bs-body-color: #f1e9ff;
    color: #f1e9ff;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 181, 238, 0.35), transparent 48%),
        radial-gradient(circle at 78% 18%, rgba(135, 233, 255, 0.28), transparent 52%),
        radial-gradient(circle at 60% 82%, rgba(255, 196, 146, 0.18), transparent 55%);
    filter: blur(0px);
    opacity: 0.85;
    pointer-events: none;
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    inset: -10% -5% -5% -5%;
    background: radial-gradient(circle at 50% 80%, rgba(12, 10, 20, 0.65), transparent 75%);
    pointer-events: none;
    z-index: -2;
}


.brand-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1.5rem 0.75rem;
    text-align: center;
}

.brand-logo {
    display: block;
    width: clamp(72px, 12vw, 96px);
    height: clamp(72px, 12vw, 96px);
    border-radius: 1.5rem;
    background-color: rgba(255, 255, 255, 0.08);
    background-image:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 65%),
        linear-gradient(135deg, rgba(135, 83, 255, 0.45), rgba(64, 180, 255, 0.5));
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
    overflow: hidden;
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.brand-logo.has-image {
    background-color: transparent;
    background-size: contain;
}

.brand-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
}

@media (max-width: 576px) {
    .brand-banner {
        padding-top: 1rem;
        padding-bottom: 0.5rem;
    }
    .brand-logo {
        width: clamp(60px, 18vw, 80px);
        height: clamp(60px, 18vw, 80px);
        left: 1rem;
    }
    .brand-title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }
}


.navbar {
    background-image: url('/static/wood.png');
    background-size: cover;
}

.nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0.25rem;
    scrollbar-width: thin;
}

.nav-tabs::-webkit-scrollbar {
    height: 4px;
}

.nav-tabs .nav-link {
    white-space: nowrap;
}

.auth-tabs {
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    margin-bottom: -1px;
}

.auth-tabs .nav-link {
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid transparent;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.05);
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.auth-tabs .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.auth-tabs .nav-link.active {
    color: #fff;
    background: linear-gradient(120deg, rgba(146, 111, 255, 0.9), rgba(104, 209, 255, 0.85));
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.auth-panel {
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.08), transparent 45%),
        radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.05), transparent 55%),
        rgba(15, 12, 38, 0.65);
    backdrop-filter: blur(18px);
    color: #fff;
}

.auth-panel label,
.auth-panel .form-text,
.auth-panel .form-check-label {
    color: rgba(255, 255, 255, 0.85);
}

.auth-panel .form-control,
.auth-panel .form-select {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
}

.auth-panel .form-control:focus,
.auth-panel .form-select:focus {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(158, 134, 255, 0.75);
    box-shadow: 0 0 0 0.25rem rgba(115, 94, 255, 0.25);
    color: #fff;
}

.auth-panel .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.auth-panel .form-check-input {
    border-color: rgba(255, 255, 255, 0.35);
    background-color: transparent;
}

.auth-panel .btn-link {
    color: rgba(255, 255, 255, 0.85);
}

.auth-panel .btn-link:hover {
    color: #fff;
}

.user-tab-content > .tab-pane {
    padding-top: 16px;
}

.user-tab-content > #music {
    padding-top: 20px;
}

.card, .table, .modal-content {
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    border: none;
    --bs-body-color: #212529;
    color: #212529;
}

.dropdown-menu,
.dropdown-item,
.list-group-item,
.toast,
.offcanvas,
.form-control,
.form-select {
    --bs-body-color: #212529;
    color: #212529;
}

.table {
    overflow: hidden;
}

.btn-primary, .btn-success, .btn-danger, .btn-secondary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    transition: transform 0.1s ease-in-out;
}

.btn-primary:hover, .btn-success:hover, .btn-danger:hover, .btn-secondary:hover {
    background-color: #0b5ed7;
    border-color: #0b5ed7;
    transform: scale(1.02);
}

.google-login-btn {
    background-color: #000;
    border-color: #000;
    transition: transform 0.1s ease-in-out, background-color 0.1s ease-in-out;
}

.google-login-btn:hover {
    background-color: #121212;
    border-color: #121212;
    transform: scale(1.02);
}

.slot-calendar {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #ffffff;
}

.slot-modal-section {
    transition: opacity 0.2s ease-in-out;
}

.slot-modal-section.d-none {
    opacity: 0;
}

.slot-modal-section:not(.d-none) {
    animation: slot-modal-fade 0.2s ease-in-out;
}

@keyframes slot-modal-fade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slot-calendar-header {
    padding: 0.5rem 0.75rem;
    background-color: rgba(13, 110, 253, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.slot-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 0.5rem 0.75rem 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(33, 37, 41, 0.65);
    gap: 0.25rem;
    text-align: center;
}

.slot-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    padding: 0.5rem 0.75rem 0.75rem;
}

.slot-calendar-day {
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    padding: 0.5rem 0;
    text-align: center;
    font-size: 0.95rem;
    color: #212529;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.slot-calendar-day:hover,
.slot-calendar-day:focus {
    background-color: rgba(13, 110, 253, 0.12);
    outline: none;
    transform: translateY(-1px);
}

.slot-calendar-day.has-slots {
    background-color: rgba(25, 135, 84, 0.16);
    color: #0f5132;
    font-weight: 600;
}

.slot-calendar-day.has-slots:hover,
.slot-calendar-day.has-slots:focus {
    background-color: rgba(25, 135, 84, 0.3);
}

.slot-calendar-day.selected {
    background-color: #198754;
    color: #fff;
    box-shadow: 0 0 0 1px rgba(25, 135, 84, 0.3);
}

.slot-calendar-day.outside {
    color: rgba(108, 117, 125, 0.6);
}

.slot-calendar-day.outside.has-slots {
    background-color: rgba(25, 135, 84, 0.12);
}

.slot-calendar-day.outside.selected {
    color: #fff;
}

#slotSelectedTimeDisplay {
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

#slotTimeList .list-group-item {
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

#slotTimeList .list-group-item.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.google-login-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
}

.google-login-icon svg {
    width: 100%;
    height: 100%;
}

.nav-tabs .nav-link.active {
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

/* Chat bubbles */
@keyframes chatCloudFloat {
    0% {
        background-position: 0% 0%, 40% 30%, 100% 100%;
    }
    50% {
        background-position: 20% 10%, 60% 40%, 80% 20%;
    }
    100% {
        background-position: 35% 20%, 80% 50%, 60% 10%;
    }
}

.chat-bubble {
    position: relative;
    z-index: 0;
    max-width: 75%;
    padding: 1rem 1.5rem;
    border-radius: 2.5rem;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    align-self: flex-start;
    color: #0a0619;
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0)),
        radial-gradient(circle at 82% 25%, rgba(190, 208, 255, 0.8), rgba(190, 208, 255, 0)),
        linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(196, 207, 255, 0.6));
    background-size: 160% 160%;
    animation: chatCloudFloat 16s ease-in-out infinite alternate;
    box-shadow: 0 18px 40px rgba(8, 4, 20, 0.35);
    overflow: visible;
}

.chat-bubble::before,
.chat-bubble::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background:
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0)),
        radial-gradient(circle at 70% 60%, rgba(176, 193, 255, 0.65), rgba(176, 193, 255, 0));
    filter: blur(0.5px);
    opacity: 0.85;
    z-index: -1;
}

.chat-bubble::before {
    width: 42%;
    height: 54%;
    top: -22%;
    left: 14%;
}

.chat-bubble::after {
    width: 34%;
    height: 46%;
    bottom: -18%;
    right: 18%;
}

.chat-bubble.me {
    align-self: flex-end;
    background:
        radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0)),
        radial-gradient(circle at 82% 30%, rgba(233, 187, 255, 0.82), rgba(233, 187, 255, 0)),
        linear-gradient(135deg, rgba(244, 201, 255, 0.88), rgba(146, 205, 255, 0.6));
    background-size: 170% 170%;
}

.chat-bubble.me::before {
    left: auto;
    right: 18%;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0)),
        radial-gradient(circle at 70% 65%, rgba(232, 186, 255, 0.7), rgba(232, 186, 255, 0));
}

.chat-bubble.me::after {
    right: auto;
    left: 24%;
    background:
        radial-gradient(circle at 45% 45%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0)),
        radial-gradient(circle at 75% 60%, rgba(158, 207, 255, 0.68), rgba(158, 207, 255, 0));
}

.chat-bubble.other {
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0)),
        radial-gradient(circle at 78% 24%, rgba(188, 220, 255, 0.78), rgba(188, 220, 255, 0)),
        linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(202, 222, 255, 0.58));
    background-size: 150% 150%;
}

.chat-timestamp {
    font-size: 0.75rem;
    font-style: italic;
    opacity: 0.65;
    color: rgba(8, 4, 20, 0.65);
    text-align: right;
    margin-top: 4px;
}

#typingIndicator {
    color: #ffffff !important;
    text-shadow: 0 0 6px rgba(10, 7, 25, 0.55);
}

#surveyEditorModal .modal-dialog {
    width: min(98vw, 1280px);
    max-width: 1280px;
    margin: 1rem auto;
    height: calc(100vh - 2rem);
}

#userSurveyModal .modal-dialog {
    width: min(98vw, 1100px);
    max-width: 1100px;
    margin: 1rem auto;
    height: calc(100vh - 2rem);
}

.survey-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    background-color: transparent;
}

.survey-modal-background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 0;
}

.survey-modal-background.is-visible {
    opacity: 1;
}

.survey-modal form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    z-index: 2;
}

.survey-modal .modal-header,
.survey-modal .modal-footer {
    flex-shrink: 0;
    position: sticky;
    background-color: #ffffff;
    z-index: 2;
}

.survey-modal .modal-header {
    top: 0;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.05);
}

.survey-modal .modal-body {
    flex: 1 1 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.survey-modal .survey-modal-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem 1.75rem;
    scrollbar-gutter: stable both-edges;
}

#userSurveyModal .survey-modal-scroll {
    padding-bottom: 2rem;
}

.survey-modal .modal-footer {
    bottom: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -0.25rem 0.5rem rgba(0, 0, 0, 0.05);
}

.survey-modal.has-background {
    color: #2e1c46;
    text-shadow: none;
}

.survey-modal.has-background .modal-header,
.survey-modal.has-background .modal-footer {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(58, 33, 99, 0.12);
    box-shadow: 0 0.75rem 2rem rgba(35, 24, 66, 0.15);
}

.survey-modal.has-background .modal-header {
    border-bottom: 1px solid rgba(58, 33, 99, 0.12);
}

.survey-modal.has-background .modal-footer {
    border-top: 1px solid rgba(58, 33, 99, 0.12);
}

.survey-modal.has-background .modal-title,
.survey-modal.has-background label,
.survey-modal.has-background .form-label,
.survey-modal.has-background .form-text,
.survey-modal.has-background .small,
.survey-modal.has-background .text-muted,
.survey-modal.has-background .form-check-label,
.survey-modal.has-background .survey-modal-scroll {
    color: rgba(46, 28, 70, 0.95) !important;
}

.survey-modal.has-background .survey-modal-scroll {
    text-shadow: none;
}

.survey-modal.has-background .btn-close {
    filter: none;
    opacity: 0.6;
}

.survey-modal.has-background .card,
.survey-modal.has-background .card-body {
    background-color: #ffffff;
    border: 1px solid rgba(58, 33, 99, 0.12);
    box-shadow: 0 1rem 2rem rgba(35, 24, 66, 0.12);
    color: #2e1c46;
    backdrop-filter: none;
}

.survey-modal.has-background .card .text-muted,
.survey-modal.has-background .card .small {
    color: rgba(46, 28, 70, 0.7) !important;
}

.survey-modal.has-background .badge {
    color: #3c2670 !important;
    text-shadow: none;
    border: 1px solid rgba(58, 33, 99, 0.2);
    box-shadow: none;
}

.survey-modal.has-background .form-control,
.survey-modal.has-background .form-select,
.survey-modal.has-background .input-group-text {
    background-color: #ffffff;
    background-image: none;
    color: #2e1c46;
    border: 1px solid rgba(58, 33, 99, 0.2);
    box-shadow: none;
}

.survey-modal.has-background .form-control:focus,
.survey-modal.has-background .form-select:focus {
    border-color: rgba(120, 94, 184, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(120, 94, 184, 0.2);
}

.survey-modal.has-background .form-control::placeholder,
.survey-modal.has-background .form-select,
.survey-modal.has-background .form-text {
    color: rgba(46, 28, 70, 0.5) !important;
}

.survey-modal.has-background .form-check-input {
    background-color: #ffffff;
    background-image: none;
    border-color: rgba(120, 94, 184, 0.45);
    box-shadow: none;
}

.survey-modal.has-background .form-check-input:checked {
    background-color: rgba(120, 94, 184, 0.15);
    border-color: rgba(120, 94, 184, 0.75);
}

.survey-modal.has-background .form-check-label {
    color: rgba(46, 28, 70, 0.92);
}

.survey-modal.has-background .alert {
    background-color: #ffffff;
    background-image: none;
    border-color: rgba(120, 94, 184, 0.2);
    color: #2e1c46;
    backdrop-filter: none;
}

.survey-modal.has-background .btn-outline-secondary {
    color: #3c2670;
    border-color: rgba(120, 94, 184, 0.45);
    background-color: rgba(120, 94, 184, 0.08);
}

.survey-modal.has-background .btn-outline-secondary:hover,
.survey-modal.has-background .btn-outline-secondary:focus {
    background-color: rgba(120, 94, 184, 0.18);
    border-color: rgba(120, 94, 184, 0.6);
    color: #2e1c46;
}

.survey-modal.has-background .progress {
    background-color: #ffffff;
    backdrop-filter: none;
}

.survey-modal.has-background .progress-bar {
    box-shadow: none;
}

.survey-background-preview {
    border: 1px dashed rgba(13, 110, 253, 0.35);
    border-radius: 0.75rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.75);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.survey-background-preview.has-image {
    border-style: solid;
    border-color: rgba(13, 110, 253, 0.45);
    box-shadow: 0 0.75rem 1.5rem rgba(13, 110, 253, 0.15);
}

.survey-background-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.survey-background-empty {
    text-align: center;
    padding: 1rem;
}

@supports (height: 100dvh) {
    #surveyEditorModal .modal-dialog,
    #userSurveyModal .modal-dialog {
        height: calc(100dvh - 2rem);
    }

    .survey-modal {
        max-height: calc(100dvh - 2rem);
    }
}

body.survey-editor-open #surveyEditorModal {
    z-index: 1100;
}

body.survey-editor-open .modal-backdrop {
    z-index: 1095;
}

@media (max-width: 576px) {
    #surveyEditorModal .modal-dialog,
    #userSurveyModal .modal-dialog {
        margin: 0;
        width: 100%;
        max-width: none;
        height: 100%;
    }

    .survey-modal {
        height: 100%;
        max-height: none;
        border-radius: 0;
    }

    .survey-modal .survey-modal-scroll {
        padding: 1rem 1rem 2.5rem;
    }
}

.presence-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: gray;
    display: inline-block;
}

.presence-dot.online {
    background-color: green;
}

#lavaCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

@media (max-width: 992px) {
    body::before {
        opacity: 0.7;
    }

    #lavaCanvas {
        filter: saturate(0.9);
    }
}

/* Page reader styles */
body.reader-open {
    overflow: hidden;
}

.reader-overlay {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.92);
    z-index: 1080;
    color: #f8f9fa;
    backdrop-filter: blur(4px);
}

body.reader-open .modal-backdrop {
    z-index: 1100;
}

body.reader-open .modal {
    z-index: 1105;
}

.reader-overlay.active {
    display: flex;
}

.reader-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(18, 18, 18, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.reader-topbar-left {
    flex: 1 1 240px;
    min-width: 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reader-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.2;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reader-page-info {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.reader-topbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.reader-body {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 2vh, 1.5rem);
}

.reader-scroller {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: clamp(0.5rem, 1.5vh, 1.5rem);
    -webkit-overflow-scrolling: touch;
}

#flipbook {
    --page-aspect-ratio: 0.75;
    width: min(calc(100vw - 3rem), 960px);
    max-width: 100%;
    min-width: 0 !important;
    height: auto;
    max-height: calc(100vh - 6rem);
    aspect-ratio: var(--page-aspect-ratio);
    margin: 0 auto;
    position: relative;
    transform-origin: center center;
    transition: transform 0.2s ease;
}

.reader-page-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.25);
    box-shadow: 0 1.5rem 3rem rgba(15, 23, 42, 0.4);
    cursor: pointer;
    perspective: 1600px;
    perspective-origin: center;
}

.reader-page-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
    position: relative;
    z-index: 1;
    backface-visibility: hidden;
    transform-origin: center;
    will-change: transform, opacity;
}

.reader-page-wrapper--animating {
    cursor: progress;
}

.reader-page-clone {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    z-index: 2;
    backface-visibility: hidden;
    transform-origin: center;
    will-change: transform, opacity;
}

.reader-page-clone--flip-next {
    transform-origin: left center;
    animation: readerPageFlipOutNext 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.reader-page-clone--flip-prev {
    transform-origin: right center;
    animation: readerPageFlipOutPrev 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.reader-page-image--incoming-next {
    transform-origin: right center;
    animation: readerPageFlipInNext 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.reader-page-image--incoming-prev {
    transform-origin: left center;
    animation: readerPageFlipInPrev 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes readerPageFlipOutNext {
    0% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: rotateY(-95deg) scale(0.96);
        opacity: 0;
    }
}

@keyframes readerPageFlipOutPrev {
    0% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: rotateY(95deg) scale(0.96);
        opacity: 0;
    }
}

@keyframes readerPageFlipInNext {
    0% {
        transform: rotateY(85deg) scale(0.96);
        opacity: 0;
    }
    100% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
}

@keyframes readerPageFlipInPrev {
    0% {
        transform: rotateY(-85deg) scale(0.96);
        opacity: 0;
    }
    100% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reader-page-clone--flip-next,
    .reader-page-clone--flip-prev,
    .reader-page-image--incoming-next,
    .reader-page-image--incoming-prev {
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

.reader-scroller .stf__wrapper {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    margin: 0 auto;
}

.reader-scroller .stf__parent {
    width: 100% !important;
    height: 100% !important;
}

.reader-desktop-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.course-shelf-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-block: 0.5rem 1.5rem;
}

.course-shelf-row {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    padding: 1.5rem clamp(0.75rem, 3vw, 2rem);
    border-radius: 0.75rem;
    background-image: url('/static/wood.png');
    background-size: cover;
    background-repeat: repeat;
    box-shadow: 0 0.75rem 1.5rem rgba(75, 42, 13, 0.3);
    min-height: 220px;
}

.course-shelf-row::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -18px;
    height: 18px;
    border-radius: 0 0 0.75rem 0.75rem;
    background: linear-gradient(180deg, rgba(90, 52, 23, 0.9), rgba(50, 28, 12, 0.95));
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
    z-index: -1;
}

.course-book {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: min(140px, 32vw);
    padding: 0.5rem;
    border: none;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
    cursor: pointer;
    color: #2c2c2c;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-book:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.75);
    outline-offset: 2px;
}

.course-book:hover,
.course-book:focus-visible {
    transform: translateY(-6px);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.25);
}

.course-book-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 0.6rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.course-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 2.5rem;
    color: rgba(33, 37, 41, 0.6);
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.15), rgba(13, 202, 240, 0.1));
}

.course-book-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: center;
}

.course-book-meta {
    font-size: 0.75rem;
    color: rgba(33, 37, 41, 0.65);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.course-shelf-empty {
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.85);
    padding: 1.5rem;
    text-align: center;
    color: #5b4636;
    font-weight: 500;
    box-shadow: inset 0 0 0 1px rgba(91, 70, 54, 0.15);
}

.course-modal-cover {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1.25rem 2.5rem rgba(15, 23, 42, 0.35);
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.course-modal-cover-img {
    width: 100%;
    height: auto;
    display: block;
}

.course-modal-cover-placeholder {
    min-height: 280px;
    display: grid;
    place-items: center;
    font-size: 3rem;
    font-weight: 700;
    color: rgba(33, 37, 41, 0.5);
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.15), rgba(102, 16, 242, 0.12));
}

@media (max-width: 992px) {
    .navbar .container-fluid {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .navbar .container-fluid > .d-flex {
        width: 100%;
        justify-content: space-between;
    }

    .navbar .container-fluid > .d-flex:last-child {
        justify-content: flex-end;
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .reader-body {
        padding: 0.5rem;
    }

    .reader-scroller {
        padding: 0.25rem;
    }

    #flipbook {
        width: calc(100vw - 1.5rem);
        max-height: calc(100vh - 5rem);
    }

    .course-shelf-row {
        padding: 1rem;
        min-height: 180px;
    }

    .course-book {
        width: min(45vw, 160px);
    }

    .course-modal-cover-placeholder {
        min-height: 220px;
    }

    .stack-sm > * {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .stack-sm .btn {
        width: 100%;
    }

    #chatContainer {
        max-height: 60vh;
    }

    #chatBox {
        height: 50vh !important;
    }

    #chatEditor {
        height: 80px !important;
    }
}

@media (pointer: coarse) {
    .reader-desktop-control {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .reader-topbar {
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .reader-topbar-left {
        flex-basis: 100%;
    }

    .reader-topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .table-responsive {
        margin-top: 0.75rem;
    }

    #appointmentsList {
        margin-top: 0.75rem;
    }

    .course-book {
        width: min(60vw, 170px);
    }
}

@media (min-width: 768px) {
    .btn-auto-md {
        width: auto !important;
    }
}

.stf__parent {
    position: relative;
    display: block;
    box-sizing: border-box;
    transform: translateZ(0);
    -ms-touch-action: pan-y;
    touch-action: pan-y;
}

.sft__wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.stf__parent canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
}

.stf__block {
    position: absolute;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    perspective: 2000px;
}

.stf__item {
    position: absolute;
    transform-style: preserve-3d;
}

.stf__outerShadow,
.stf__innerShadow,
.stf__hardShadow,
.stf__hardInnerShadow {
    position: absolute;
    left: 0;
    top: 0;
    display: none !important;
    box-shadow: none !important;
    background: none !important;
}

#toastContainer {
    z-index: 1200;
    pointer-events: none;
}

#toastContainer .toast {
    pointer-events: auto;
}

.btn-loading-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.payment-portal {
    transition: opacity 0.2s ease-in-out;
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

.payment-portal.d-none {
    opacity: 0;
    pointer-events: none;
}

.payment-portal-markup {
    min-height: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 0.75rem;
    background-color: #ffffff;
    overflow-x: auto;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.payment-portal-markup > * {
    max-width: 100%;
}

.payment-portal-markup iframe[data-paypal-button-frame="true"] {
    display: block;
    border: 0;
    background-color: #ffffff;
    max-width: 100%;
    width: auto;
    margin: 0 auto;
}

.payment-portal-loader {
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-portal-loader .spinner-border {
    width: 1rem;
    height: 1rem;
}

.gear-spin {
    display: inline-block;
    animation: gear-rotate 1s linear infinite;
}

@keyframes gear-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.star-rating .star-button {
    color: var(--bs-secondary-color, #6c757d);
}

.star-rating .star-button .bi {
    font-size: 1.5rem;
    transition: color 0.2s ease-in-out;
}

.star-rating .star-button:hover .bi,
.star-rating .star-button:focus .bi {
    color: var(--bs-warning, #ffc107);
}

.avatar-placeholder {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-secondary-bg, #e9ecef);
    color: var(--bs-secondary-color, #495057);
    font-weight: 600;
}

.object-fit-cover {
    object-fit: cover;
}

.admin-page .navbar {
    margin-bottom: 0 !important;
}

.admin-container {
    width: 100%;
    max-width: min(100%, 1440px);
    margin: 0 auto;
    padding: clamp(1rem, 2.5vw, 3rem);
    padding-top: clamp(0.75rem, 2vw, 2.5rem);
}

.admin-shell {
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 3vw, 2.75rem);
}

.admin-hero {
    position: relative;
    border: none;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(140deg, rgba(79, 70, 229, 0.92) 0%, rgba(14, 165, 233, 0.9) 100%);
    box-shadow: 0 1.5rem 3rem rgba(15, 23, 42, 0.18);
    border-radius: 1.75rem;
}

.admin-hero::before,
.admin-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.admin-hero::before {
    background: radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.25), transparent 55%),
        radial-gradient(circle at 80% 0%, rgba(186, 230, 253, 0.28), transparent 60%),
        radial-gradient(circle at 65% 95%, rgba(244, 215, 255, 0.35), transparent 65%);
    opacity: 0.9;
}

.admin-hero::after {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.25), rgba(15, 23, 42, 0));
}

.admin-hero-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(1.25rem, 3vw, 2rem);
    padding: clamp(1.75rem, 4vw, 2.75rem) clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2.25rem);
}

@media (min-width: 992px) {
    .admin-hero-body {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.admin-hero-copy {
    max-width: 36rem;
}

.admin-hero-kicker {
    display: inline-block;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
}

.admin-heading {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.admin-subheading {
    font-size: clamp(1rem, 2.3vw, 1.15rem);
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
}

.admin-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.admin-hero-actions .btn {
    border-radius: 999px;
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    box-shadow: 0 1rem 2.25rem rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-hero-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 1.5rem 3rem rgba(15, 23, 42, 0.24);
}

.admin-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: clamp(0.75rem, 2vw, 1.5rem);
    padding: 0 clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 4vw, 2rem);
}

.admin-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: clamp(1rem, 2vw, 1.35rem);
    border-radius: 1.2rem;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(14px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.admin-stat-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    font-size: 1.5rem;
    color: #fff;
}

.gradient-indigo {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.gradient-sky {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
}

.gradient-emerald {
    background: linear-gradient(135deg, #34d399, #10b981);
}

.gradient-violet {
    background: linear-gradient(135deg, #c084fc, #a855f7);
}

.admin-stat-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-stat-label {
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.admin-stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: #fff;
}

.admin-toolbar {
    border: none;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(18px);
    border-radius: 1.25rem;
}

.admin-toolbar .card-body {
    padding: clamp(0.5rem, 1.2vw, 0.75rem);
}

.admin-tablist {
    display: flex;
    gap: 0.5rem;
    border: 0 !important;
    padding: 0;
    margin: 0;
    scrollbar-width: thin;
    scroll-snap-type: x mandatory;
}

.admin-tablist::-webkit-scrollbar {
    height: 4px;
}

.admin-tablist .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background-color: rgba(241, 245, 249, 0.8);
    color: #1e293b;
    font-weight: 600;
    padding: 0.55rem clamp(0.9rem, 3vw, 1.6rem);
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    scroll-snap-align: center;
}

.admin-tablist .nav-link i {
    font-size: 1.1rem;
}

.admin-tablist .nav-link:hover {
    background-color: rgba(203, 213, 225, 0.9);
    transform: translateY(-1px);
}

.admin-tablist .nav-link.active {
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0.85rem 1.75rem rgba(79, 70, 229, 0.28);
}

.admin-tablist .nav-link:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.35);
    outline-offset: 2px;
}

.admin-content {
    border: none;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(18px);
    border-radius: 1.5rem;
    overflow: visible;
    box-shadow: 0 1.25rem 2.75rem rgba(15, 23, 42, 0.12);
}

.admin-content .card-body {
    padding: 0;
}

.admin-tab-content {
    background: transparent;
}

.admin-tab-content > .tab-pane {
    padding: clamp(1.25rem, 2.5vw, 2.5rem) clamp(1rem, 2.5vw, 2.25rem) clamp(1.5rem, 3.5vw, 2.5rem);
}

.admin-tab-content .tab-pane:not(.show) {
    display: none !important;
}

.admin-tab-content .card {
    border: none;
    border-radius: 1.25rem;
    box-shadow: 0 1rem 2rem rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.admin-tab-content .card .card-body {
    padding: clamp(1rem, 2vw, 1.75rem);
}

.admin-tab-content .card .card-header,
.admin-tab-content .card .card-footer {
    padding: clamp(0.75rem, 1.6vw, 1.25rem) clamp(1rem, 2vw, 1.75rem);
}

.admin-pane-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1.25rem;
}

.admin-pane-header .btn {
    margin: 0;
}

#music .row.g-4,
#gallery .row.g-4,
#events .row.g-4 {
    --bs-gutter-x: 1.25rem;
    --bs-gutter-y: 1.25rem;
}

#events .vstack.gap-4 {
    gap: 1.5rem !important;
}

@media (max-width: 768px) {
    .admin-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .admin-tab-content > .tab-pane {
        padding: 1rem 0.85rem 1.5rem;
    }

    .admin-tab-content > #music,
    .admin-tab-content > #gallery,
    .admin-tab-content > #events {
        padding-top: 0.85rem;
    }

    .admin-tab-content .card {
        box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.1);
    }

    .admin-tab-content .card.h-100 {
        height: auto !important;
    }
}

@media (max-width: 576px) {
    .admin-container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-top: 0.75rem;
    }

    .admin-tablist .nav-link {
        padding: 0.45rem 0.85rem;
        font-size: 0.95rem;
    }

    .admin-tab-content .card .card-body {
        padding: 0.9rem;
    }
}

.gallery-empty-state {
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    border-radius: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
}
