:root {
    /* Color Palette */
    --primary-color: #FF6B35;
    /* Saffron/Orange */
    --secondary-color: #C1272D;
    /* Deep Red */
    --accent-color: #DAA520;
    /* Gold */
    --bg-color: #FFF8F0;
    /* Warm Cream */
    --text-color: #3E2723;
    /* Dark Brown */
    --white: #FFFFFF;

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, rgba(255, 107, 53, 0.9), rgba(193, 39, 45, 0.9));
    --gradient-gold: linear-gradient(to right, #D4AF37, #FEE68C, #D4AF37);
    --gradient-section: linear-gradient(to bottom, #FFF8F0, #FFF5E6);
    --gradient-dark: linear-gradient(135deg, #420000, #800000, #DAA520);
    /* Deep Maroon to Gold */

    /* Fonts */
    --font-heading: 'Cinzel', serif;
    /* Decorative, spiritual */
    --font-body: 'Lato', sans-serif;
    /* Clean, readable */

    /* Effects */
    --transition: all 0.3s ease;
    --shadow-card: 0 10px 30px rgba(62, 39, 35, 0.1);
    --shadow-hover: 0 15px 40px rgba(193, 39, 45, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

html {
    scroll-padding-top: 100px;
    /* Fix for sticky header obscuring content */
    scroll-behavior: smooth;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* --- Navigation --- */
.navbar {
    background: var(--gradient-dark);
    /* Dark Gradient: Dark Brown, Deep Red, Gold */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--accent-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--white);
    /* Updated for dark bg */
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-icon {
    height: 60px;
    width: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
}

.nav-links li a {
    font-weight: 600;
    color: var(--white);
    /* Updated for dark bg */
    position: relative;
    padding-bottom: 5px;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: var(--transition);
}

.nav-links li a:hover::after {
    width: 100%;
}

.nav-links li a:hover {
    color: var(--secondary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #DAA520;
    /* Explicit Code for Gold for contrast */
    /* Updated for dark bg */
    transition: var(--transition);
}

/* Mobile Menu X Animation */
.mobile-menu-btn.active .bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    min-height: 75dvh;
    /* Updated height */
    background-image: url('../images/rameshwaram_temple_hero.png');
    background-size: cover;
    background-position: center;
    margin-top: 80px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(62, 39, 35, 0.6));
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Image left, Text right */
    gap: 50px;
    align-items: center;
    width: 100%;
}

.hero-image-wrapper {
    text-align: center;
}

.hero-feature-img {
    max-width: 100%;
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--accent-color);
    opacity: 0;
    /* For Lazy Loading transition */
    transition: opacity 0.5s ease-in-out;
}

.hero-feature-img.loaded {
    opacity: 1;
}


.hero-content {
    text-align: right;
    /* Right align as requested */
    color: var(--white);
}

.hero-content h1 {
    font-size: 3.5rem;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 40px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.btn {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-gold);
    color: var(--text-color);
    box-shadow: 0 5px 15px rgba(218, 165, 32, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(218, 165, 32, 0.6);
}

/* --- Floating Action Buttons --- */
.floating-actions {
    position: fixed;
    right: 20px;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 2000;
}

.float-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 50px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    text-decoration: none;
}

.float-whatsapp {
    background-color: #25D366;
}

.float-call {
    background-color: var(--primary-color);
}

.float-btn:hover {
    transform: scale(1.05);
}

.float-icon {
    font-size: 1.5rem;
}

/* --- Sections Common --- */
.section {
    padding: 50px 0;
    position: relative;
    background: var(--bg-color);
}

.section:nth-child(even) {
    background: var(--gradient-section);
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 3rem;
    color: var(--secondary-color);
    position: relative;
    display: inline-block;
    margin-top: 0;
}



.section-header p {
    font-size: 1.2rem;
    color: #666;
    max-width: 700px;
    margin: 15px auto 0;
}

/* --- Card Styles --- */
.priest-grid,
.services-grid {
    display: grid;
    gap: 40px;
}

/* Testimonials Slider */
.slider-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.testimonials-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 30px;
    padding: 20px 5px;
    /* Padding for shadow */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    scroll-behavior: smooth;
}

.testimonials-slider::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.testimonial-card {
    flex: 0 0 350px;
    /* Fixed width cards */
    scroll-snap-align: center;
    background: var(--white);
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(218, 165, 32, 0.2);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.testimonial-card .quote {
    font-size: 4rem;
    color: var(--accent-color);
    line-height: 1;
    font-family: var(--font-heading);
    opacity: 0.5;
    margin-bottom: -20px;
}

.testimonial-card p {
    font-style: italic;
    color: #555;
    margin-bottom: 20px;
}

.testimonial-card h4 {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.slider-btn {
    background: var(--white);
    border: 2px solid var(--accent-color);
    color: var(--secondary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
    flex-shrink: 0;
}

.prev-btn {
    margin-right: 15px;
}

.next-btn {
    margin-left: 15px;
}

.slider-btn:hover {
    background: var(--accent-color);
    color: var(--white);
    transform: scale(1.1);
}

@media (max-width: 600px) {
    .testimonial-card {
        flex: 0 0 280px;
    }
}

/* Service Card */
.services-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.service-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(218, 165, 32, 0.2);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(193, 39, 45, 0.2), inset 0 0 20px rgba(255, 107, 53, 0.05);
    /* Enhanced shadow */
    border-color: var(--accent-color);
    background: linear-gradient(to bottom, var(--white), #FFF3E0);
    /* Subtle Saffron Gradient */
}

.service-icon {
    font-size: 3.5rem;
    margin-bottom: 25px;
    color: var(--primary-color);
}

.service-card h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.btn-service {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 25px;
    background: linear-gradient(135deg, #FF6B35, #DAA520);
    /* Saffron to Gold */
    color: white;
    border-radius: 25px;
    font-weight: bold;
    text-transform: capitalize;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(218, 165, 32, 0.3);
    transition: var(--transition);
    border: none;
}

.btn-service:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(218, 165, 32, 0.5);
    background: linear-gradient(135deg, #DAA520, #FF6B35);
    /* Reverse gradient */
    color: white;
}

/* Priest Card */
.priest-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.priest-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    border-top: 5px solid var(--secondary-color);
}

.priest-card:hover {
    transform: translateY(-10px);
}



/* Contact Section */
.contact-section {
    background: var(--gradient-dark);
    /* Deep Red/Saffron gradient */
    color: var(--white);
}

.contact-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 60px;
    background: rgba(255, 255, 255, 0.05);
    /* subtle overlay */
    padding: 50px;
    border-radius: 20px;
    border: 1px solid rgba(218, 165, 32, 0.2);
}

.contact-info,
.contact-actions {
    flex: 1;
    min-width: 320px;
}

.contact-info h2 {
    color: var(--accent-color);
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.contact-details li {
    font-size: 1.2rem;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.contact-details li strong {
    flex-shrink: 0;
    /* Prevent label from shrinking */
    min-width: 120px;
    /* Ensure consistent width for alignment */
}

.action-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.contact-actions h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
}

.btn-call {
    background: var(--primary-color);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
}

/* Footer (Simple update) */
.footer {
    background: #1a0f0d;
    color: #888;
    text-align: center;
    padding: 30px;
    font-size: 0.9rem;
    border-top: 5px solid var(--accent-color);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--gradient-dark);
        /* Dark gradient for visibility */
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
        /* Stronger shadow */
        text-align: center;
        border-bottom: 2px solid var(--accent-color);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li a {
        display: block;
        padding: 15px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .logo {
        font-size: 1.4rem;
        max-width: 70%;
        /* Ensure it doesn't overlap with burger menu */
    }


    .mobile-menu-btn {
        display: block;
    }

    /* Hero Responsive */
    .hero-container {
        grid-template-columns: 1fr;
        /* Stack vertically */
        text-align: center;
        padding-top: 20px;
    }

    .hero-content {
        text-align: center;
        /* Center align on mobile */
        order: 1;
        /* Image first, then text? Or text first? Let's keep HTML order */
    }

    /* Adjust floating buttons for mobile bottom bar feel if wanted, but side is fine */
    .floating-actions {
        right: 0;
        left: 0;
        /* Full width */
        bottom: 0;
        flex-direction: row;
        /* Horizontal row */
        justify-content: center;
        /* Center buttons */
        padding: 15px;
        /* Add padding for touch target */
        background: rgba(255, 255, 255, 0.9);
        /* Subtle background for readability */
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        z-index: 2000;
        gap: 20px;
    }

    .float-btn {
        flex: 1;
        /* Make button widths equal if desired, or auto */
        justify-content: center;
        max-width: 200px;
    }

    #back-to-top {
        bottom: 150px;
        /* Adjusted for mobile row height */
        right: 20px;
    }

    .hero-image-wrapper {
        display: none;
        /* Hide illustrative ritual image on very small screens to save space, OR keep it */
        /* display: block; */
    }

    .hero-section {
        height: auto;
        min-height: 65dvh;
        /* Override desktop 75dvh to reduce size */
        padding: 30px 0;
        /* Reduced padding (approx 0.75 of previous 40-50px feel) */
    }

    .section-header h2 {
        font-size: 2rem;
        /* Reduced from 2.2rem to fit better */
    }

    /* Fixed Hero Overflow */
    .hero-content h1 {
        font-size: 2.5rem;
        /* Reduced from 3.5rem default */
        word-wrap: break-word;
        /* Ensure long words break */
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    /* Fixed Contact Overflow */
    .contact-wrapper {
        padding: 30px 20px;
        /* Reduced padding */
        gap: 40px;
        flex-direction: column;
        /* Stack vertically */
    }

    .contact-info,
    .contact-actions {
        min-width: 100%;
        /* Changed from 320px to 100% to prevent overflow */
        flex: 1 1 100%;
    }

    .contact-actions {
        order: -1;
        /* Move 'Book a Puja' to top */
        text-align: center;
        /* Center align for better mobile look */
    }

    .contact-actions .action-buttons {
        justify-content: center;
    }

    /* Fixed Testimonials Card Visibility */
    .testimonial-card,
    .service-card {
        /* flex: 0 0 280px;  Removed fixed width */
        flex: 0 0 85vw;
        /* Use viewport width for better centering */
        max-width: 400px;
        /* Cap it for larger mobile screens */
    }

    .contact-details li {
        font-size: 1rem;
        /* Slightly smaller text */
        flex-wrap: wrap;
        /* Wrap content if needed */
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
        /* Tighter container padding on very small screens */
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .logo {
        font-size: 1.0rem;
        /* Even smaller for small screens to prevent wrapping */
    }
}



/* --- New Features Styles --- */

/* Scroll Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 180px;
    /* Moved up to avoid covering floating buttons */
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 1000;
}

#back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

#back-to-top:hover {
    transform: translateY(-5px);
    background: var(--primary-color);
    color: white;
}

/* --- Preloader --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.loader-content {
    text-align: center;
}

.loader-icon {
    width: 80px;
    height: auto;
    animation: pulse 1.5s infinite;
}

#preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* --- Trust Indicators --- */
.trust-section {
    background: var(--white);
    padding: 40px 0;
    border-bottom: 3px solid var(--accent-color);
}

.trust-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
    text-align: center;
}

.trust-item {
    flex: 1;
    min-width: 200px;
}

.trust-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.trust-item h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.trust-item p {
    font-size: 1.1rem;
    color: #555;
    font-weight: bold;
}

/* --- Animations --- */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.float-btn {
    animation: pulse 2s infinite;
    /* Gentle Attention Grabber */
}

/* Ensure pulse doesn't conflict with hover scale */
.float-btn:hover {
    animation: none;
    transform: scale(1.05);
    /* Existing hover */
}

/* Custom SVG Icons */
.custom-icon {
    width: 1em;
    height: 1em;
    fill: currentColor;
    /* Uses the color defined in parent .service-icon */
}

/* Service Icon Image */
.service-icon-img {
    width: 100%;
    height: auto;
    max-width: 3.5rem;
    filter: brightness(0) saturate(100%) invert(45%) sepia(95%) saturate(2076%) hue-rotate(346deg) brightness(101%) contrast(101%);
}

/* Service Icon Emoji */
.service-icon-emoji {
    font-size: 1em;
    line-height: 1;
    filter: grayscale(100%) brightness(0.8) sepia(100%) hue-rotate(330deg) saturate(500%);
}