/* Base Transitions */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
    background: radial-gradient(circle at 10% 20%, rgba(45, 118, 189, 0.18), rgba(12, 22, 38, 0.96) 65%);
    color: #cbd5e1;
    overflow-x: hidden;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(90deg, rgba(255,255,255,0.01) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255,255,255,0.01) 1px, transparent 1px),
        repeating-linear-gradient(45deg, rgba(32,146,247,0.07) 0, rgba(32,146,247,0.07) 2px, transparent 2px, transparent 12px);
    background-size: 24px 24px, 24px 24px, 120px 120px;
    opacity: 0.5;
    pointer-events: none;
}

#background-container {
    display: block !important;
    background: transparent;
}

/* Revised Noise Class */
.bg-noise { 
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E"); 
}

/* Glassmorphism */
.glass-nav { @apply backdrop-blur-md transition-all duration-300; background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(148, 163, 184, 0.2); box-shadow: 0 6px 30px rgba(0, 0, 0, 0.09); min-height: 5rem; }
.dark .glass-nav { background: rgba(15, 23, 42, 0.7); border: 1px solid rgba(255, 255, 255, 0.05); box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3); }

.glass-nav .nav-link {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.5rem 0.75rem;
}

.glass-nav .nav-link:hover {
    text-decoration: underline;
}

/* Ensure navbar buttons are taller and easier to tap */
.glass-nav button {
    min-height: 44px;
}

/* Mobile nav improvements */
@media (max-width: 1023px) {
    nav {
        top: 0.25rem; /* few pixels from top */
    }
    #public-app,
    #portal-app {
        padding-top: calc(0.25rem + 2.5rem); /* keep content visible under fixed nav */
    }
    #mobileMenu {
        top: 3.5rem;
        left: 0.5rem;
        right: 0.5rem;
        padding: 0.75rem;
        max-height: 70vh;
        overflow-y: auto;
    }
    #mobileMenu .nav-link {
        padding: 0.9rem 1rem;
        margin-bottom: 0.35rem;
        border-radius: 0.75rem;
        background: rgba(255, 255, 255, 0.9);
    }
    .dark #mobileMenu .nav-link {
        background: rgba(15, 23, 42, 0.85);
    }
    #global-search {
        display: none !important;
    }
}

.glass-panel { @apply backdrop-blur-xl transition-all duration-300; background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(226, 232, 240, 0.8); box-shadow: 0 8px 32px 0 rgba(30, 41, 59, 0.05); }
.dark .glass-panel { background: rgba(30, 41, 59, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3); }

.glass-panel.comms-panel {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(8, 145, 178, 0.12)), rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(14, 165, 233, 0.4);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.45);
    color: #e2e8f0;
    position: relative;
}
.glass-panel.comms-panel::after {
    content: '';
    position: absolute;
    inset: 1rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
    opacity: 0.6;
}
.glass-panel.comms-panel form > * {
    position: relative;
    z-index: 1;
}

.comms-panel .comms-action-row {
    justify-content: center;
}
.comms-panel .comms-action-row > button {
    flex: 1 1 38%;
    min-width: 120px;
    border-radius: 0.75rem;
}
.comms-panel .drop-zone {
    background: rgba(15, 23, 42, 0.25);
    border-color: rgba(59, 130, 246, 0.4);
    color: #e2e8f0;
}
.comms-panel .drop-zone label {
    color: #e2e8f0;
}

.glass-card { @apply backdrop-blur-md transition-all duration-300; background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(203, 213, 225, 0.5); }
.dark .glass-card { background: rgba(30, 41, 59, 0.4); border: 1px solid rgba(255, 255, 255, 0.05); }

.clip-slant { clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%); }

/* Drop-zone style for both posts and logs */
.drop-zone {
    border: 2px dashed rgba(148, 163, 184, 0.7);
    padding: 0.8rem;
    background: rgba(226, 232, 240, 0.4);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.drop-zone:hover {
    border-color: rgba(14, 165, 233, 0.8);
    background: rgba(219, 234, 254, 0.5);
}
.drop-zone input[type='file'] {
    display: none;
}

/* Wave Effect - Corners + Old-style wave shapes */
.wave-wrapper {
    position: absolute;
    width: 200%;
    height: 200%;
    overflow: hidden;
    line-height: 0;
    opacity: 0.45;
    z-index: -1;
    pointer-events: none;
}

.wave-wrapper.wave-tl { top: -85%; left: -85%; animation: wave-slide-tl 32s linear infinite; }
.wave-wrapper.wave-tr { top: -85%; right: -85%; animation: wave-slide-tr 30s linear infinite; }
.wave-wrapper.wave-bl { bottom: -85%; left: -85%; animation: wave-slide-bl 28s linear infinite; }
.wave-wrapper.wave-br { bottom: -85%; right: -85%; animation: wave-slide-br 26s linear infinite; }

.wave-svg {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 320px;
    animation: wave-scroll 20s linear infinite;
}

.wave-path {
    transform-origin: center;
    opacity: 0.87;
    filter: blur(0.3px);
    animation: wave-bounce 4s ease-in-out infinite alternate;
}

.wave-path:nth-child(1) { animation-duration: 5.4s; }
.wave-path:nth-child(2) { animation-duration: 4.6s; }
.wave-path:nth-child(3) { animation-duration: 4.0s; }

.wave-path:nth-child(1) { 
    fill: rgba(56, 150, 242, 0.14);
}

.wave-path:nth-child(2) { 
    fill: rgba(56, 165, 229, 0.12);
}

.wave-path:nth-child(3) { 
    fill: rgba(30, 144, 255, 0.11);
}

.dark .wave-path:nth-child(1) { fill: rgba(30, 130, 245, 0.16); }
.dark .wave-path:nth-child(2) { fill: rgba(30, 108, 185, 0.14); }
.dark .wave-path:nth-child(3) { fill: rgba(26, 105, 210, 0.16); }

@keyframes wave-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-33.3333%); }
}

@keyframes wave-bounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes wave-slide-tl {
    0% { transform: translate(0, 0) scale(1.2) rotate(-7deg); }
    100% { transform: translate(70%, 70%) scale(1) rotate(0deg); }
}

@keyframes wave-slide-tr {
    0% { transform: translate(0, 0) scale(1.2) rotate(7deg); }
    100% { transform: translate(-70%, 70%) scale(1) rotate(0deg); }
}

@keyframes wave-slide-bl {
    0% { transform: translate(0, 0) scale(1.2) rotate(-10deg); }
    100% { transform: translate(70%, -70%) scale(1) rotate(0deg); }
}

