/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    /* Global Brand Colors */
    --bg-blue: #004e82;
    --accent-teal: #5dc0c6;
    --accent-cyan: #009add;
    --text-white: #ffffff;
    --text-blue-dark: #003355; 
    
    /* Fonts */
    --font-head: 'Oswald', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Calendar Specific Colors */
    --cal-bg-main: #234a75;
    --cal-bg-header: #1e3f63;
    --cal-bg-cell: #2a5380;
    --cal-teal: #43a6c6; 
}

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

body {
    background-color: var(--bg-blue);
    color: var(--text-white);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden; 
    position: relative;
    padding-bottom: 0; /* Default padding */
}

/* =========================================
   2. SIDEBAR NAVIGATION (Desktop Default)
   ========================================= */
.sidebar-nav {
    position: fixed; 
    top: 0; 
    left: 0;
    width: 80px; 
    height: 100vh;
    background: rgba(0, 0, 0, 0.2); /* Semi-transparent dark bg */
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255,255,255,0.1);
    display: flex; 
    flex-direction: column;
    justify-content: space-between; 
    align-items: center;
    padding: 40px 0;
    z-index: 9999;
}

.brand-vertical { 
    writing-mode: vertical-rl; 
    text-orientation: mixed; 
    transform: rotate(180deg);
    font-weight: 600; 
    font-size: 0.8rem; 
    letter-spacing: 2px; 
    color: var(--accent-teal);
}

.vertical-menu {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    display: flex; 
    gap: 30px;
}

.menu-link {
    text-decoration: none;
    color: rgba(255,255,255,0.6);
    font-weight: 600; 
    font-size: 1rem; 
    letter-spacing: 2px;
    padding: 10px 0;
    border-right: 3px solid transparent;
    transition: color 0.3s;
}

.menu-link:hover {
    color: #fff;
}

.active-link {
    color: var(--text-white);
    border-right: 3px solid var(--accent-teal);
}

/* =========================================
   3. LAYOUT CONTAINERS
   ========================================= */
/* Default Margins for Desktop (pushes content right of sidebar) */
#main-interface, 
.board-container, 
.calendar-container, 
.join-container {
    margin-left: 80px; 
    padding: 60px;
    min-height: 100vh;
}

/* Specific background for Calendar Page */
.calendar-page { background-color: var(--cal-bg-main); }

/* =========================================
   4. HOMEPAGE STYLES
   ========================================= */
.content-stage {
    display: flex; 
    flex-direction: column; 
    justify-content: center;
    min-height: 80vh; 
    position: relative;
}

.grid-header {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding-bottom: 40px;
}

.club-title {
    letter-spacing: 2px;
    font-size: 0.8rem;
    opacity: 0.7;
}

.flyer-font {
    font-family: var(--font-head); 
    font-size: 10rem;
    line-height: 0.9; 
    font-weight: 700;
}

.flyer-sub { 
    font-size: 1.5rem; 
    font-weight: 300; 
    margin-top: 10px; 
}

/* Become a Member Button */
a.join-btn {
    display: inline-block; 
    text-decoration: none;
    padding: 12px 30px; 
    background: white; 
    color: var(--bg-blue);
    font-weight: 700; 
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-body);
}

a.join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Info Highlight Box (Next Event) */
.info-highlight {
    display: flex; 
    gap: 20px; 
    align-items: center; 
    margin-top: 50px;
    text-decoration: none; 
    color: white;
    cursor: pointer;
}

.highlight-bar { width: 5px; height: 80px; background: var(--accent-teal); }
.highlight-title { font-family: var(--font-head); font-size: 3rem; line-height: 1; }
.highlight-label { color: var(--accent-teal); letter-spacing: 1px; font-weight: 600; font-size: 0.8rem; }
.highlight-desc { font-size: 0.9rem; opacity: 0.8; }

/* =========================================
   5. BOARD PAGE STYLES
   ========================================= */
.page-title { font-family: var(--font-head); font-size: 4rem; color: var(--accent-teal); letter-spacing: 2px; }
.header-line { width: 100px; height: 5px; background: var(--accent-cyan); margin-top: 10px; margin-bottom: 40px; }

