/* ==========================================================================
   1. CSS Variables - Theme System
   ========================================================================== */

/* Base variables (Dark Mode) */
:root {
    /* Banner/Header background */
    --banner-bg: #8b7165; /* Dark Red - from dark_banner_text.png */
    
    /* Body/Background */
    --body-bg: #6d422e; /* Dark Red - from dark_bg_text.png */
    --card-bg: #2b2b2b;
    --surface-light: #222222;
    
    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: #d893f3;
    --text-muted: #9c9999;
    
    /* Accent colors */
    --accent-primary: #4a6fa5; /* Metallic Blue */
    --accent-primary-light: #5a7fb5;
    --accent-primary-dark: #3a5f95;
    
    /* UI Elements */
    --border-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.5);
    
    /* Transitions */
    --transition-speed: 0.3s;
}

/* Light Mode - Overrides */
.light-mode {
    --banner-bg: #87CEEB; /* Sky Blue - from light_banner_text.png */
    --body-bg: #87CEEB; /* Sky Blue - from light_bg_text.png */
    --card-bg: #ffffff;
    --surface-light: #f0f0f0;
    
    --text-primary: #222222;
    --text-secondary: #444444;
    --text-muted: #666666;
    
    --accent-primary: #1e375e;
    --accent-primary-light: #4a6fa5;
    --accent-primary-dark: #2a4f85;
    
    --border-color: #dddddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* High Contrast Mode - Overrides */
.high-contrast-mode {
    --banner-bg: #000000;
    --body-bg: #000000;
    --card-bg: #000000;
    --surface-light: #000000;
    
    --text-primary: #ffffff;
    --text-secondary: #cece84; /* Yellow for emphasis */
    --text-muted: #ffffff;
    
    --accent-primary: #00ffff; /* Cyan */
    --accent-primary-light: #00ffff;
    --accent-primary-dark: #00ffff;
    
    --border-color: #ffffff;
    --shadow-color: rgba(255, 255, 255, 0.3);
}

/* High Contrast Light Mode */
.high-contrast-mode.light-mode {
    --banner-bg: #ffffff;
    --body-bg: #ffffff;
    --card-bg: #ffffff;
    --surface-light: #ffffff;
    
    --text-primary: #000000;
    --text-secondary: #0000ff; /* Blue */
    --text-muted: #000000;
    
    --accent-primary: #ff0000; /* Red */
    --accent-primary-light: #ff0000;
    --accent-primary-dark: #ff0000;
    
    --border-color: #000000;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   2. Global Styles & Reset
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--body-bg);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   3. Header & Navigation
   ========================================================================== */
header {
    background-color: var(--banner-bg);
    color: var(--text-primary);
    padding: 18px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px var(--shadow-color);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color var(--transition-speed);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Crimson Text', serif;
    font-size: 1.8rem;
    font-weight: 700;
}

.logo-img {
    height: 40px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    vertical-align: middle;
}

.logo-text {
    color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.theme-toggle-btn {
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    width: 80px; /* Increased for 3 states */
    height: 30px;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-speed);
    margin-left: 15px;
    display: flex;
    align-items: center;
    padding: 0 8px;
}

.theme-toggle-btn::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-primary);
    transition: transform var(--transition-speed);
    left: 3px;
}

.light-mode .theme-toggle-btn::after {
    transform: translateX(25px);
}

.high-contrast-mode .theme-toggle-btn::after {
    transform: translateX(50px);
}

.theme-icon {
    font-size: 0.9rem;
    z-index: 1;
    color: var(--text-secondary);
}

.sun-icon {
    margin-right: auto;
}

.moon-icon {
    margin-left: auto;
}

.accessibility-icon {
    font-size: 1rem;
    margin-left: auto;
}

/* Navigation */
nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color var(--transition-speed);
    padding: 5px 0;
    display: flex;
    align-items: center;
    min-height: 44px;
}

nav a:hover,
nav a.active {
    color: var(--accent-primary);
}

nav a.active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--accent-primary);
    bottom: 0;
    left: 0;
    border-radius: 3px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.8rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 5px;
    transition: background-color var(--transition-speed);
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background-color: var(--surface-light);
}

/* ==========================================================================
   4. Page Sections
   ========================================================================== */
.page {
    min-height: 100vh;
    padding: 100px 0 50px;
    animation: fadeIn 0.5s ease forwards;
}

.page-header {
    text-align: center;
    margin-bottom: 60px;
}

.page-header h1 {
    font-family: 'Crimson Text', serif;
    font-size: 3.5rem;
    color: var(--accent-primary);
    margin-bottom: 15px;
    text-shadow: 0 2px 4px var(--shadow-color);
}

.page-header .tagline {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-header .divider {
    width: 150px;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--accent-primary), transparent);
    margin: 0 auto;
}

/* ==========================================================================
   5. Our Story Page
   ========================================================================== */