#background-container {
    display: none;
}

@keyframes wave-slide-br {
    0% { transform: translate(0, 0) scale(1.2) rotate(10deg); }
    100% { transform: translate(-70%, -70%) scale(1) rotate(0deg); }
}

/* Sponsor Logo Background Adaptation */
.sponsor-logo-container {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.dark .sponsor-logo-container {
    background: rgba(15, 23, 42, 0.8);
}

.sponsor-logo-container:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.05);
}

.dark .sponsor-logo-container:hover {
    background: rgba(30, 41, 59, 0.95);
}

.sponsor-logo {
    width: 100%;
    max-width: 120px;
    height: 60px;
    object-fit: contain;
    border-radius: 0.4rem;
    filter: brightness(0.95);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.partner-sponsor-logo {
    object-fit: contain;
    max-width: 120px;
    max-height: 60px;
}

.admin-sponsor-logo {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 0.375rem;
}

.sponsor-logo-container {
    overflow: hidden;
}

.sponsor-logo:hover {
    transform: scale(1.05);
    filter: brightness(1);
}

.dark .sponsor-logo {
    filter: brightness(0.9) contrast(1.1);
}

/* Hide scrollbar but keep functionality */
.no-scrollbar, #upcomingEvents, #dashboardResources, #taskList, .custom-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar, #upcomingEvents::-webkit-scrollbar, #dashboardResources::-webkit-scrollbar, #taskList::-webkit-scrollbar, .custom-scrollbar::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
}

/* Calendar embed sizing in main area */
#googleCalendarEmbed {
    width: 100%;
    min-height: 520px;
    max-height: 760px;
    border: 2px dashed rgba(34, 211, 238, 0.85);
    border-radius: 1rem;
    box-shadow: 0 10px 22px rgba(14, 165, 233, 0.15);
}

@media (min-width: 1024px) {
    #googleCalendarEmbed {
        min-height: 760px;
        max-height: 920px;
    }
}

/* Profile dropdown + nav auth controls */
#authArea .glass-panel {
    min-width: 170px;
    max-width: 260px;
    width: min(260px, 100vw - 32px);
}

#authArea .glass-panel button {
    font-size: 0.70rem;
}

.nav-profile-avatar {
    width: 2.5rem;
    height: 2.5rem;
}

@media (min-width: 640px) {
    .nav-profile-avatar {
        width: 2.8rem;
        height: 2.8rem;
    }
}

.btn-nav-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.8);
    color: #0f172a;
    margin-left: 0.35rem;
    gap: 0.35rem;
}

#authArea .btn-nav-action:first-child {
    margin-left: 0;
}

.dark .btn-nav-action {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
}

.btn-nav-action:hover {
    transform: translateY(-1px);
}

/* Banner Container - Fixed above header */
.banner-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.maintenance-banner {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    text-align: center;
    padding: 0.75rem;
    font-weight: bold;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.5s ease-out;
    width: 100%;
    font-size: clamp(0.8rem, 2vw, 1rem);
}

.dark .maintenance-banner {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}


.maintenance-banner .fa-tools {
    animation: none;
}

.announcement-banner {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    text-align: center;
    padding: 0.75rem;
    font-weight: bold;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.5s ease-out;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-size: clamp(0.8rem, 2vw, 1rem);
}

.announcement-banner:hover {
    transform: translateY(2px);
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.15);
}

.dark .announcement-banner {
    background: linear-gradient(135deg, #0369a1, #075985);
}

.announcement-banner.temp {
    background: linear-gradient(135deg, #10b981, #059669);
}

.dark .announcement-banner.temp {
    background: linear-gradient(135deg, #047857, #065f46);
}

.announcement-banner.recurring {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.dark .announcement-banner.recurring {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
}

/* Improved sizing for all elements */
:root {
    --text-xs: clamp(0.7rem, 1.5vw, 0.8rem);
    --text-sm: clamp(0.8rem, 2vw, 0.9rem);
    --text-base: clamp(0.9rem, 2.5vw, 1rem);
    --text-lg: clamp(1rem, 3vw, 1.2rem);
    --text-xl: clamp(1.2rem, 4vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 5vw, 1.8rem);
    --text-3xl: clamp(1.8rem, 6vw, 2.2rem);
    --text-4xl: clamp(2rem, 7vw, 2.5rem);
    --text-5xl: clamp(2.5rem, 8vw, 3rem);
    --text-6xl: clamp(3rem, 10vw, 4rem);
    --text-7xl: clamp(3.5rem, 12vw, 5rem);
    --text-8xl: clamp(4rem, 14vw, 6rem);
    --text-9xl: clamp(5rem, 16vw, 7rem);
}

/* Responsive text classes */
.text-responsive-xs { font-size: var(--text-xs); }
.text-responsive-sm { font-size: var(--text-sm); }
.text-responsive-base { font-size: var(--text-base); }
.text-responsive-lg { font-size: var(--text-lg); }
.text-responsive-xl { font-size: var(--text-xl); }
.text-responsive-2xl { font-size: var(--text-2xl); }
.text-responsive-3xl { font-size: var(--text-3xl); }
.text-responsive-4xl { font-size: var(--text-4xl); }
.text-responsive-5xl { font-size: var(--text-5xl); }
.text-responsive-6xl { font-size: var(--text-6xl); }
.text-responsive-7xl { font-size: var(--text-7xl); }
.text-responsive-8xl { font-size: var(--text-8xl); }
.text-responsive-9xl { font-size: var(--text-9xl); }

/* Improved button sizing */
.btn-responsive {
    padding: clamp(0.4rem, 1.5vw, 0.6rem) clamp(0.8rem, 2vw, 1.2rem);
    font-size: clamp(0.7rem, 1.8vw, 0.9rem);
}

/* Preview Modal */
#previewModal {
    display: none;
}
#previewModal.show {
    display: flex;
}
#previewModalContent p, #previewModalContent ul, #previewModalContent ol {
    margin: 0.4rem 0;
}
#previewModalContent a {
    color: #0ea5e9;
    text-decoration: underline;
}

/* Log image label dotted style */
.log-image-label {
    border: 1px dashed rgba(59, 130, 246, 0.85);
    background: rgba(14, 165, 233, 0.08);
    padding: 0.5rem 0.75rem;
    border-radius: 0.7rem;
    width: 100%;
    justify-content: center;
    transition: all 0.2s ease;
}
.log-image-label:hover {
    border-color: rgba(14, 165, 233, 1);
    background: rgba(14, 165, 233, 0.12);
}

