/* Halloween theme.
   Opt-in per page: add the "theme-halloween" class to the page's root element.
   Must be linked AFTER the scoped style bundle so page-level card rules win the tie. */

.theme-halloween {
    --hw-orange: #d9762a;
    --hw-orange-soft: #e9a161;
    --hw-cream: #eddcbf;
    --hw-purple: #6b4a9e;
    --hw-ink: #16111f;
    --hw-ink-deep: #100c18;
    position: relative;
    padding: 1.5rem;
    color: var(--hw-cream);
    background:
        radial-gradient(120% 85% at 50% 118%, rgba(217, 118, 42, 0.12) 0%, rgba(217, 118, 42, 0) 60%),
        radial-gradient(90% 65% at 50% -10%, rgba(107, 74, 158, 0.2) 0%, rgba(107, 74, 158, 0) 72%),
        linear-gradient(180deg, var(--hw-ink) 0%, var(--hw-ink-deep) 55%, #0b0812 100%);
}

/* Let the theme background fill the layout's content padding instead of sitting inset. */
.p-4:has(> .theme-halloween) {
    padding: 0 !important;
}

.theme-halloween::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 14% 2%, rgba(233, 161, 97, 0.08), transparent 40%),
        radial-gradient(circle at 86% 6%, rgba(107, 74, 158, 0.12), transparent 44%);
    animation: hw-fog 14s ease-in-out infinite;
}

.theme-halloween > * {
    position: relative;
    z-index: 1;
}

@keyframes hw-fog {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Headings */
.theme-halloween .title-header-text {
    background: linear-gradient(180deg, #f7e7cd 0%, var(--hw-orange-soft) 50%, var(--hw-orange) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.theme-halloween .title-content-text {
    color: rgba(237, 220, 191, 0.7);
}

.theme-halloween .title::after {
    content: "";
    display: block;
    height: 1px;
    margin-top: 0.75rem;
    background: linear-gradient(90deg, transparent, rgba(217, 118, 42, 0.55), rgba(107, 74, 158, 0.55), transparent);
}

@media (prefers-reduced-motion: reduce) {
    .theme-halloween::before {
        animation: none;
    }
}

/* Nav cards */
.theme-halloween .welcome-card,
.theme-halloween .department-card {
    background: linear-gradient(160deg, rgba(107, 74, 158, 0.16) 0%, rgba(22, 17, 31, 0.9) 65%);
    border: 1px solid rgba(217, 118, 42, 0.28);
    box-shadow: 0 6px 18px -12px rgba(0, 0, 0, 0.9);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.theme-halloween .welcome-card:hover,
.theme-halloween .department-card:hover {
    transform: translateY(-3px);
    border-color: rgba(233, 161, 97, 0.55);
    box-shadow: 0 14px 28px -16px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(233, 161, 97, 0.12);
}

.theme-halloween .welcome-card-img,
.theme-halloween .department-card-img {
    filter: sepia(0.12) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
    transition: transform 0.2s ease;
}

.theme-halloween .welcome-card:hover .welcome-card-img,
.theme-halloween .department-card:hover .department-card-img {
    transform: scale(1.04);
}

.theme-halloween .welcome-card-text,
.theme-halloween .department-card-text {
    color: var(--hw-cream);
}

.theme-halloween .welcome-card-back,
.theme-halloween .department-card-back {
    background: var(--hw-purple);
    opacity: 0.1;
}

/* The layout's top bar (user chip, Log out, Impersonate) lives in MainLayout, outside the
   page body, so .theme-halloween never reaches it. Hook it with :has() - the same approach
   as the .p-4 padding reset above - and lay the theme purple across the whole bar. */
.drawer-content:has(.theme-halloween) .nav-buttons-container {
    background:
        linear-gradient(180deg, rgba(107, 74, 158, 0.35) 0%, rgba(107, 74, 158, 0.05) 100%),
        #16111f;
    border-bottom: 1px solid rgba(107, 74, 158, 0.35);
}