.member-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
    gap: 40px;
}

.member-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.member-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-teal);
}

.card-image-placeholder {
    width: 100%; 
    height: 260px; 
    background: #002b4d;
    position: relative;
    /* Images are set inline in HTML via background-image */
}

.card-info { padding: 20px; }
.member-name { font-family: var(--font-head); font-size: 1.4rem; font-weight: 500; }
.member-role { color: var(--accent-teal); font-size: 0.9rem; text-transform: uppercase; font-weight: 600; margin-top: 5px; }

/* =========================================
   6. CALENDAR PAGE STYLES
   ========================================= */
.main-title { font-family: var(--font-head); font-size: 4rem; color: var(--cal-teal); line-height: 1; }
.title-underline { width: 150px; height: 8px; background: var(--cal-teal); margin-top: 10px; margin-bottom: 40px; }

.calendar-grid {
    display: grid; 
    grid-template-columns: repeat(7, 1fr);
    gap: 4px; 
    border: 4px solid var(--cal-bg-main);
    background-color: var(--cal-bg-main);
}

.grid-label {
    background: var(--cal-bg-header); 
    padding: 15px 5px;
    text-align: center; 
    font-family: var(--font-head);
    font-weight: 500;
}

.grid-cell {
    background: var(--cal-bg-cell); 
    min-height: 140px; 
    padding: 10px;
    position: relative;
}

.grid-cell:hover {
    background-color: rgba(255,255,255,0.1);
}

.date-num { font-family: var(--font-head); opacity: 0.7; }

/* Event Tile inside Calendar */
.event-tile {
    margin-top: 10px; 
    background: var(--cal-teal); 
    padding: 8px;
    border-radius: 4px; 
    font-size: 0.85rem; 
    cursor: pointer; 
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.event-title { font-family: var(--font-head); font-weight: 700; display: block; line-height: 1.2; }
.event-time { font-size: 0.75rem; display: block; margin-bottom: 2px; }
.event-loc { font-size: 0.75rem; border-top: 1px solid rgba(255,255,255,0.3); margin-top: 4px; padding-top: 4px; display: block; }

/* =========================================
   7. JOIN PAGE & FORMS
   ========================================= */
.form-wrapper {
    background: rgba(255,255,255,0.05); 
    border: 1px solid var(--accent-teal);
    padding: 10px; 
    display: flex; 
    justify-content: center;
    border-radius: 8px;
}

iframe { 
    width: 100%; 
    max-width: 100%; 
    border: none; 
}

/* =========================================
   8. MODALS (Popups)
   ========================================= */
.modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.85); 
    z-index: 10000;
    display: flex; 
    justify-content: center; 
    align-items: center;
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.3s;
    backdrop-filter: blur(5px);
}

.modal-active { opacity: 1; pointer-events: all; }