/* Google Calendar embed style (centralized) */
#googleCalendarEmbed {
    width: 100%;
    min-height: 520px;
    border: 2px dashed rgba(34, 211, 238, 0.85);
    border-radius: 1rem;
    box-shadow: 0 10px 22px rgba(14, 165, 233, 0.15);
    overflow: hidden;
}

/* Increase calendar height on desktop by ~50px */
@media (min-width: 1024px) {
    #googleCalendarEmbed {
        /* previous desktop min-height was 760px; add ~50px as requested */
        min-height: 810px;
        max-height: 970px;
    }
}

/* Hide all scrollbars globally but keep scrolling functionality */
html, body, * {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}
html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar {
    display: none !important; /* Chrome, Safari, Opera */
    width: 0 !important;
    height: 0 !important;
}

/* Connect section unique style */
#connect {
    background: linear-gradient(135deg, rgba(224, 242, 255, 0.7), rgba(235, 241, 255, 0.5));
}
.dark #connect {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.75), rgba(30, 41, 59, 0.8));
}

#publicSocialGrid {
    gap: 0.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    align-items: center;
}

#publicSocialGrid a, #publicSocialGrid button {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    padding: 0.5rem;
    min-height: 50px;
    min-width: 50px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.25);
    transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.dark #publicSocialGrid a, .dark #publicSocialGrid button {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 10px 20px rgba(2, 29, 46, 0.35);
}

#publicSocialGrid a:hover, #publicSocialGrid button:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 16px 24px rgba(14, 165, 233, 0.2);
}

#publicSocialGrid i, #publicSocialGrid .fa {
    transition: transform 0.2s ease, color 0.2s ease;
    color: #0ea5e9;
}

#publicSocialGrid a:hover i, #publicSocialGrid button:hover i {
    transform: scale(1.15);
    color: #0284c7;
}

/* Mobile: compact icons */
@media (max-width: 640px) {
    #publicSocialGrid i, #publicSocialGrid .fa { font-size: 1rem; }
    #publicSocialGrid a, #publicSocialGrid button { 
        padding: 0.5rem; 
        min-width: 40px; 
        min-height: 40px; 
        border-radius: 0.5rem;
    }
}
/* Tablet: moderate size */
@media (min-width: 641px) and (max-width: 1023px) {
    #publicSocialGrid i, #publicSocialGrid .fa { font-size: 1.25rem; }
    #publicSocialGrid a, #publicSocialGrid button { 
        padding: 0.6rem; 
        min-width: 48px; 
        min-height: 48px; 
        border-radius: 0.6rem;
    }
}
/* Desktop: slightly larger but not overwhelming */
@media (min-width: 1024px) {
    #publicSocialGrid i, #publicSocialGrid .fa { font-size: 1.5rem; }
    #publicSocialGrid a, #publicSocialGrid button { 
        padding: 0.75rem; 
        min-width: 56px; 
        min-height: 56px; 
        border-radius: 0.75rem;
    }
}

/* Auth dropdown larger and nicer visuals */
.auth-dropdown { min-width: 320px; max-width: 480px; font-size: 1rem; }
.glass-panel.auth-dropdown { padding: 0.75rem; }
.auth-dropdown button { display:block; width:100%; text-align:left; padding:0.6rem 0.8rem; border-radius:0.6rem; font-weight:700; }
.auth-dropdown button i { margin-right:0.6rem; }
.auth-dropdown button#switchViewBtn { background: transparent; color: #0f172a; }
.auth-dropdown button#switchViewBtn .fa-eye { font-size: 1.15rem; }
.auth-dropdown button#logoutBtn { color: #b91c1c; background: transparent; }

/* Utility: visually hidden but accessible */
.sr-only { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; border: 0; padding: 0; margin: -1px; }

/* Button presets */
.btn-md {
    padding: 0.5rem 0.9rem;
    border-radius: 0.75rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-md:hover {
    transform: translateY(-1px) scale(1.02);
}
.btn-primary {
    background: #0ea5e9;
    color: white;
    border: 1px solid #0ea5e9;
}
.btn-secondary {
    background: #1e293b;
    color: white;
    border: 1px solid #334155;
}
.btn-accent {
    background: #f97316;
    color: white;
    border: 1px solid #f97316;
}

/* Comms buttons responsiveness + fit */
.comms-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.comms-action-row > button {
    flex: 1 1 44%;
    min-width: 130px;
    max-width: 100%;
    padding: 0.65rem 0.9rem;
    border-radius: 0.65rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.comms-action-row > button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.22);
}

.comms-action-row > button:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.btn-md.btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    border: 1px solid #0ea5e9;
}

.btn-md.btn-secondary {
    background: linear-gradient(135deg, #64748b, #334155);
    color: white;
    border: 1px solid #475569;
}

.btn-md.btn-accent {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border: 1px solid #f97316;
}

/* Auth dropdown sizing */
.auth-dropdown {
    min-width: 220px;
    max-width: 320px;
}
.auth-dropdown button {
    width: 100%;
    text-align: left;
    padding-left: 0.8rem;
}

/* Task checkbox and item styles */
.custom-checkbox {
    appearance: none;
    border: 1px solid #94a3b8;
    background: #fff;
    border-radius: 0.35rem;
    transition: background 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}
.custom-checkbox:checked {
    border-color: #0ea5e9;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}
.custom-checkbox:checked::after {
    content: '\2713';
    display: block;
    color: #fff;
    font-size: 0.7rem;
    line-height: 1;
    text-align: center;
}

.task-item {
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(251, 255, 255, 0.6);
}
.btn-primary {
    background: #0ea5e9;
    color: white;
    border: 1px solid #0ea5e9;
}
.btn-secondary {
    background: #1e293b;
    color: white;
    border: 1px solid #334155;
}
.btn-accent {
    background: #f97316;
    color: white;
    border: 1px solid #f97316;
}

/* Improved card padding */
.card-responsive {
    padding: clamp(0.8rem, 2vw, 1.2rem);
}

/* MODAL FIXES */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 90%;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1000000;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s ease-out;
}

.dark .modal-content {
    background: #1e293b;
    color: white;
}

@media (min-width: 640px) {
    .modal-content {
        max-width: 500px;
    }
}

/* Gallery Modal - Fixed */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(10px);
    z-index: 9999999;
    display: none;
    justify-content: center;
    align-items: center;
}

.gallery-modal.active {
    display: flex;
}