.story-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.story-text {
    flex: 1;
}

.story-text h2 {
    font-family: 'Crimson Text', serif;
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: 20px;
}

.story-text p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.story-image {
    flex: 1;
    text-align: center;
    position: relative;
}

.story-image::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent-primary);
    border-radius: 10px;
    top: 15px;
    left: 15px;
    z-index: 0;
}

.story-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px var(--shadow-color);
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   6. Services Page
   ========================================================================== */
.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.service-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    text-align: center;
    border: 1px solid var(--border-color);
    cursor: pointer;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px var(--shadow-color);
}

.service-card:active {
    transform: scale(0.98);
}

.service-icon {
    font-size: 3.5rem;
    color: var(--accent-primary);
    margin-bottom: 25px;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-card h3 {
    font-family: 'Crimson Text', serif;
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 20px;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ==========================================================================
   7. Staff Page
   ========================================================================== */
.staff-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 50px;
}

.staff-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 10px 30px var(--shadow-color);
    text-align: center;
    width: 320px;
    border: 1px solid var(--border-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    cursor: pointer;
}

.staff-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px var(--shadow-color);
}

.staff-card:active {
    transform: scale(0.98);
}

.staff-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-light));
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    box-shadow: 0 5px 15px var(--shadow-color);
    border: 3px solid var(--accent-primary-dark);
}

.staff-card h3 {
    font-family: 'Crimson Text', serif;
    font-size: 1.8rem;
    color: var(--accent-primary);
    margin-bottom: 10px;
}

.staff-role {
    color: var(--accent-primary-light);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.staff-description {
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.7;
}

/* ==========================================================================
   8. Contact Page
   ========================================================================== */
.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 50px;
}

.contact-form-container,
.social-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.contact-form h3,
.social-container h3 {
    font-family: 'Crimson Text', serif;
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--accent-primary);
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    background-color: var(--surface-light);
    color: var(--text-primary);
    transition: border-color var(--transition-speed);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.2);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    background: linear-gradient(to right, var(--accent-primary), var(--accent-primary-dark));
    color: white;
    border: none;
    padding: 18px 35px;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-weight: 600;
    width: 100%;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(74, 111, 165, 0.3);
}

.submit-btn:hover {
    background: linear-gradient(to right, var(--accent-primary-light), var(--accent-primary));
    box-shadow: 0 8px 20px rgba(74, 111, 165, 0.4);
}

.submit-btn:active {
    transform: scale(0.98);
}

/* Social Icons */
.social-icons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 15px 20px;
    background-color: var(--card-bg);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1.2rem;
    text-decoration: none;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all var(--transition-speed);
    border: 1px solid var(--border-color);
    min-height: 70px;
}

.social-icon:hover {
    transform: translateY(-5px);
    background-color: var(--accent-primary);
    color: white;
    box-shadow: 0 10px 20px rgba(74, 111, 165, 0.3);
}

.social-icon:active {
    transform: scale(0.98);
}

.social-icon i {
    margin-right: 15px;
    font-size: 1.5rem;
}

.social-username {
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================================================
   9. Footer
   ========================================================================== */
footer {
    background-color: var(--banner-bg);
    color: var(--text-primary);
    padding: 40px 0;
    text-align: center;
    margin-top: 80px;
    border-top: 1px solid var(--border-color);
}

.footer-logo {
    font-family: 'Crimson Text', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo span {
    color: var(--text-primary);
    margin-left: 5px;
}

.copyright {
    color: var(--text-muted);
    margin-top: 20px;
    font-size: 0.9rem;
}

/* ==========================================================================
   10. Animations
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   11. Scrollbar Styling
   ========================================================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--surface-light);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary-light);
}

/* ==========================================================================
   12. Mobile Responsive
   ========================================================================== */
@media (max-width: 992px) {
    .story-content {
        flex-direction: column;
    }
    
    .story-image::before {
        display: none;
    }
    
    .page-header h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .theme-toggle {
        margin-right: 10px;
    }
    
    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--banner-bg);
        box-shadow: 0 10px 20px var(--shadow-color);
        border-top: 1px solid var(--border-color);
        padding: 20px;
    }
    
    nav.active {
        display: block;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0;
    }
    
    nav a {
        padding: 15px 0;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    
    nav a:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .page {
        padding: 120px 0 50px;
    }
    
    .page-header h1 {
        font-size: 2.2rem;
    }
    
    .service-card,
    .staff-card,
    .contact-form-container,
    .social-container {
        padding: 30px 20px;
    }
    
    .social-icons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .page-header .tagline {
        font-size: 1.2rem;
    }
    
    .service-card {
        min-height: 350px;
    }
    
    .staff-card {
        width: 100%;
        max-width: 320px;
    }
    
    .theme-toggle-btn {
        width: 70px;
    }
}
