:root {
    --primary: #8B0000;
    --primary-dark: #6d0000;
    --gold: #D4AF37;
    --gold-light: #FFD700;
    --cream: #FFF8E7;
    --dark: #2C1A0D;
    --light: #F9F5F0;
    --text: #333333;
    --text-light: #777777;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    background-color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.3;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Page Header */

/* Page Header */
.page-header {
    /* REMOVE the negative margin and excessive padding here */
    padding: 80px 0 !important; /* Use a neutral base padding */
    
    background: linear-gradient(rgba(44, 26, 13, 0.8), rgba(44, 26, 13, 0.8)), 
                url('../images/history-bg.png') center/cover no-repeat;
    color: white;
    text-align: center;
    position: relative;
    /* ENSURE no margin-top is present here */
}



.page-header h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: white;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--light);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preloader-inner {
    position: relative;
    width: 60px;
    height: 60px;
}

.preloader-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.preloader-icon span {
    display: block;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Navigation */
.navbar {
    padding: 20px 0;
    background-color: rgba(44, 26, 13, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
}

.navbar.scrolled {
    padding: 15px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 50px;
    margin-right: 15px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
}

.navbar-nav {
    align-items: center;
}

/* --- Standard Links (Excluded CTA Button) --- */
/* FIX: Added :not(.cta-button) so this rule doesn't ruin the donate button */
.nav-link:not(.cta-button) {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 15px !important;
    margin: 0 5px;
    position: relative;
}

.nav-link:not(.cta-button)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    width: 0;
    height: 2px;
    background-color: var(--gold);
    transition: width 0.3s ease;
}

.nav-link:not(.cta-button):hover::after,
.nav-link:not(.cta-button).active::after {
    width: calc(100% - 30px);
}

/* FIX: Only apply gold text to non-CTA links */
.nav-link:not(.cta-button):hover,
.nav-link:not(.cta-button).active {
    color: var(--gold) !important;
}

/* --- Donate Button Specific Styling --- */
.navbar-nav .nav-link.cta-button {
    background-color: var(--gold);
    color: var(--dark) !important; /* Forces dark text */
    border-radius: 30px;
    padding: 8px 20px !important;
    margin-left: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Specific Active State for Donate Button */
.navbar-nav .nav-link.cta-button.active,
.navbar-nav .nav-link.cta-button:hover,
.navbar-nav .nav-link.cta-button:focus {
    background-color: var(--gold-light) !important; /* Brighter gold background */
    color: var(--dark) !important; /* Keep text dark */
    transform: translateY(-2px);
    opacity: 1 !important;
    text-decoration: none;
}

/* Hero Section */

.hero-section {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    overflow: hidden;
    /* ENSURE margin-top: -100px; is REMOVED from styles.css */
}

.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(44, 26, 13, 0.8) 0%, rgba(44, 26, 13, 0.4) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    padding-top: 220px !important; 
    padding-bottom: 50px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: white;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

.arrow-down {
    width: 20px;
    height: 20px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg);
    margin-top: 5px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: rotate(-45deg) translateY(0);
    }
    40% {
        transform: rotate(-45deg) translateY(-10px);
    }
    60% {
        transform: rotate(-45deg) translateY(-5px);
    }
}

/* Section Styles */
section {
    padding: 80px 0;
    position: relative;
}

.section-header {
    margin-bottom: 50px;
    position: relative;
}

.section-subtitle {
    display: inline-block;
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--gold);
    margin-top: 15px;
}

.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px auto 30px;
    max-width: 400px;
}

.divider-line {
    height: 1px;
    background-color: var(--gold);
    flex-grow: 1;
}

.divider-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 15px;
    font-size: 16px;
}

/* Quick Links Section */
.quick-links-section {
    padding: 80px 0;
    background-color: var(--cream);
}

.quick-link-card {
    background: white;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    height: 100%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
}

.quick-link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.icon-wrapper {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.bg-gold {
    background-color: var(--gold);
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
}

.bg-red {
    background-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.quick-link-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--dark);
    font-weight: 600;
}

.quick-link-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* About Section */
.about-section {
    background-color: #fffaf0; 
    padding: 80px 0;
}

.about-section .section-header {
    border-left: 4px solid var(--gold);
    padding-left: 20px;
}

.about-section .section-title {
    color: var(--primary); 
    font-size: 2.8rem;
    font-weight: 700;
    text-shadow: 1px 1px 0px rgba(212, 175, 55, 0.2); 
}

.about-section .section-subtitle {
    color: var(--gold);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 2px;
}

.about-section .about-text {
    color: #2c1a0d;
    font-size: 1.2rem;
    line-height: 1.8;
    font-weight: 400;
    margin-bottom: 30px;
}

.upadevas-list ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.upadevas-list li {
    background-color: var(--light);
    padding: 8px 15px;
    border-radius: 30px;
    font-size: 0.9rem;
    color: var(--text);
}

.about-image {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.btn-link {
    color: var(--gold);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.btn-link:hover {
    color: var(--primary);
}

/* Rituals Section */
.rituals-section {
    padding: 80px 0;
    background-color: var(--light);
}

.rituals-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.ritual-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    flex: 1;
    min-width: 300px;
    max-width: 550px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.05);
}

.ritual-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary), #a00000);
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.ritual-header h3 {
    margin: 0;
    color: white;
    font-size: 1.25rem;
}

.ritual-list {
    list-style: none;
    padding: 20px;
    margin: 0;
    flex-grow: 1;
}

.ritual-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.ritual-list .time {
    font-weight: 700;
    color: var(--gold);
    min-width: 85px;
}

.ritual-note {
    background-color: #fff3cd;
    color: #856404;
    padding: 15px 25px;
    border-radius: 50px;
    border: 1px solid #ffeeba;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 40px auto 0 auto;
    max-width: 700px;
    width: 90%;
}