.gallery-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(40px, 7vw, 60px);
    height: clamp(40px, 7vw, 60px);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    z-index: 10000001;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}
.dark .gallery-nav {
    background: rgba(255, 255, 255, 0.25);
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.5);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.gallery-nav:hover {
    background: rgba(15, 23, 42, 0.85);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.gallery-nav.next {
    right: clamp(8px, 2vw, 18px);
}

.gallery-nav.prev {
    left: clamp(8px, 2vw, 18px);
}

.gallery-nav i {
    font-size: clamp(0.8rem, 2vw, 1.2rem);
}

@media (max-width: 767px) {
    .gallery-nav {
        width: 44px;
        height: 44px;
        border: 1px solid rgba(255, 255, 255, 0.85);
        background: rgba(0, 0, 0, 0.65);
    }

    .gallery-nav:hover {
        background: rgba(0, 0, 0, 0.8);
    }
}


.gallery-nav.prev {
    left: clamp(5px, 2vw, 20px);
}

.gallery-nav.next {
    right: clamp(5px, 2vw, 20px);
}

.gallery-close {
    position: absolute;
    top: clamp(10px, 3vw, 20px);
    right: clamp(10px, 3vw, 20px);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: clamp(30px, 4vw, 40px);
    height: clamp(30px, 4vw, 40px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: clamp(14px, 2vw, 20px);
    backdrop-filter: blur(4px);
    z-index: 10000000;
}

.gallery-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: clamp(4px, 1vw, 8px) clamp(10px, 2vw, 20px);
    border-radius: 30px;
    font-size: clamp(12px, 2vw, 14px);
    z-index: 10000000;
}

/* Alert Modal */
.alert-modal .modal-content {
    max-width: 400px;
    text-align: center;
}

.alert-icon {
    width: clamp(50px, 8vw, 60px);
    height: clamp(50px, 8vw, 60px);
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(20px, 3vw, 24px);
    animation: pulse 2s infinite;
}

.alert-icon.warning { background: #f59e0b20; color: #f59e0b; border: 1px solid #f59e0b40; }
.alert-icon.error { background: #ef444420; color: #ef4444; border: 1px solid #ef444440; }
.alert-icon.success { background: #10b98120; color: #10b981; border: 1px solid #10b98140; }
.alert-icon.info { background: #0ea5e920; color: #0ea5e9; border: 1px solid #0ea5e940; }

/* Roster Modal */
.roster-modal .modal-content {
    width: min(100%, 760px);
    max-width: 760px;
    max-height: 90vh;
    overflow-y: auto;
    padding: clamp(1rem, 2vw, 1.5rem);
    display: grid;
    gap: clamp(0.75rem, 1.4vw, 1rem);
    background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(239,246,255,0.88));
    border-radius: 1.25rem;
    border: 1px solid rgba(14, 165, 233, 0.28);
}

.dark .roster-modal .modal-content {
    background: linear-gradient(145deg, rgba(15,23,42,0.95), rgba(15,23,42,0.82));
    border-color: rgba(56, 189, 248, 0.35);
}

.roster-modal .modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.roster-modal .modal-header h2 {
    margin: 0;
    font-size: clamp(1.1rem, 3vw, 1.45rem);
    font-weight: 900;
    color: #0f172a;
}

.dark .roster-modal .modal-header h2 {
    color: #e2e8f0;
}

.roster-detail-avatar {
    width: clamp(80px, 15vw, 110px);
    height: clamp(80px, 15vw, 110px);
    border-radius: 50%;
    margin: 0 auto 1rem;
    border: 3px solid #0ea5e9;
    object-fit: cover;
    box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.3);
}

.subteam-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #0ea5e910;
    color: #0ea5e9;
    border: 1px solid #0ea5e930;
    border-radius: 20px;
    font-size: clamp(0.6rem, 1.5vw, 0.7rem);
    margin: 0.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.subteam-tag:hover {
    background: #0ea5e920;
    transform: scale(1.05);
}

.subteam-tag.selected {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
}

/* Roster Grid - Improved with taller cards and responsive sizing */
.roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: clamp(0.5rem, 2vw, 1rem);
    padding: 0.5rem;
}

@media (min-width: 640px) {
    .roster-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: clamp(0.8rem, 2vw, 1.25rem);
    }
}

@media (min-width: 1024px) {
    .roster-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: clamp(1rem, 2vw, 1.5rem);
    }
}

.roster-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 1rem;
    padding: clamp(0.8rem, 2vw, 1.25rem) clamp(0.5rem, 1.5vw, 0.75rem);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 220px;
}

.dark .roster-card {
    background: linear-gradient(135deg, rgba(30,41,59,0.4) 0%, rgba(30,41,59,0.2) 100%);
    border-color: rgba(255,255,255,0.05);
}

.roster-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(14, 165, 233, 0.2), 0 10px 10px -5px rgba(14, 165, 233, 0.1);
    border-color: #0ea5e940;
}

.roster-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0ea5e9, #f59e0b);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.roster-card:hover::before {
    transform: scaleX(1);
}

.roster-card-avatar {
    width: clamp(60px, 12vw, 70px);
    height: clamp(60px, 12vw, 70px);
    border-radius: 50%;
    margin: 0 auto 0.75rem;
    border: 2px solid #0ea5e9;
    object-fit: cover;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .roster-card-avatar {
        width: clamp(70px, 12vw, 80px);
        height: clamp(70px, 12vw, 80px);
    }
}

.roster-card:hover .roster-card-avatar {
    transform: scale(1.1);
    border-color: #f59e0b;
}

.roster-card-name {
    font-weight: 700;
    text-align: center;
    color: #1e293b;
    word-break: break-word;
    max-width: 100%;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
    font-size: clamp(0.7rem, 2vw, 0.9rem);
}

.dark .roster-card-name {
    color: white;
}

.roster-card-rank {
    font-size: clamp(0.6rem, 1.5vw, 0.7rem);
    font-family: monospace;
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: rgba(14, 165, 233, 0.05);
    display: inline-block;
    max-width: 100%;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    flex-shrink: 0;
}

.roster-status-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: clamp(8px, 2vw, 12px);
    height: clamp(8px, 2vw, 12px);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dark .roster-status-dot {
    border-color: #1e293b;
}

