/* ==========================================================================
   THEME VARIABLES
   ========================================================================== */
:root[data-theme="dark"] {
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --text-color: #f8fafc;
    --accent-color: #38bdf8;
    --nav-hover: #334155;
    --overlay-color: rgba(15, 23, 42, 0.85); 
    --card-bg: rgba(30, 41, 59, 0.5);        
    --glass-border: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   GLOBAL RESET & BODY
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    display: flex;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   DYNAMIC BACKGROUNDS (SHARED BASE)
   ========================================================================== */
.upcoming-bg-overlay, 
.courses-bg-overlay, 
.ratings-bg-overlay, 
.aces-bg-overlay, 
.about-bg-overlay {
    position: fixed;
    top: 0;
    left: 260px; /* Offset for 260px sidebar */
    width: calc(100% - 260px); 
    height: 100%;
    z-index: -1;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s;
}

/* --- Individual Page Fine-Tuning --- */

/* 1. About Us (1.jpg) */
.about-bg-overlay {
    background: linear-gradient(var(--overlay-color), var(--overlay-color)), url('../assets/1.jpg');
    background-size: 110% auto;
    background-position: 80% center;
}

/* 2. Current Events (2.jpg) */
.upcoming-bg-overlay {
    background: linear-gradient(var(--overlay-color), var(--overlay-color)), url('../assets/2.jpg');
    background-size: 110% auto;
    background-position: 20% center; 
}

/* 3. Local Courses (3.jpg) */
.courses-bg-overlay {
    background: linear-gradient(var(--overlay-color), var(--overlay-color)), url('../assets/3.jpg');
    background-size: 110% auto;    
    background-position: 80% center; 
}

/* 4. Club Ratings (4.jpg) */
.ratings-bg-overlay {
    background: linear-gradient(var(--overlay-color), var(--overlay-color)), url('../assets/4.jpg');
    background-size: 110% auto;
    background-position: 0% center; 
}

/* 5. Aces (5.jpg) */
.aces-bg-overlay {
    background: linear-gradient(var(--overlay-color), var(--overlay-color)), url('../assets/5.jpg');
    background-size: 130% auto;
    background-position: 0% center;
}

/* ==========================================================================
   MOBILE BACKGROUND FIXES
   ========================================================================== */
@media (max-width: 768px) {
    .upcoming-bg-overlay, 
    .courses-bg-overlay, 
    .ratings-bg-overlay, 
    .aces-bg-overlay, 
    .about-bg-overlay {
        left: 0;
        width: 100%;
        /* 'scroll' works better than 'fixed' on mobile to prevent tiling/zoom bugs */
        background-attachment: scroll; 
        /* 'cover' ensures the image fills the space without tiling */
        background-size: cover !important; 
        background-position: center center !important;
    }
}

/* ==========================================================================
   GLAZED CONTENT BOXES (Normalized Height & Width)
   ========================================================================== */
.content-section {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 3rem; 
    border-radius: 16px;
    margin-bottom: 2rem;
    
    /* Dimensions normalized for consistency */
    width: 90%;           
    max-width: 1100px;    
    min-width: 320px;
    min-height: 600px;    
    
    /* Display state managed by nav.js */
    display: none;        
    opacity: 0;           
    transition: opacity 0.4s ease;

    /* Vertical alignment of content */
    flex-direction: column;
    justify-content: flex-start; 
}

.content-section.active {
    display: flex; 
    opacity: 1;
}

/* Ensure internal containers fill the 1100px parent */
.about-container, 
.calendar-main-unit {
    width: 100%;          
    max-width: 100%;
}

/* Typography and Inner Spacing */
.about-content p {
    line-height: 1.6;
    margin-bottom: 1rem;
    max-width: 100%; 
}

.about-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.about-highlight {
    margin: 1.5rem 0;
    padding: 1rem 2rem;
    font-size: 1.25rem;
    border-left: 4px solid var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
}

.about-contact-grid {
    margin-top: auto; /* Pushes contact info to the bottom of the normalized box */
    padding-top: 2rem;
}

#ratings.content-section {
    min-height: auto; /* Glass will shrink to fit the text */
}