:root {
    /* Light Theme Variables */
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --bg-dropdown: #ffffff;
    --bg-dropdown-hover: #f3f4f6;
    
    --text-main: #111827;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    
    --border-color: #e5e7eb;
    --divider-color: #e5e7eb;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    --header-height: 70px;
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --bg-body: #111827;
    --bg-card: #1f2937;
    --bg-header: #1f2937;
    --bg-dropdown: #1f2937;
    --bg-dropdown-hover: #374151;
    
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-light: #6b7280;
    
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: #1e3a8a;
    
    --border-color: #374151;
    --divider-color: #374151;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

/* Reset & Base Styles */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: var(--primary-color); transition: color 0.2s; }
a:hover { color: var(--primary-hover); }
ul { list-style: none; padding: 0; margin: 0; }

/* Header & Nav */
.site-header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo:hover { text-decoration: none; color: var(--primary-color); }

.main-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.nav-link:hover { color: var(--primary-color); background-color: var(--primary-light); }
.nav-link.active { color: var(--primary-color); font-weight: 600; }

.nav-divider {
    width: 1px;
    height: 24px;
    background-color: var(--divider-color);
    margin: 0 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-1px); }

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}
.btn-outline:hover { border-color: var(--primary-color); color: var(--primary-color); }

.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.875rem; }

/* Settings Dropdown */
.settings-dropdown-container {
    position: relative;
}

.nav-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.nav-icon-btn:hover {
    background-color: var(--bg-body);
    color: var(--text-main);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--bg-dropdown);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 0.5rem;
    z-index: 1000;
    animation: slideDown 0.2s ease-out;
}

.dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.95rem;
    gap: 0.75rem;
}

.dropdown-item:hover {
    background-color: var(--bg-dropdown-hover);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}
.mobile-menu-toggle .bar {
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    transition: 0.3s;
}

/* Main Layout */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-height: calc(100vh - var(--header-height) - 100px);
    min-height: calc(100dvh - var(--header-height) - 100px); /* Modern mobile viewport support */
}

.hidden { display: none !important; }

/* Cards */
.card, .hero-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    margin-bottom: 2rem;
}

.card-header { margin-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
.card-header h1 { margin: 0; font-size: 1.5rem; line-height: 1.3; }
.card-subtitle { color: var(--text-muted); margin: 0.25rem 0 0 0; font-size: 0.9rem; }
.flex-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }

/* Hero Section */
.hero-card {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(to bottom right, var(--bg-card), var(--bg-body));
    box-shadow: var(--shadow-md);
}
.hero-content h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -0.025em; line-height: 1.2; }
.subtitle { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 2rem; line-height: 1.6; }
.greeting { font-weight: 500; color: var(--primary-color); margin-bottom: 1rem; }

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* Adjusted for smaller screens */
    gap: 1.5rem;
    margin-top: 2rem;
}
.feature-card {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--primary-color); }
.feature-card h3 { margin-top: 0; font-size: 1.1rem; }
.feature-card p { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.95rem; line-height: 1.5; }

/* About Page */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.contact-list { display: flex; flex-direction: column; gap: 0.75rem; }
.contact-item { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.contact-item .label { font-weight: 600; color: var(--text-muted); min-width: 100px; }
.contact-item .value { text-align: right; word-break: break-word; overflow-wrap: break-word; } /* Handle long text */
.contact-item .value.link { color: var(--primary-color); font-weight: 500; }

.team-members { display: grid; gap: 1rem; }
.member-card {
    background-color: var(--bg-body);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.member-role { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; margin-bottom: 0.25rem; }
.member-name { font-weight: 600; font-size: 1.1rem; margin-bottom: 0.25rem; }
.member-contact { font-size: 0.9rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 0.25rem; }
.member-contact a { word-break: break-all; }

/* Admin Table */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; /* Bleed on mobile */ }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 600px; /* Force scroll on small screens */ }
th { text-align: left; padding: 1rem; background-color: var(--bg-body); font-weight: 600; color: var(--text-muted); border-bottom: 2px solid var(--border-color); white-space: nowrap; }
td { padding: 1rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
tr:hover td { background-color: var(--bg-body); }
.text-center { text-align: center; }

/* Footer */
.site-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}
.brand-text { font-weight: 600; color: var(--text-main); }

/* Animations */
.fade-in { animation: fadeIn 0.4s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header-container { padding: 0 1rem; }
    .logo { font-size: 1.1rem; }
    
    /* Mobile Navigation */
    .mobile-menu-toggle { display: flex; z-index: 1001; }
    
    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        height: calc(100dvh - var(--header-height));
        background-color: var(--bg-header);
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
        border-bottom: none;
        box-shadow: none;
        gap: 1rem;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        overflow-y: auto;
        display: flex; /* Always flex, toggled by transform */
        visibility: hidden; /* Hide accessibility wise when closed */
    }
    
    .main-nav.open { 
        transform: translateX(0); 
        visibility: visible;
        box-shadow: var(--shadow-lg);
    }
    
    .nav-link { 
        width: 100%; 
        text-align: left; 
        padding: 1rem; 
        font-size: 1.1rem;
        border-radius: var(--radius-md);
    }
    .nav-link:active { background-color: var(--bg-body); }
    
    .nav-divider { display: none; }
    
    .settings-dropdown-container {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* Settings on mobile */
    .nav-icon-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem;
        font-size: 1.1rem;
        color: var(--text-muted);
    }
    .nav-icon-btn::after {
        content: "Settings";
        margin-left: 0.75rem;
        font-weight: 500;
    }
    .nav-icon-btn svg { width: 24px; height: 24px; }
    
    .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background-color: var(--bg-body);
        padding: 0.5rem;
        margin-top: 0.5rem;
        border-radius: var(--radius-md);
        display: none;
    }
    
    .settings-dropdown-container.active .dropdown-menu {
        display: block;
        animation: none;
    }

    .btn-primary { 
        width: 100%; 
        justify-content: center; 
        margin-top: 1rem; 
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* Content Adjustments */
    .container { margin: 1.5rem auto; padding: 0 1rem; }
    .hero-card { padding: 3rem 1.5rem; }
    .hero-content h1 { font-size: 1.75rem; }
    .about-grid { grid-template-columns: 1fr; }
    .contact-item { flex-direction: column; gap: 0.25rem; align-items: flex-start; }
    .contact-item .value { text-align: left; width: 100%; }
    
    .card { padding: 1.25rem; }
    
    /* Ensure footer doesn't get covered if content is short */
    body { display: flex; flex-direction: column; min-height: 100vh; }
}