/* Timeline Milestone Cards */
.timeline-item {
    position: relative;
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(148,163,184,0.25);
    border-radius: 0.75rem;
    padding: 1rem 1rem 1rem 3.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 0.75rem;
    width: 3px;
    height: calc(100% - 1.5rem);
    background: linear-gradient(to bottom, #0ea5e9, #f59e0b);
    border-radius: 999px;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 1.25rem;
    top: 0.75rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: #0ea5e9;
    border: 2px solid white;
    transition: transform 0.25s ease, background 0.25s ease;
}

.timeline-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 25px rgba(15, 23, 42, 0.15);
    background: rgba(255,255,255,1);
}

.timeline-item:hover::after {
    transform: scale(1.4);
    background: #f59e0b;
}

.dark .timeline-item {
    background: rgba(15,23,42,0.7);
    border: 1px solid rgba(148,163,184,0.4);
}

.dark .timeline-item::before {
    background: linear-gradient(to bottom, #38bdf8, #fbbf24);
}

.dark .timeline-item::after {
    border-color: #0f172a;
}

.timeline-delete-btn {
    opacity: 0;
    transition: all 0.2s ease;
}

.timeline-item:hover .timeline-delete-btn {
    opacity: 1;
}

/* Post/Log Enhancements */
.post-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 20px 35px rgba(15,23,42,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0ea5e9, #f59e0b);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.post-card:hover::before {
    transform: translateX(0);
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 30px 55px rgba(15,23,42,0.18);
}

.post-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.post-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.post-label {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.25em;
    font-size: 0.65rem;
    padding: 0.15rem 0.85rem;
    border-radius: 999px;
    background: rgba(14,165,233,0.12);
    color: #0ea5e9;
}

.post-card-footer {
    margin-top: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(148,163,184,0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.post-card-footer .post-meta {
    display: flex;
    gap: 0.9rem;
    font-size: 0.75rem;
    color: #475569;
}

.dark .post-card-footer .post-meta {
    color: #cbd5f5;
}

.post-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #0ea5e9;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.post-detail-link:hover {
    border-color: #0ea5e9;
}

.post-detail-link i {
    font-size: 0.7rem;
}

.post-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.post-image-grid img {
    width: 100%;
    height: clamp(80px, 20vw, 100px);
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.post-image-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
}

.log-entry {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.log-entry:hover {
    border-left-color: #0ea5e9;
    transform: translateX(5px);
}

.log-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: clamp(0.55rem, 1.1vw, 0.75rem);
    padding: 0.22rem 0.65rem;
    border-radius: 9999px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.log-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.25);
}

@media (min-width: 768px) {
    .log-tag {
        font-size: clamp(0.65rem, 0.95vw, 0.85rem);
        padding: 0.28rem 0.75rem;
    }
}

#bugModal .modal-content input,
#bugModal .modal-content select,
#bugModal .modal-content textarea {
    width: 100% !important;
    min-width: 0;
    display: block;
    box-sizing: border-box;
}

#bugModal .modal-content select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #f8fafc;
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.7);
}

#bugModal .modal-content input,
#bugModal .modal-content button,
#bugModal .modal-content select,
#bugModal .modal-content textarea {
    background: #f8fafc;
    color: #0f172a;
}

#bugModal .modal-content input:focus,
#bugModal .modal-content select:focus,
#bugModal .modal-content textarea:focus {
    background: #ffffff;
}

#loginEmail,
#regEmail,
#bugModal .modal-content input[type="email"] {
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    #loginEmail,
    #regEmail,
    #bugModal .modal-content input[type="email"] {
        width: 100%;
        min-width: 0;
    }
}

