/* ==========================================================================
   DESIGN SYSTEM - COMSTOCK PARK HIGH SCHOOL CLASS OF 2027
   ========================================================================== */

/* 1. Reset and Core Properties */
:root {
    /* Brand Colors */
    --color-green: #0C4A28;
    --color-green-light: #166A3D;
    --color-green-dark: #072F18;
    --color-green-glow: rgba(12, 74, 40, 0.15);

    --color-gold: #F2C10F;
    --color-gold-hover: #D4A30B;
    --color-gold-light: #FCE89B;
    --color-gold-glow: rgba(242, 193, 15, 0.25);

    --color-bg-dark: #0D110E;
    --color-bg-panel: #151B17;
    --color-bg-card: #1D2520;
    --color-border: #2D3A32;
    --color-border-gold: rgba(242, 193, 15, 0.18);

    --color-text-main: #EAEFEA;
    --color-text-muted: #9BB0A3;
    --color-text-inverse: #0D110E;

    /* Layout Variables */
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 10px 30px -10px rgba(242, 193, 15, 0.15);
}

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

body {
    background-color: var(--color-bg-dark);
    color: var(--color-text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main[role="main"] {
    flex: 1 0 auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #FFF;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

a {
    color: var(--color-gold);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-gold-light);
}

/* ==========================================================================
   2. REUSABLE COMPONENTS & UTILITIES
   ========================================================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Glassmorphic Panel Pattern */
.glass-panel {
    background: rgba(21, 27, 23, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.glass-panel-gold {
    background: rgba(29, 37, 32, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border-gold);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-gold);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 8px;
}

.btn-primary {
    background: var(--color-gold);
    color: var(--color-text-inverse);
    box-shadow: 0 4px 15px var(--color-gold-glow);
}

.btn-primary:hover {
    background: var(--color-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(242, 193, 15, 0.35);
    color: var(--color-text-inverse);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--color-text-muted);
}

.btn-danger {
    background: #DC3545;
    color: white;
}

.btn-danger:hover {
    background: #BD2130;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Badge tags */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--color-border);
    color: var(--color-text-muted);
}

.badge-green {
    background: rgba(12, 74, 40, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge-gold {
    background: rgba(242, 193, 15, 0.15);
    color: var(--color-gold);
    border: 1px solid rgba(242, 193, 15, 0.3);
}

/* ==========================================================================
   3. HEADER & SITE NAVIGATION
   ========================================================================== */

.site-header {
    background: rgba(13, 17, 14, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
    transition: var(--transition);
}

.site-footer {
    background: rgba(13, 17, 14, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--color-border);
    padding: 16px 0;
    transition: var(--transition);
    flex-shrink: 0;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
}

.brand-year {
    color: var(--color-gold);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}

.nav-link {
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 8px 0;
}

.nav-link:hover,
.nav-link.active {
    color: white;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-gold);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-admin-btn {
    border: 1px solid var(--color-gold-glow);
    padding: 6px 14px;
    border-radius: 6px;
    color: var(--color-gold);
}

.nav-admin-btn:hover {
    background: rgba(242, 193, 15, 0.08);
    border-color: var(--color-gold);
    color: white;
}

/* Hamburger mobile drawer */
.burger-menu {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ==========================================================================
   4. HERO SECTION & GRADUATION TIMER
   ========================================================================== */

.hero-section {
    position: relative;
    padding: 10px 0 10px 0;
    background: radial-gradient(circle at top, var(--color-green-glow), transparent 60%);
    border-bottom: 1px solid var(--color-border);
}

.hero-layout {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 5px;
}

/* Carousel Styles */
.hero-carousel-container {
    flex: 1;
    min-width: 0;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: rgba(0, 0, 0, 0.4);
    min-height: 250px;
}

.hero-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-indicators {
    position: absolute;
    bottom: 16px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 3;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.carousel-dot.active {
    background: var(--color-gold);
    border-color: white;
    transform: scale(1.2);
}

.hero-carousel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

/* THE COUNTDOWN CLOCK — compact, right-aligned */
.countdown-container {
    flex-shrink: 0;
    width: 320px;
    padding: 20px;
    text-align: center;
}

.countdown-heading {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #FFF5D1;
    margin-bottom: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* Gold countdown tiles */
.countdown-tile {
    position: relative;
    background: linear-gradient(135deg, #FFE896 0%, #D4A30B 100%);
    border: 2px solid #FFF5D1;
    border-radius: 8px;
    padding: 10px 6px;
    box-shadow: 0 8px 20px rgba(212, 163, 11, 0.2);
    transition: var(--transition);
}

.countdown-tile:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 28px rgba(212, 163, 11, 0.35);
}

/* Forest Green Numbers */
.countdown-number {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--color-green-dark);
    line-height: 1;
    margin-bottom: 3px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

.countdown-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-green);
    letter-spacing: 0.06em;
}

/* ==========================================================================
   5. PUBLIC EVENTS LAYOUT
   ========================================================================== */

.section-title {
    font-size: 2.2rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-desc {
    color: var(--color-text-muted);
    margin-bottom: 32px;
}

.filter-dropdown {
    padding: 6px 16px;
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.filter-dropdown:hover,
.filter-dropdown:focus {
    background: var(--color-green);
    color: white;
    border-color: var(--color-green-light);
}

.event-list-card {
    text-decoration: none;
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.event-list-card:hover {
    border-color: var(--color-gold);
    transform: translateX(4px);
    box-shadow: -4px 4px 12px rgba(242, 193, 15, 0.15);
    background: rgba(29, 37, 32, 0.85);
}

.event-list-title {
    color: white;
    transition: color 0.2s ease;
}

.event-list-card:hover .event-list-title {
    color: var(--color-gold);
}

/* Events grid list */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.event-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.event-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.event-date-badge {
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    min-width: 65px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.date-month {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-gold);
    display: block;
    line-height: 1;
}

.date-day {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    display: block;
    line-height: 1.1;
    margin-top: 2px;
}

.event-title {
    font-size: 1.35rem;
    margin-bottom: 12px;
}

.event-meta {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-item svg {
    color: var(--color-gold);
}

/* ==========================================================================
   6. ADMIN LAYOUTS & FORMS
   ========================================================================== */

.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 80px);
}

/* Sidebar navigation */
.admin-sidebar {
    background: var(--color-bg-panel);
    border-right: 1px solid var(--color-border);
    padding: 32px 16px;
}

.sidebar-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 16px;
    padding-left: 12px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-link.active {
    background: var(--color-green-glow);
    color: var(--color-gold);
    border: 1px solid var(--color-border);
}

.admin-content {
    padding: 40px;
}

/* Stats panel dashboard card grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    padding: 24px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-gold);
    margin-top: 8px;
}

/* Administration forms */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--color-text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--color-bg-dark);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 10px var(--color-gold-glow);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    accent-color: var(--color-gold);
}

.text-danger {
    color: #DC3545;
    font-size: 0.85rem;
    margin-top: 6px;
    display: block;
}

/* Table grid tables */
.table-wrapper {
    overflow-x: auto;
    margin-top: 24px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background: var(--color-bg-panel);
    padding: 16px;
    font-family: var(--font-heading);
    font-weight: 600;
    border-bottom: 2px solid var(--color-border);
}

.admin-table td {
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* ==========================================================================
   7. AUDIT LOGS DISPLAY SPECIFICS
   ========================================================================== */

.log-details-card {
    background: var(--color-bg-panel);
    border-left: 4px solid var(--color-gold);
    padding: 16px;
    margin-top: 12px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-details-btn {
    background: none;
    border: none;
    color: var(--color-gold);
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.log-details-btn:hover {
    color: white;
}

/* Filter search form for Audit Logs */
.audit-filter-panel {
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
}

.audit-filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

/* ==========================================================================
   8. PUBLIC DYNAMIC PAGES CMS CONTENT RENDERER
   ========================================================================== */

.cms-content {
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 48px;
    max-width: 900px;
    margin: 40px auto;
    box-shadow: var(--shadow);
}

.cms-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 24px;
    margin-bottom: 32px;
}

.cms-body {
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--color-text-main);
}

/* WYSIWYG element style overrides within CMS page renderer */
.cms-body p {
    margin-bottom: 24px;
}

.cms-body h2 {
    font-size: 1.8rem;
    margin: 40px 0 20px 0;
}

.cms-body h3 {
    font-size: 1.4rem;
    margin: 32px 0 16px 0;
}

.cms-body ul,
.cms-body ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.cms-body li {
    margin-bottom: 8px;
}

.cms-body a {
    color: var(--color-gold);
    text-decoration: underline;
}

.cms-body a:hover {
    color: var(--color-gold-light);
}

/* Quill editor custom styles for admin panel */
.quill-editor-wrapper {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.quill-editor-wrapper .ql-toolbar.ql-snow {
    background: var(--color-text-main);
    border: none;
    border-bottom: 1px solid var(--color-border);
}

.quill-editor-wrapper .ql-container.ql-snow {
    background: var(--color-bg-panel);
    border: none;
}

.quill-editor-wrapper .ql-editor {
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--color-text-main) !important;
    font-family: var(--font-body);
}

.quill-editor-wrapper .ql-editor h1,
.quill-editor-wrapper .ql-editor h2,
.quill-editor-wrapper .ql-editor h3,
.quill-editor-wrapper .ql-editor h4,
.quill-editor-wrapper .ql-editor h5,
.quill-editor-wrapper .ql-editor h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #FFF !important;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.quill-editor-wrapper .ql-editor a {
    color: var(--color-gold) !important;
    text-decoration: underline;
}

/* ==========================================================================
   9. RESPONSIVE BREAKPOINTS (Mobile Adjustments)
   ========================================================================== */

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

    .admin-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .audit-filter-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .brand-year {
        display: block;
        line-height: 1.1;
        margin-top: 2px;
    }

    .site-nav {
        display: none;
        /* In production, toggled to drawer via Hamburger JS */
    }

    .nav-links {
        display: none;
    }

    .burger-menu {
        display: block;
    }

    .hero-layout {
        flex-direction: column-reverse;
        align-items: center;
        gap: 24px;
        text-align: center;
    }

    .hero-carousel-container {
        width: 100%;
        min-height: 200px;
    }

    .hero-text {
        padding-top: 0;
    }

    .hero-desc {
        margin: 0 auto;
    }

    .countdown-container {
        width: 100%;
        max-width: 320px;
    }

    .countdown-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .countdown-tile {
        padding: 8px 4px;
    }

    .countdown-number {
        font-size: 1.4rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .cms-content {
        padding: 24px;
    }
}

/* ==========================================================================
   10. CONFIRMATION MODAL
   ========================================================================== */

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.confirm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 36px;
    max-width: 460px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(242, 193, 15, 0.06);
    transform: scale(0.92) translateY(12px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-overlay.active .confirm-dialog {
    transform: scale(1) translateY(0);
}

.confirm-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.confirm-icon.warning {
    background: rgba(242, 193, 15, 0.12);
    border: 1px solid rgba(242, 193, 15, 0.25);
}

.confirm-icon.danger {
    background: rgba(220, 53, 69, 0.12);
    border: 1px solid rgba(220, 53, 69, 0.25);
}

.confirm-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: white;
    margin-bottom: 10px;
}

.confirm-message {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.65;
    margin-bottom: 28px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-actions .btn {
    min-width: 100px;
    padding: 10px 22px;
    font-size: 0.9rem;
}