/* Updates Section */
.updates-section {
    padding: 80px 0;
    background-color: var(--cream);
}

.update-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.update-card:hover {
    transform: translateY(-10px);
}

.update-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.update-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.update-card:hover .update-image img {
    transform: scale(1.05);
}

.update-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.badge-date {
    background-color: var(--primary);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.badge-category {
    background-color: var(--gold);
    color: var(--dark);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 12px;
}

.update-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.read-more-btn {
    color: var(--primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    margin-top: auto;
}

/* Social Section */
.social-section {
    padding: 60px 0;
    background-color: white;
}

.social-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

@media (min-width: 992px) {
    .social-media-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.social-card {
    background: white;
    border-radius: 8px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
}

.social-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.social-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
    color: white;
}

.facebook .social-icon { background-color: #3b5998; }
.instagram .social-icon { background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D); }
.youtube .social-icon { background-color: #FF0000; }
.whatsapp .social-icon { background-color: #25D366; }

.follow-text {
    font-weight: 600;
    font-size: 0.8rem;
    padding: 6px 20px;
    border-radius: 20px;
    background-color: #f8f9fa;
    color: var(--primary);
}

.social-card:hover .follow-text {
    background-color: var(--gold);
    color: var(--dark);
}

/* Footer */
.footer {
    background: linear-gradient(to right, var(--primary), #5a0000);
    color: white;
    position: relative;
}

.footer-top {
    padding: 80px 0 50px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-links a:hover {
    color: var(--gold);
}

.footer-bottom {
    padding: 20px 0;
    background-color: rgba(0, 0, 0, 0.2);
}

/* History Page Styles */
.history-section .section-title {
    font-family: 'Times New Roman', serif;
    color: #800000;
    font-size: 3rem;
}

.history-section .section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #d4af37;
    margin-top: 10px;
}

.historical-facts {
    background: white;
    padding: 25px;
    border-left: 4px solid #800000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-top: 30px;
}

/* Responsive Fixes */
@media (max-width: 991.98px) {
    .hero-content {
        padding-top: 150px !important;
    }
    .navbar-collapse {
        background-color: var(--dark);
        padding: 20px;
        margin-top: 15px;
    }
    .cta-button {
        margin-left: 0;
        margin-top: 10px;
        display: inline-block;
        text-align: center;
    }
}

/* ==================================== */
/* General Section Header Fix for Centered Content */
/* ==================================== */

/* Add this to allow centered headers to align their underline/divider correctly */
.section-header.text-center .section-title::after {
    margin: 15px auto 0 auto; /* Center the underline */
}

/* Make sure titles in centered headers are centered */
.section-header.text-center .section-title {
    text-align: center;
}

/* ==================================== */
/* 5. TIMELINE SECTION STYLES (Color Consistency Fixes) */
/* ==================================== */

.timeline-section {
    padding: 80px 0;
    position: relative;
}

/* Base Timeline Container */
.timeline {
    position: relative;
    padding: 20px 0;
    /* FIX 1: Use variable for main line color */
    border-left: 3px solid var(--primary); 
    margin-left: 20px;
}

/* Timeline Item - Positioning */
.timeline-item {
    margin-bottom: 50px;
    position: relative;
}

/* Timeline Date - The circle and line marker */
.timeline-date {
    position: absolute;
    left: -125px;
    top: 5px;
    width: 100px;
    text-align: right;
    font-size: 1.1rem;
    font-weight: 600;
    /* FIX 2: Use variable for date text color */
    color: var(--dark); 
    padding-right: 20px;
    border-right: 2px solid #ccc; /* Light grey line */
}

/* Timeline Dot/Icon on the main line */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -33px;
    top: 10px;
    width: 18px;
    height: 18px;
    /* FIX 3: Use variable for inner dot color */
    background-color: var(--light); 
    /* FIX 4: Use variable for border ring color */
    border: 3px solid var(--primary); 
    border-radius: 50%;
    z-index: 10;
}

/* Timeline Content Box */
.timeline-content {
    /* FIX 5: Use white/light variable */
    background: white; 
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    margin-left: 30px;
}

.timeline-content h4 {
    font-size: 1.35rem;
    font-weight: 700;
    /* FIX 6: Use variable for highlight color */
    color: var(--primary); 
    margin-bottom: 10px;
}

.timeline-content p {
    font-size: 0.95rem;
    /* FIX 7: Use variable for light text color */
    color: var(--text-light); 
    margin-bottom: 0;
}

/* Arrow/Pointer for the Content Box (pointing left to the line) */
.timeline-content::after {
    content: '';
    position: absolute;
    top: 15px;
    left: -15px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    /* FIX 8: Use white/light variable for arrow background */
    border-right: 15px solid white; 
}

/* ==================================== */
/* TIMELINE RESPONSIVENESS (Mobile) */
/* ==================================== */

@media (max-width: 768px) {
    .timeline {
        /* FIX 9: Use variable */
        border-left: 3px solid var(--primary); 
        margin-left: 0;
    }

    .timeline-date {
        position: static;
        text-align: left;
        font-size: 1rem;
        font-weight: 600;
        /* FIX 10: Use variable */
        color: var(--primary); 
        padding-left: 15px;
        padding-bottom: 5px;
        border-right: none;
        /* FIX 11: Use variable */
        border-bottom: 1px solid var(--primary); 
        margin-bottom: 10px;
    }

    .timeline-item::before {
        left: -8px;
        top: 0;
    }

    .timeline-content {
        margin-left: 15px;
        padding: 15px;
        margin-top: 20px;
    }

    .timeline-content::after {
        content: none;
    }
}