/* Markdown Content Styling */
.markdown-content h1 { font-size: var(--text-xl); font-weight: 700; margin: 1rem 0 0.5rem; }
.markdown-content h2 { font-size: var(--text-lg); font-weight: 600; margin: 0.75rem 0 0.5rem; }
.markdown-content h3 { font-size: var(--text-base); font-weight: 600; margin: 0.5rem 0; }
.markdown-content p { margin: 0.5rem 0; line-height: 1.5; font-size: var(--text-sm); }
.markdown-content code { background: rgba(0,0,0,0.05); padding: 0.2rem 0.4rem; border-radius: 0.25rem; font-family: monospace; font-size: var(--text-xs); }
.dark .markdown-content code { background: rgba(255,255,255,0.1); }
.markdown-content blockquote { border-left: 3px solid #0ea5e9; padding-left: 1rem; margin: 0.5rem 0; font-style: italic; font-size: var(--text-sm); }
.markdown-content ul { list-style-type: disc; padding-left: 1.5rem; margin: 0.5rem 0; }
.markdown-content li { margin: 0.25rem 0; font-size: var(--text-sm); }

/* Action Buttons - Improved hover effect */
.action-btn {
    min-width: clamp(32px, 6vw, 40px);
    min-height: clamp(32px, 6vw, 40px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(14, 165, 233, 0.2);
    position: relative;
    overflow: hidden;
    font-size: clamp(0.6rem, 1.5vw, 0.8rem);
}

.dark .action-btn {
    background: rgba(30, 41, 59, 0.9);
    color: #f1f5f9;
}

.action-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 0.45rem;
    font-size: 0.72rem;
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.action-btn:hover::before {
    width: 150%;
    height: 150%;
}

.action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 10px -2px rgba(14, 165, 233, 0.25);
}

.action-btn.delete:hover { background: #ef4444; color: white; border-color: #ef4444; }
.action-btn.edit:hover { background: #0ea5e9; color: white; border-color: #0ea5e9; }
.action-btn.approve:hover { background: #10b981; color: white; border-color: #10b981; }

/* Dashboard card tuning */
.dashboard-card {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(148,163,184,0.35);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    padding: 1rem;
    border-radius: 1rem;
    color: #0f172a;
}
.dark .dashboard-card {
    background: rgba(15,23,42,0.75);
    border: 1px solid rgba(148,163,184,0.25);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    color: #e2e8f0;
}

.glass-card,
.glass-panel {
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(148,163,184,0.25);
    color: #0f172a;
}
.dark .glass-card,
.dark .glass-panel {
    background: rgba(15,23,42,0.72);
    border: 1px solid rgba(148,163,184,0.16);
    color: #e2e8f0;
}

.post-card {
    background: linear-gradient(180deg, rgba(248,250,252,0.95), rgba(255,255,255,0.9));
    border: 1px solid rgba(148,163,184,0.35);
    box-shadow: 0 20px 40px rgba(15,23,42,0.12);
    color: #0f172a;
}
.dark .post-card {
    background: linear-gradient(180deg, rgba(15,23,42,0.88), rgba(15,23,42,0.75));
    border: 1px solid rgba(148,163,184,0.2);
    box-shadow: 0 20px 45px rgba(0,0,0,0.3);
    color: #e2e8f0;
}

.log-entry {
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(148,163,184,0.3);
}
.dark .log-entry {
    background: rgba(15,23,42,0.8);
    border: 1px solid rgba(148,163,184,0.18);
}

.log-tag {
    text-transform: uppercase;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    color: white;
}

.log-tag.bg-slate-500 { background: #64748b; }
.log-tag.bg-red-500 { background: #ef4444; }
.log-tag.bg-green-500 { background: #22c55e; }
.log-tag.bg-blue-500 { background: #3b82f6; }
.log-tag.bg-purple-500 { background: #8b5cf6; }
.log-tag.bg-amber-500 { background: #f59e0b; }

.dashboard-card h3,
.dashboard-card .text-xs { font-size: 0.78rem; }

.notification-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1.1rem;
    min-height: 1.1rem;
    padding: 0 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    background-color: #ef4444;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
}

#dashboardCombinedFeed {
    min-height: 320px;
    max-height: 520px;
    overflow-y: auto;
}

#public-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    min-height: 420px;
    max-height: none;
    overflow-y: visible;
    padding-bottom: 0.5rem;
}

/* Proposed no-scroll look: no modal and free height growth */
#public-feed-grid .post-card,
#public-feed-grid .log-entry {
    cursor: default;
}

.post-card {
    cursor: pointer;
}

.post-card .post-preview {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Detail Modal */
#detailModal,
#memberModal {
    backdrop-filter: blur(2px);
    transition: background 0.3s ease;
}

.post-main-image-wrapper {
    width: 100%;
    height: clamp(180px, 28vh, 280px);
    overflow: hidden;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
}

.post-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.post-main-image:hover {
    transform: scale(1.04);
}

#detailModal,
#memberModal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.55);
    padding: 1rem;
}

#detailModal.active,
#memberModal.active {
    display: flex;
}

.detail-modal-content,
.member-modal-content {
    width: min(100%, 840px);
    max-height: min(88vh, 780px);
    overflow-y: auto;
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-radius: 1.1rem;
    border: 1px solid rgba(148,163,184,0.35);
    box-shadow: 0 20px 45px rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
}

.detail-modal-content {
    padding: 1.25rem;
}

/* Unified modal close button styling: remove rotate hover, use subtle scale + bg */
.modal button.modal-close-btn,
.modal button:has(.fa-times),
.modal .modal-close {
    background: transparent;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    border-radius: 0.5rem;
    color: inherit;
    transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.modal button.modal-close-btn:hover,
.modal button:has(.fa-times):hover,
.modal .modal-close:hover {
    transform: scale(1.05) !important; /* override rotate utility */
    background: rgba(14,165,233,0.06);
    color: var(--brand-primary, #0ea5e9);
}

/* Ensure the tiny '×' or icon doesn't show as a white rectangle */
.modal button.modal-close-btn i,
.modal button:has(.fa-times) i,
.modal .modal-close i {
    pointer-events: none;
}

/* Detail modal layout improvements */
.detail-modal-inner {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.detail-modal-title {
    font-size: 1.25rem;
    margin: 0 0 0.25rem 0;
}

.detail-modal-meta {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.detail-modal .modal-body {
    flex: 1 1 60%;
}

.detail-modal-media {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-modal-media img {
    width: 100%;
    border-radius: 0.6rem;
    object-fit: cover;
    max-height: 220px;
}

@media (max-width: 820px) {
    .detail-modal-inner { flex-direction: column; }
    .detail-modal-media { flex: none; width: 100%; }
}

/* News/detail post layout tweaks inside modal */
.detail-modal-body img.post-image {
    width: 100%;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
}

.detail-modal-body p { line-height: 1.6; color: #0f172a; }

/* Make sure modals respect dark mode */
.dark .detail-modal-content,
.dark .member-modal-content { background: rgba(2,6,23,0.92); color: #e6eef8; border: 1px solid rgba(148,163,184,0.06); }


.member-modal-content {
    padding: 1rem;
}

.member-modal-title,
.detail-modal-title {
    font-size: 1.55rem;
    font-weight: 900;
    margin-bottom: 0.25rem;
    color: #0f172a;
}

.member-modal-meta,
.detail-modal-meta {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.member-details-top {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-top: 0.75rem;
    padding: 0.8rem;
    border-radius: 0.85rem;
    background: rgba(239,246,255,0.7);
    border: 1px solid rgba(207,242,255,0.8);
}

.dark .member-details-top {
    background: rgba(15,23,42,0.65);
    border-color: rgba(56,189,248,0.35);
}

.member-avatar-wrap {
    flex: 0 0 auto;
}

.member-avatar {
    width: 96px;
    height: 96px;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid #0ea5e9;
    box-shadow: 0 10px 24px rgba(14,165,233,0.25);
}

.member-info-wrap {
    flex: 1;
    font-size: 0.94rem;
    color: #1e293b;
}

.dark .member-info-wrap {
    color: #cbd5e1;
}

.member-info-wrap p {
    margin: 0.28rem 0;
}

.member-bio,
.member-bio-wide {
    background: #eff6ff;
    border: 1px solid #bae6fd;
    border-radius: 0.85rem;
    padding: 1rem;
    margin-top: 0.85rem;
    color: #334155;
}

.dark .member-bio,
.dark .member-bio-wide {
    background: #0f172a;
    border-color: #1d4ed8;
    color: #e2e8f0;
}

.member-bio-wide {
    width: 100%;
}

.member-info-wrap p {
    margin: 0.28rem 0;
}

@media (min-width: 768px) {
    .member-details-top {
        gap: 1.25rem;
    }
}

/* What You Missed modal tweaks */
#missedItemsModal .modal-content {
    max-width: 920px;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.98);
    border-radius: 1rem;
    border: 1px solid rgba(148,163,184,0.08);
}
.dark #missedItemsModal .modal-content {
    background: rgba(2,6,23,0.82);
}

#missedItemsModal .modal-content .space-y-4 { gap: 0.9rem; }
#missedItemsModal .modal-content .modal-actions button { min-width: 140px; }

.member-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-top: 0.75rem;
}

.member-details-grid p {
    margin: 0.2rem 0;
    line-height: 1.4;
}

.member-bio {
    background: #f8fafc;
    padding: 0.85rem;
    border-radius: 0.65rem;
    border: 1px solid #e2e8f0;
}

.dark .member-bio {
    background: #0f172a;
    border-color: #334155;
}

.member-modal-content .modal-actions button,
.detail-modal-content .modal-actions button {
    background: #0ea5e9;
    color: #fff;
    border-radius: 0.65rem;
    border: none;
    padding: 0.65rem 1.15rem;
    text-transform: uppercase;
    font-weight: 700;
    min-width: 85px;
}

.member-modal-content .modal-actions button:hover,
.detail-modal-content .modal-actions button:hover {
    background: #0284c7;
}

@media (min-width: 768px) {
    .member-details-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.dark .detail-modal-content,
.dark .member-modal-content {
    background: #0f172a;
    color: #f8fafc;
    border-color: rgba(100,116,139,0.4);
}

.dark .modal-close-btn {
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
}


.detail-modal-inner,
.member-modal-inner {
    padding: 1rem 1.25rem 1.25rem;
}

.modal-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 999px;
    background: rgba(15,23,42,0.85);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.modal-close-btn:hover {
    transform: scale(1.05);
    background: rgba(15,23,42,0.95);
}

.button-hidden-on-getToKnow,
button[onclick^="scrollGetToKnow"] {
    display: none !important;
}

.detail-modal-content {
    width: min(100%, 880px);
    border-radius: 1.25rem;
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(148,163,184,0.35);
    box-shadow: 0 26px 45px rgba(0,0,0,0.32);
}

.dark .detail-modal-content {
    background: rgba(15,23,42,0.92);
    border-color: rgba(148,163,184,0.20);
}

.detail-modal-inner {
    display: grid;
    gap: 1rem;
    padding: 1rem 1.25rem 1.25rem;
}

.detail-modal-title {
    font-size: clamp(1.25rem, 3vw, 1.9rem);
    letter-spacing: 0.01em;
    margin: 0;
}

.detail-modal-meta {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.modal-body {
    line-height: 1.6;
    color: #334155;
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
    padding: 0.8rem 0;
}

.dark .modal-body {
    color: #cbd5e1;
}

.detail-modal-media img,
.member-modal-media img {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid rgba(148,163,184,0.3);
}

@media (max-width: 768px) {
    .detail-modal-content,
    .member-modal-content {
        width: min(100%, 95vw);
        margin: 0 0.25rem;
    }
    .detail-modal-media,
    .member-modal-media {
        grid-template-columns: 1fr;
    }
}


.detail-modal-content,
.member-modal-content {
    margin-top: 0.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.detail-modal-media img,
.member-modal-media img {
    width: 100%;
    border-radius: 0.5rem;
    object-fit: cover;
}

.member-modal-media img {
    width: 120px;
    height: 120px;
    border-radius: 9999px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.detail-modal-title,
.member-modal-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.detail-modal-meta,
.member-modal-meta {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.modal-body {
    line-height: 1.5;
    font-size: 0.95rem;
}

.modal-actions {
    margin-top: 1rem;
    text-align: right;
}

.modal-actions button {
    border: 0;
    border-radius: 0.5rem;
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    background: #0ea5e9;
    color: #fff;
    cursor: pointer;
}

.modal-actions button:hover {
    background: #0284c7;
}

/* Bug Report Modal - clearer, brand-aligned UI */
#bugModal .modal-content {
    background: rgba(255,255,255,0.98);
    border-radius: 1rem;
    box-shadow: 0 18px 40px rgba(2,6,23,0.35);
    border: 1px solid rgba(148,163,184,0.12);
    padding: clamp(1rem, 2vw, 1.25rem);
    max-width: 760px;
    color: var(--text-default, #0f172a);
}

#bugModal .modal-content form {
    display: grid;
    gap: 0.9rem;
}

#bugModal .modal-content input,
#bugModal .modal-content select,
#bugModal .modal-content textarea {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 0.75rem;
    background: #ffffff;
    color: #0f172a;
    padding: 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#bugModal .modal-content textarea {
    min-height: 160px;
    resize: vertical;
    line-height: 1.5;
}

#bugModal .modal-content input::placeholder,
#bugModal .modal-content textarea::placeholder,
#bugModal .modal-content select {
    color: #64748b;
}

/* Dark mode for bug modal */
.dark #bugModal .modal-content {
    background: rgba(2,6,23,0.82);
    color: #e6eef8;
    border: 1px solid rgba(14,165,233,0.12);
}
.dark #bugModal .modal-content input,
.dark #bugModal .modal-content textarea,
.dark #bugModal .modal-content select {
    background: rgba(255,255,255,0.03);
    color: #e6eef8;
    border: 1px solid rgba(148,163,184,0.08);
}

/* Submit button styling inside bug modal */
#bugModal .modal-content button[type="submit"] {
    background: var(--brand-primary, #0ea5e9);
    color: #fff;
    border-radius: 0.6rem;
    padding: 0.6rem 0.9rem;
    font-weight: 700;
}

#bugModal .modal-content .modal-heading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(30, 64, 175, 0.15);
}

#bugModal .modal-content .modal-heading i {
    font-size: 1rem;
    color: #f97316;
}

#bugModal .modal-content .bug-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

#bugModal .modal-content .bug-controls button {
    flex: 1 1 auto;
    min-width: 120px;
    border: 1px solid rgba(14, 165, 233, 0.5);
    border-radius: 0.65rem;
    padding: 0.65rem 0.85rem;
    font-weight: 700;
}

#bugModal .modal-content .bug-controls button[type="submit"] {
    background: #0ea5e9;
    color: #fff;
}

#bugModal .modal-content .bug-controls button[type="button"] {
    background: #ffffff;
    color: #0f172a;
}

#admin-bug-panel {
    display: grid;
    gap: 0.75rem;
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.75rem;
    border-radius: 0.85rem;
}

#admin-bug-panel .bug-item {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.75rem;
    padding: 0.65rem;
    display: grid;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #0f172a;
}

#admin-bug-panel .bug-item strong {
    color: #0ea5e9;
}

