/* Modern CSS Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* CSS Custom Properties for Theme System */
:root {
    /* Dark theme (default) */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-glass: rgba(26, 26, 46, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #b8b8cc;
    --text-muted: #8a8aa0;
    --accent-primary: #ffd700;
    --accent-secondary: #ffed4e;
    --accent-hover: #e6c200;
    --border-primary: rgba(255, 215, 0, 0.2);
    --border-secondary: rgba(255, 255, 255, 0.1);
    --shadow-primary: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-accent: 0 10px 30px rgba(255, 215, 0, 0.3);
    --gradient-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --gradient-accent: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    --gradient-hero: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    --animation-duration-hero-glow: 8s; /* New variable for hero glow animation duration */
    --animation-duration-rotate: 15s; /* New variable for settings hero rotate animation duration */
    --logo-filter-light: none; /* Default to no filter for dark mode */
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --logo-filter-light: invert(0%) grayscale(100%) brightness(0%); /* Make logo black in light mode */
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-primary: #d97706;
    --accent-secondary: #f59e0b;
    --accent-hover: #b45309;
    --border-primary: rgba(217, 119, 6, 0.2);
    --border-secondary: rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-accent: 0 10px 30px rgba(217, 119, 6, 0.2);
    --gradient-primary: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    --gradient-accent: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    --gradient-hero: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, #f1f5f9 100%);
}

/* Base Styles */
html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: 80px; /* Account for fixed header */
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-top: 70px; /* Account for fixed header */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-primary);
    word-wrap: break-word;
    hyphens: auto;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-secondary);
    transition: all 0.3s ease;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    min-height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.logo img {
    filter: var(--logo-filter-light);
    transition: filter 0.3s ease;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links a {
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-links a:hover::before {
    left: 100%;
}

.nav-links a:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

/* Social Links */
.social-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto; /* Pushes social links to the right */
}

.social-links a {
    color: var(--text-primary);
    font-size: 1.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-primary);
    transform: scale(1.1);
}

/* Header Separator */
.header-separator {
    width: 1px;
    height: 30px;
    background-color: var(--border-secondary);
    margin: 0 1.5rem;
    display: block; /* Default to block for desktop */
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: 2px solid var(--accent-primary);
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        height: 40px;
        padding: 0.25rem;
    }

    .social-links {
        display: none; /* Hide from header on mobile */
    }

    .header-separator {
        display: none; /* Hide separator on mobile */
    }
    
    nav {
        padding: 0.5rem;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-glass);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        border-top: 1px solid var(--border-secondary);
        gap: 1rem;
        width: 100%; /* Take full width on mobile */
    }
    
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links a {
        text-align: center;
        padding: 1rem;
        border-radius: 0.5rem;
        border: 1px solid var(--border-secondary);
    }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 0 2rem;
}

.hero-background-slides {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    transform: scale(1.2);
    will-change: transform, opacity;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide.zoom-active {
    transform: scale(1);
    transition: transform 5s ease-out, opacity 1s ease-in-out;
}

@keyframes smoothZoomOut {
    0% { 
        transform: scale(1.2); 
    }
    100% { 
        transform: scale(1); 
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 15, 26, 0.7) 0%, rgba(26, 26, 46, 0.8) 50%, rgba(22, 33, 62, 0.7) 100%);
    z-index: 2;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Specific hero height adjustments for other pages */

/* Specific hero height adjustments for other pages */
.hero-small {
    min-height: 70vh; /* Used for courses, coaching, gallery, contact */
}

.hero-blog {
    min-height: 50vh; /* Used for blog */
    border-radius: 32px;
    padding: 80px 40px;
    margin: 32px auto;
    max-width: 960px;
    box-shadow: 0 12px 72px rgba(44,44,74,0.3);
}

.hero-about {
    min-height: 70vh; /* Specific height for about page */
}

.tournament-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #4e54c8 50%, #8b5cf6 100%);
    border-radius: 2rem;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin: 2rem auto;
}

.settings-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,215,0,0.1) 0%, transparent 70%);
    animation: rotate var(--animation-duration-rotate) linear infinite;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, var(--accent-primary) 0%, transparent 70%);
    opacity: 0.1;
    animation: heroGlow var(--animation-duration-hero-glow) ease-in-out infinite alternate;
}

@keyframes heroGlow {
    from { opacity: 0.05; }
    to { opacity: 0.15; }
}

.hero-content {
    max-width: 800px;
    z-index: 3;
    position: relative;
    padding: 0.5rem;
    max-width: 95%;
}

.hero h1 {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.4s both;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--bg-primary);
    box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}