/* Bio Modal Content */
.bio-modal-content {
    background: var(--bg-blue); 
    width: 90%; 
    max-width: 600px; 
    padding: 40px;
    border: 1px solid var(--accent-teal); 
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-active .bio-modal-content { transform: translateY(0); }

.close-bio-modal {
    position: absolute; 
    top: 15px; 
    right: 20px;
    background: none; 
    border: none; 
    color: var(--accent-teal); 
    font-size: 2.5rem;
    cursor: pointer;
}

.bio-header { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }

.bio-photo-placeholder { 
    width: 80px; 
    height: 80px; 
    border-radius: 50%; 
    background: #000; 
    flex-shrink: 0;
    border: 2px solid var(--accent-teal);
}

#modal-name { font-family: var(--font-head); font-size: 2rem; line-height: 1; }
#modal-role { color: var(--accent-teal); text-transform: uppercase; font-size: 0.9rem; }
.bio-divider { height: 1px; background: rgba(255,255,255,0.2); margin-bottom: 20px; }
#modal-bio-text { line-height: 1.6; font-weight: 300; }

/* Calendar Event Modal (if present) */
.modal-content { /* Uses similar styles to bio modal */
    background: var(--bg-blue); width: 90%; max-width: 500px; padding: 40px;
    border: 1px solid var(--accent-teal); position: relative;
}

/* =========================================
   9. DECORATIVE & ANIMATIONS
   ========================================= */
.pattern-dots, .geo-cluster { pointer-events: none; }
.pattern-dots { position: absolute; width: 300px; height: 300px; background-image: radial-gradient(rgba(255,255,255,0.8) 2px, transparent 2px); background-size: 20px 20px; opacity: 0.6; }
.top-left { top: 0; left: 0; }
.bottom-right { bottom: 0; right: 0; }

.geo-cluster { position: absolute; z-index: 1; }
.top-right-cluster { top: 0; right: 0; }
.bottom-left-cluster { bottom: 0; left: 80px; }

.block { width: 50px; height: 50px; background: white; margin: 5px; opacity: 0.5; } /* Simplified for brevity */

/* Animations */
.card-visible { opacity: 1; transform: translateY(0); }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   10. MOBILE & TABLET OPTIMIZATION (MAX-WIDTH: 1024px)
   ========================================= */
@media (max-width: 1024px) {
    
    /* 1. SIDEBAR TRANSFORMS TO BOTTOM BAR */
    .sidebar-nav {
        top: auto; 
        bottom: 0; 
        left: 0;
        width: 100%; 
        height: 70px; /* Fixed bottom bar height */
        flex-direction: row; /* Horizontal layout */
        padding: 0;
        background: #002b4d; /* Solid color (opaque) */
        border-right: none;
        border-top: 2px solid var(--accent-teal);
        backdrop-filter: none;
    }

    .brand-vertical { display: none; } /* Hide 'EST 2026' */

    .vertical-menu {
        writing-mode: horizontal-tb;
        transform: none;
        flex-direction: row;
        width: 100%; 
        justify-content: space-around;
        height: 100%; 
        align-items: center;
        gap: 0;
    }

    .menu-link {
        font-size: 0.9rem;
        border-right: none;
        border-bottom: 4px solid transparent; /* Highlight moves to bottom */
        padding: 10px 5px;
        height: 100%;
        display: flex; 
        align-items: center;
        color: rgba(255,255,255,0.7);
    }

    .active-link {
        border-right: none;
        border-bottom: 4px solid var(--accent-teal);
        color: white;
    }

    /* 2. RESET CONTENT MARGINS (Content takes full width) */
    #main-interface, 
    .board-container, 
    .calendar-container, 
    .join-container {
        margin-left: 0;
        padding: 30px 20px 100px 20px; /* Extra bottom padding for the nav bar */
        width: 100%;
    }

    /* 3. TYPOGRAPHY SCALING */
    .flyer-font { font-size: 15vw; } 
    .page-title, .main-title { font-size: 3rem; }
    
    /* 4. HOMEPAGE ADJUSTMENTS */
    .grid-header { padding: 20px; position: relative; flex-direction: column; align-items: flex-start; gap: 20px; }
    .club-title { display: none; }
    a.join-btn { width: 100%; text-align: center; }
    .info-highlight { flex-direction: row; width: 100%; margin-top: 30px; }
    .highlight-title { font-size: 2rem; }
    
    /* Hide decorative blocks on mobile */
    .geo-cluster { display: none; }

    /* 5. CALENDAR ADJUSTMENTS */
    .grid-label { font-size: 0.7rem; padding: 10px 2px; }
    .grid-cell { min-height: 80px; padding: 2px; }
    
    /* Simplified Event Tile for Mobile */
    .event-tile { 
        padding: 4px; 
        display: flex; 
        justify-content: center; 
        align-items: center; 
        height: 100%; 
        margin-top: 0; 
    }
    .event-time, .event-loc { display: none; }
    .event-title { font-size: 0.6rem; text-align: center; line-height: 1; white-space: normal; }

    /* 6. MODAL & GRID FIXES */
    .member-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
    .card-image-placeholder { height: 200px; }
    
    .bio-modal-content { width: 95%; padding: 25px; margin-bottom: 80px; }
    .bio-header { flex-direction: column; align-items: flex-start; }
    
    /* 7. JOIN PAGE */
    .form-wrapper iframe { height: 1100px; }
}