#admin-bug-panel .bug-item .bug-metadata {
    display: flex;
    justify-content: space-between;
    gap: 0.45rem;
    font-size: 0.72rem;
    color: #64748b;
}

#bugModal .modal-content input:focus,
#bugModal .modal-content select:focus,
#bugModal .modal-content textarea:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
    outline: none;
}

#bugModal .modal-content .bug-controls {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

#bugModal .modal-content .bug-controls button {
    flex: 1;
    border: 1px solid rgba(14, 165, 233, 0.5);
}

#bugModal .modal-content .bug-controls button[type="submit"] {
    background: #0ea5e9;
    color: white;
}

#bugModal .modal-content .bug-controls button[type="button"] {
    background: #fff;
    color: #0f172a;
}

#bugModal .modal-content .bug-controls button:hover {
    transform: translateY(-1px);
}

/* Get To Know carousel improvements */
#getToKnowUsList {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    max-width: min(96vw, 1100px);
    margin: 0 auto;
}

#getToKnowUsList .snap-center,
#getToKnowUsList > * {
    scroll-snap-align: center;
}

/* Marquee (infinite leftward smooth scroll) */
#getToKnowUsList.marquee {
    overflow: hidden; /* hide native scrollbar when using marquee */
    scroll-snap-type: none;
}