.btn-secondary:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* Sections */
.section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-primary);
    border-color: var(--accent-primary);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.card-title {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.card-description {
    color: var(--text-secondary);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    border: 1px solid var(--border-secondary);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Forms */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 1rem;
    border: 1px solid var(--border-secondary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-secondary);
    padding: 3rem 2rem 2rem;
    margin-top: 5rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    align-items: start;
}

.footer-section {
    padding: 1rem 0;
}

.footer-section h3 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.footer-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: var(--text-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.footer-section a:hover {
    color: var(--accent-primary);
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-secondary);
    color: var(--text-muted);
}

.footer-social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.footer-social-links a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
    background: var(--bg-tertiary);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-social-links a:hover {
    color: var(--accent-primary);
    transform: translateY(-3px) scale(1.1);
    background: var(--bg-secondary);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

/* Settings Panel */
.settings-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: 2px solid var(--accent-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-accent);
    transition: all 0.3s ease;
    z-index: 1100;
    user-select: none;
    -webkit-user-select: none;
    will-change: transform;
}

.ai-assistant-button {
    position: fixed;
    bottom: 7rem; /* Adjusted to be above the settings button */
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: 2px solid var(--accent-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-accent);
    transition: all 0.3s ease;
    z-index: 1100;
    user-select: none;
    -webkit-user-select: none;
    will-change: transform;
}

[data-theme="light"] .settings-toggle,
[data-theme="light"] .ai-assistant-button {
    color: #000000; /* Black emoji in light mode */
}

[data-theme="dark"] .settings-toggle,
[data-theme="dark"] .ai-assistant-button {
    color: #FFFFFF; /* White emoji in dark mode */
}

.settings-toggle.scrolled {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
}

.settings-toggle:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.settings-panel {
    position: fixed;
    top: 0;
    right: -100%; /* Use percentage for responsiveness */
    width: min(400px, 100%); /* Max 400px, but responsive to screen width */
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 2px solid var(--border-secondary);
    padding: 2rem;
    transition: right 0.3s ease, border-color 0.3s ease;
    z-index: 1200;
    overflow-y: auto;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.settings-panel.open {
    right: 0;
    border-left-color: var(--accent-primary);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.settings-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

.setting-item {
    margin-bottom: 2rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
}

.toggle-switch {
    width: 50px;
    height: 25px;
    background: var(--border-secondary);
    border-radius: 25px;
    position: relative;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: var(--accent-primary);
}

.toggle-switch::before {
    content: '';
    width: 21px;
    height: 21px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.toggle-switch.active::before {
    transform: translateX(25px);
}

/* Enhanced Settings Panel Elements */
.font-size-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border-secondary);
}

.font-btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 0.25rem;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.font-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

#font-display {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 60px;
    text-align: center;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-secondary);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
}

.status-indicator.online {
    background: #22c55e;
    animation: pulse 2s infinite;
}

.status-indicator.away {
    background: #f59e0b;
}

.status-indicator.offline {
    background: #ef4444;
}

.session-display {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-secondary);
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--accent-primary);
}

.settings-actions {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-secondary);
}

.settings-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Loading states */
.settings-panel.loading {
    opacity: 0.7;
    pointer-events: none;
}

