/* ============================================
   SAI BABA - Spiritual Design System
   ============================================ */

/* CSS Variables for maintainability */
:root {
    /* Sacred Palette */
    --saffron: #FF9933;
    --saffron-dark: #E67300;
    --gold: #FFD700;
    --gold-dark: #D4AF37;
    --white: #FFFFFF;
    --off-white: #FFF9F0;
    --cream: #FEF5E7;
    --text-dark: #2C3E50;
    --text-light: #5D6D7E;
    --divine-blue: #154360;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 3rem;

    /* Typography */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: var(--font-main);

    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-gold: 0 0 0 1px rgba(255, 215, 0, 0.3);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    line-height: 1.7;
    color: var(--text-dark);
    background: var(--off-white);
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 153, 51, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    transition: background var(--transition-medium);
}

/* Header */
header {
    background: var(--white);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-lg) var(--space-sm);
    text-align: center;
    border-bottom: 3px solid var(--gold);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

/* Sacred Geometry Pattern */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Divine Light Effect */
header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.05) 0%, transparent 70%);
    pointer-events: none;
    animation: divineLight 8s ease-in-out infinite;
}

@keyframes divineLight {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.05); }
}

header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--text-dark);
    margin-bottom: var(--space-xs);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.2);
    transition: var(--transition-medium);
    position: relative;
    z-index: 1;
}

header h1:hover {
    transform: translateY(-2px);
    text-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    color: var(--saffron);
}

header p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--saffron);
    font-style: italic;
    font-weight: 300;
    margin-top: var(--space-xs);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    animation: glow 3s ease infinite alternate;
    position: relative;
    z-index: 1;
}

@keyframes glow {
    from { opacity: 0.85; }
    to { opacity: 1; }
}

/* Main content */
main {
    max-width: 960px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-sm);
    position: relative;
    z-index: 1;
}

section {
    background: var(--white);
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--gold);
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
}

/* Subtle border glow on hover */
section:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover), var(--shadow-gold);
}

section h2 {
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 600;
    text-align: center;
    position: relative;
    padding-bottom: var(--space-sm);
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background: linear-gradient(90deg, var(--saffron), var(--gold));
    border-radius: 2px;
}

section p {
    margin-bottom: var(--space-sm);
    font-size: 1.05rem;
    color: var(--text-light);
    line-height: 1.8;
    transition: color var(--transition-fast);
}

section:hover p {
    color: var(--text-dark);
}

section ul {
    list-style: none;
    padding-left: 0;
}

section li {
    margin-bottom: var(--space-sm);
    padding-left: 2.2rem;
    position: relative;
    color: var(--text-light);
    font-size: 1.05rem;
    transition: all var(--transition-fast);
}

section li::before {
    content: "🕉️";
    position: absolute;
    left: 0;
    color: var(--saffron);
    font-size: 1.3rem;
    top: 0.05em;
}

section li:hover {
    color: var(--text-dark);
    transform: translateX(6px);
}

/* Improved focus for accessibility */
section:focus-within {
    outline: 2px solid var(--saffron);
    outline-offset: 4px;
}

/* Scroll margin for anchors */
section[id] {
    scroll-margin-top: var(--space-md);
}

/* Footer */
footer {
    text-align: center;
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--divine-blue), #0277bd);
    color: var(--white);
    margin-top: var(--space-md);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    animation: shimmer 6s infinite;
}

footer p {
    font-size: 0.9rem;
    opacity: 0.95;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    animation: glow 4s ease infinite alternate;
    font-weight: 300;
}

footer p::first-letter {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gold);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
    header h1 {
        font-size: clamp(1.8rem, 4.5vw, 2.5rem);
    }
    
    header p {
        font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    }
    
    main {
        padding: var(--space-sm);
    }
    
    section {
        padding: var(--space-sm);
        margin-bottom: var(--space-sm);
    }
    
    section h2 {
        font-size: clamp(1.3rem, 4vw, 1.8rem);
    }
}

@media (max-width: 480px) {
    header {
        padding: var(--space-md) var(--space-xs);
    }
    
    main {
        padding: var(--space-xs);
    }
    
    section {
        padding: var(--space-xs);
    }
}

/* Print styles */
@media print {
    body {
        background: var(--white);
        color: var(--text-dark);
    }
    
    header, footer {
        border: none;
        background: var(--white);
        box-shadow: none;
    }
    
    header::before,
    header::after,
    footer::before,
    section::before,
    section:hover {
        display: none;
    }
}