#getToKnowUsList.marquee .marquee-track {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    will-change: transform;
    animation: none;
}

#getToKnowUsList.marquee .marquee-track > * {
    flex: 0 0 auto; /* keep each card its natural width */
}

#getToKnowUsList .member-card {
    user-select: none;
    touch-action: manipulation;
    outline: none;
}

#getToKnowUsList .member-card:focus {
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.5);
}

@keyframes marquee-slide {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Mobile improvements for modal */
@media (max-width: 640px) {
    #detailModal,
    #memberModal {
        align-items: flex-start;
        padding-top: 1.2rem;
        padding-bottom: 1.2rem;
    }

    .detail-modal-content,
    .member-modal-content {
        width: min(100%, 95vw);
        max-height: 92vh;
        margin: 0 auto;
        border-radius: 0.85rem;
        box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    }

    .modal-close-btn {
        top: 0.5rem;
        right: 0.5rem;
        width: 1.9rem;
        height: 1.9rem;
        font-size: 1rem;
    }
}

/* Mobile Improvements */
@media (max-width: 640px) {
    #public-app,
    #portal-app {
        padding-top: 7.5rem !important;
    }

    .glass-nav {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .glass-nav .flex.items-center.gap-2.sm\:gap-4 {
        gap: 0.5rem;
    }

    .nav-link, button[onclick] {
        min-height: 44px;
        min-width: 44px;
    }

    .modal-content {
        padding: 1rem;
        max-height: 85vh;
    }

    .roster-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .roster-card {
        min-height: 180px;
        padding: 0.75rem 0.5rem;
    }

    .roster-card-avatar {
        width: 50px;
        height: 50px;
    }

    .post-image-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }

    .post-image-grid img {
        height: 60px;
    }

    .action-btn {
        min-width: 32px;
        min-height: 32px;
    }
    
    .text-responsive-9xl {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .roster-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .timeline-item {
        padding-left: 15px;
    }

    .log-entry {
        padding: 0.75rem;
    }
    
    .roster-card {
        min-height: 160px;
    }
    
    .roster-card-avatar {
        width: 45px;
        height: 45px;
    }
}

/* Login button improvements */
.login-btn {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    font-weight: 700;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.login-btn:hover::before {
    width: 300%;
    height: 300%;
}

.login-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.4);
}

.login-btn:active {
    transform: scale(0.95);
}

.dark .login-btn {
    background: linear-gradient(135deg, #0ea5e9, #0369a1);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Search bar improvements */
#global-search #searchInput {
    border-radius: 9999px;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid rgba(203, 213, 225, 0.75);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#global-search .fa-search {
    pointer-events: none;
}

#global-search #searchInput:focus {
    outline: none;
    background: #ffffff;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

.dark #global-search #searchInput {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(100, 116, 139, 0.7);
    color: #ffffff;
}

.dark #global-search #searchInput:focus {
    background: rgba(15, 23, 42, 0.95);
}

#global-search .search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.dark #global-search .search-results {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-result-item {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--text-xs);
}

.dark .search-result-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.search-result-item:hover {
    background: rgba(14, 165, 233, 0.1);
    padding-left: 1.5rem;
}

/* Sponsor image URL input */
.sponsor-url-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sponsor-url-toggle button {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: var(--text-xs);
    font-weight: 600;
    transition: all 0.2s ease;
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
    border: 1px solid #0ea5e930;
}

.sponsor-url-toggle button.active {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
}

/* Delete animation */
@keyframes deleteFadeOut {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
    100% { opacity: 0; transform: scale(0.9); }
}

.deleting {
    animation: deleteFadeOut 0.3s ease forwards;
    pointer-events: none;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}
.dark .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Drag and Drop Zone */
.drop-zone { transition: all 0.2s ease; border: 2px dashed rgba(148, 163, 184, 0.4); }
.drop-zone.drag-over { border-color: #0ea5e9; background-color: rgba(14, 165, 233, 0.1); transform: scale(1.01); }

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}
.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
}

/* Announcement admin section side by side */
.announcement-admin-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

@media (max-width: 1024px) {
    .announcement-admin-grid {
        grid-template-columns: 1fr;
    }
}

.maintenance-entry .state-pill {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.18);
    color: #92400e;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Maintenance Mode Control Panel */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: .25s;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .25s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

input:checked + .slider {
    background-color: #22c55e;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* .maintenance-panel outer styles removed – panel now uses glass-panel directly */

.maintenance-active {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: var(--text-xs);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.maintenance-inactive {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: var(--text-xs);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* maintenance-panel outer/inner overrides removed – form fields use standard input classes */

.maintenance-entry {
    background: #f1f5f9;
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 0.5rem;
    padding: 0.45rem 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.dark .maintenance-entry {
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(148,163,184,0.3);
}

.maintenance-entry .maintenance-action {
    color: #ef4444;
    transition: color 0.2s ease;
}

.maintenance-entry .maintenance-action:hover {
    color: #b91c1c;
}


/* maintenance-panel responsive overrides removed */

/* Full-page maintenance overlay */
.maintenance-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.maintenance-overlay.hidden { display: none; }
.maintenance-overlay-inner {
    max-width: 520px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.06);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    color: #fff;
}
.maintenance-overlay .overlay-icon { font-size: 28px; color: #f59e0b; margin-bottom: 8px; }
.maintenance-overlay .overlay-message { font-weight: 700; font-size: 16px; }
.maintenance-overlay .overlay-meta { opacity: 0.9; }

/* prevent body scroll when overlay is visible */
body.modal-open { overflow: hidden; }

/* Filter Input Styling */
.filter-input {
    transition: all 0.3s ease;
}

.filter-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.dark .filter-input {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(14, 165, 233, 0.5);
}

.filter-input::placeholder {
    color: #94a3b8;
    font-size: var(--text-xs);
}

.dark .filter-input::placeholder {
    color: #64748b;
}

/* Temp Admin Badge */
.temp-admin-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 4px;
}