.settings-panel.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--border-secondary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility enhancements */
@media (prefers-reduced-motion: reduce) {
    .settings-toggle,
    .toggle-switch,
    .font-btn,
    .status-indicator {
        animation: none;
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .settings-panel {
        border-width: 3px;
    }
    
    .toggle-switch {
        border: 2px solid var(--text-primary);
    }
    
    .font-btn {
        border: 2px solid var(--bg-primary);
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.floating-element {
    animation: float 6s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .section {
        padding: 3rem 1rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .settings-panel {
        width: 100vw;
        right: -100vw;
        padding: 1.5rem;
    }
    
    .settings-toggle {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .hero {
        min-height: 80vh;
        padding: 2rem 1rem;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero h1 {
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1.125rem;
        margin-bottom: 1.5rem;
    }
    
    nav {
        padding: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Gallery Preview Styles */
.gallery-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.gallery-preview-card {
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 1rem;
}

.gallery-preview-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.gallery-preview-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.gallery-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-preview-card:hover .gallery-preview-image img {
    transform: scale(1.05);
}

.gallery-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 215, 0, 0.9);
    color: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.gallery-preview-content {
    padding: 1.5rem;
}

.gallery-preview-content h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.gallery-preview-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.gallery-preview-footer {
    text-align: center;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
    transition: background 0.3s ease;
}

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

/* Focus states */
.btn:focus,
.font-btn:focus,
.settings-toggle:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Animation disabled state */
.no-animations {
    --animation-duration-hero-glow: 0.01ms;
    --animation-duration-rotate: 0.01ms;
}

.no-animations * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* Small Mobile Devices (480px and below) */
@media (max-width: 480px) {
    body {
        padding-top: 50px;
    }

    nav {
        padding: 0.25rem 0.5rem;
        min-height: 50px;
    }

    .logo {
        font-size: 0.9rem;
    }

    .logo img {
        height: 30px !important;
    }

    .header-separator {
        display: none; /* Hide separator on small mobile */
    }

    .section {
        padding: 1.5rem 0.75rem;
    }

    .cards-grid {
        gap: 0.75rem;
        margin-top: 1rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: 0.5rem;
    }

    .hero {
        min-height: 70vh;
        padding: 1rem 0.5rem;
    }

    .hero-content {
        padding: 0.5rem;
        max-width: 95%;
        z-index: 3;
        position: relative;
    }

    

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        margin: 0;
        text-align: center;
        justify-content: center;
        padding: 0.875rem 1.5rem;
    }

    h1 {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }

    h2 {
        font-size: clamp(1.5rem, 6vw, 2rem);
        line-height: 1.3;
    }

    .hero-content p {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
        line-height: 1.5;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

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

    .stat-item {
        padding: 1rem 0.75rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .settings-toggle {
        width: 45px;
        height: 45px;
        bottom: 0.75rem;
        right: 0.75rem;
        font-size: 1.1rem;
    }

    .settings-panel {
        padding: 1rem 0.75rem;
    }

    .section-title {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
        margin-bottom: 0.75rem;
    }

    .section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    /* Gallery preview adjustments */
    .gallery-preview-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gallery-preview-image {
        height: 180px;
    }

    /* Ensure cards stack properly */
    .cards-grid .card {
        width: 100%;
        margin: 0;
    }

    /* Testimonials container adjustments */
    .testimonials-container {
        margin: 0 auto;
        padding: 0 0.5rem;
    }
}

/* Loading Animation */
.loading {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.loading.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll Animations */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Prevent layout shifts during animations */
.cards-grid .reveal {
    min-height: 200px;
}

.stats-grid .reveal {
    min-height: 150px;
}

/* Gallery Image Effects */
.gallery-image {
    transition: transform 0.3s ease, filter 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.gallery-image:hover img {
    transform: scale(1.1);
}

.card:hover .gallery-image {
    transform: scale(1.02);
}

/* Auto-fit image containers */
.gallery-preview-image,
.hero-slide {
    position: relative;
    overflow: hidden;
}

.gallery-preview-image img,
.hero-slide {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Photo Badge Animation */
.card [style*="📸"] {
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

@keyframes pulse {
    0% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.05);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Photo Grid Responsive */
@media (max-width: 768px) {
    .gallery-image {
        height: 150px !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .settings-panel {
        border-width: 3px;
    }
    
    .toggle-switch {
        border: 2px solid var(--text-primary);
    }
    
    .font-btn {
        border: 2px solid var(--bg-primary);
    }
}

/* Hero Slideshow Fix */
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transform: scale(1.2);
    transition: opacity 1s ease-in-out, transform 5s ease-out;
    will-change: opacity, transform;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide.zoom-active {
    transform: scale(1);
}

/* Footer Map */
.footer-map {
    grid-column: span 4;
    margin-top: 2rem;
}

.footer-map iframe {
    width: 100%;
    height: 300px;
    border-radius: 1rem;
    border: 1px solid var(--border-secondary);
    filter: grayscale(1) invert(1);
}

@media (max-width: 992px) {
    .footer-map {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .footer-map {
        grid-column: span 1;
    }
}


.ai-assistant-button {
    position: fixed;
    bottom: 2rem;
    right: 6rem; /* Adjust this value to position it next to the settings button */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: 2px solid var(--accent-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-accent);
    transition: all 0.3s ease;
    z-index: 1100;
    user-select: none;
    -webkit-user-select: none;
    will-change: transform;
}

.ai-assistant-button.scrolled {
    bottom: 1.5rem;
    right: 5.5rem; /* Adjust as needed */
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
}

.ai-assistant-button:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

/* Light mode for AI assistant button */
[data-theme="light"] .ai-assistant-button {
    background: var(--accent-primary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

[data-theme="light"] .ai-assistant-button:hover {
    background: var(--accent-hover);
}

/* Dark mode for AI assistant button */
[data-theme="dark"] .ai-assistant-button {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

[data-theme="dark"] .ai-assistant-button:hover {
    background: var(--accent-hover);
}

/* Chat Interface */
.chat-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 400px;
    max-width: 90vw;
    background: var(--bg-secondary);
    border-radius: 1rem;
    box-shadow: var(--shadow-primary);
    display: none;
    flex-direction: column;
    z-index: 1200;
}

.chat-container.open {
    display: flex;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-secondary);
}

.chat-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.chat-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

.chat-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    height: 300px;
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message .message-content {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
}

.chat-message.user .message-content {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-bottom-right-radius: 0;
}

.chat-message.ai .message-content {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 0;
}

.chat-input-container {
    padding: 1rem;
    border-top: 1px solid var(--border-secondary);
}

#chat-form {
    display: flex;
    gap: 0.5rem;
}

#chat-input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

#chat-form button {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
}
