/* Modern Swiss Design - House of Worship */
/* CSS Variables for Light and Dark Modes */
:root {
    /* Light theme (default) */
    --primary: #0000FF; /* Blue accent per Swiss design */
    --secondary: #8B5CF6;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f4;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --shadow-elevated: rgba(0, 0, 0, 0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 64px;
    --font-heading: 'Helvetica Neue', 'Arial', sans-serif;
    --font-body: 'Helvetica Neue', 'Arial', sans-serif;
    color-scheme: light;
}

[data-theme="dark"] {
    /* Dark theme */
    --primary: #3B82F6; /* Lighter blue for dark mode */
    --secondary: #8B5CF6;
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --border-color: #444444;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-elevated: rgba(0, 0, 0, 0.4);
    color-scheme: dark;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography - Swiss Precision */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.7;
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }

.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }

/* Header & Navigation */
.header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-primary);
    text-decoration: none;
}

.nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--space-lg);
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
    padding: var(--space-xs) 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary);
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

.hamburger {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    position: relative;
    transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    left: 0;
    transition: all 0.3s ease;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

.mobile-nav-toggle[aria-expanded="true"] .hamburger {
    background-color: transparent;
}

.mobile-nav-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-nav-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* Hero Section */
.hero {
    padding: var(--space-2xl) 0;
    background-color: var(--bg-secondary);
    text-align: center;
}

.hero h1 {
    margin-bottom: var(--space-md);
}

.hero p {
    max-width: 800px;
    margin: 0 auto var(--space-xl);
    font-size: 1.25rem;
}

/* Buttons - Material Design 3 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 24px; /* Fully rounded per MD3 */
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    min-height: 44px; /* Touch target */
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

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

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

/* Cards - Material Design 3 */
.card {
    background-color: var(--bg-primary);
    border-radius: 16px; /* Per MD3 */
    padding: var(--space-lg);
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.card:hover {
    box-shadow: 0 8px 24px var(--shadow-elevated);
    transform: translateY(-4px);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: var(--space-md);
}

.card h3 {
    margin-bottom: var(--space-sm);
}

/* Grid System */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

/* Sections */
.section {
    padding: var(--space-2xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

/* Prayer Times Table */
.prayer-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-xl) 0;
}

.prayer-table th,
.prayer-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.prayer-table th {
    font-weight: 700;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

.prayer-table tr:hover {
    background-color: var(--bg-secondary);
}

/* Forms - Material Design 3 */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px; /* Per MD3 */
    font-size: 1rem;
    font-family: inherit;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Contact Form */
.contact-section {
    padding: var(--space-2xl) 0;
    background-color: var(--bg-secondary);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-xl);
    background-color: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 4px 16px var(--shadow-color);
}

.form-status {
    margin-top: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
    display: none;
}

.form-status.success {
    display: block;
    background-color: #d1fae5;
    color: #065f46;
}

.form-status.error {
    display: block;
    background-color: #fee2e2;
    color: #991b1b;
}

/* Map */
.map-container {
    margin-top: var(--space-xl);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--shadow-color);
}

.map-container iframe {
    width: 100%;
    height: 400px;
    border: 0;
}

/* Footer */
.footer {
    background-color: var(--bg-secondary);
    padding: var(--space-xl) 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
}

.footer-section h4 {
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-xs);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

.copyright {
    text-align: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--shadow-elevated);
    z-index: 1000;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-list {
        gap: var(--space-md);
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .mobile-nav-toggle {
        display: flex;
    }
    
    .nav-list {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--bg-primary);
        flex-direction: column;
        padding: var(--space-lg);
        gap: var(--space-md);
        box-shadow: 0 4px 12px var(--shadow-color);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    .nav-list[data-visible="true"] {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: var(--space-sm) 0;
    }
    
    .hero {
        padding: var(--space-xl) 0;
    }
    
    .section {
        padding: var(--space-xl) 0;
    }
    
    .contact-form {
        padding: var(--space-lg);
    }
}

/* Animation for scroll */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* Header nav spacing floor (normalizer): keep the brand and the
   menu separated when the flex container runs out of width. */
header nav, header nav > div { gap: 1rem; flex-wrap: wrap; }
@media (max-width: 1280px) { header nav ul { gap: 1rem; } }
