@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700;900&display=swap');
:root {
    --primary: #D84315; /* Elegant Deep Saffron */
    --primary-light: #F4511E;
    --secondary: #FFFFFF;
    --accent: #F9A825; /* Refined Gold */
    --bg: #FDF9F1; /* Professional Light Warm Cream */
    --surface: #FFFDF8; /* Much warmer, softer surface instead of pure white */
    --text-main: #3E2723; /* Very dark brown, softer than black */
    --text-muted: #6D4C41;
    --border-light: rgba(216, 67, 21, 0.12);
}

* { 
    box-sizing: border-box; 
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #FDF8EF;
    background-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.015' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' fill='transparent'/%3E%3Crect width='400' height='400' filter='url(%23a)' opacity='0.06'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d84315' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Hierarchy */
h1, h2, h3, h4, .chalisa-text, .aarti-text, .logo {
    font-family: 'Merriweather', 'Georgia', serif;
}

h1 {
    color: var(--primary);
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
    position: relative;
    padding-top: 40px;
}
h1::before {
    content: 'ॐ';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    color: var(--accent);
    opacity: 0.8;
}

h2 {
    color: #b71c1c;
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}
h2::after {
    content: '🛕';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    background: #FFFDF8;
    padding: 0 10px;
}
h2::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #F9A825, transparent);
}

h3 {
    color: var(--text-main);
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-top: 0;
    margin-bottom: 1.25rem;
}

/* Header */
header {
    background: linear-gradient(135deg, #D84315 0%, #b71c1c 100%);
    color: #FFFFFF;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid #F9A825;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}
.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #FFFDF8;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
}

/* Language Selector */
select#lang-selector {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%24%2024%22%20fill%3D%22none%22%20stroke%3D%22%23FFFFFF%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 1rem;
}

select#lang-selector:hover, select#lang-selector:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}

select#lang-selector option {
    background-color: var(--surface);
    color: var(--text-main);
}

/* Main Content Container */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 1.25rem;
}

/* Featured Image */
.featured-image-container {
    width: 100%;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(216, 67, 21, 0.1);
}

.featured-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

/* Cards / Sections */
.content-section {
    background-color: #FFFDF8;
    background-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.015' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' fill='transparent'/%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    padding: 3.5rem 2.5rem;
    margin-bottom: 3.5rem;
    border-radius: 12px;
    border: 1px solid rgba(216, 67, 21, 0.15);
    box-shadow: 
        0 12px 35px rgba(127, 0, 0, 0.06),
        0 4px 10px rgba(0, 0, 0, 0.03);
    position: relative;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.content-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 12px 24px rgba(0, 0, 0, 0.04);
}

/* Devotional Text Area */
.chalisa-text, .aarti-text {
    font-size: 1.5rem;
    line-height: 2.4;
    text-align: center;
    white-space: pre-line;
    padding: 3rem 2rem;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23F9A825' fill-opacity='0.04' fill-rule='evenodd'/%3E%3C/svg%3E");
    border: 1px solid rgba(249, 168, 37, 0.4);
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(249, 168, 37, 0.1);
    color: #A33308;
    margin: 1.5rem 0;
    font-weight: 500;
    position: relative;
}
.chalisa-text::before, .chalisa-text::after, .aarti-text::before, .aarti-text::after {
    content: '❁';
    display: block;
    text-align: center;
    color: var(--accent);
    font-size: 2rem;
    opacity: 0.6;
}
.chalisa-text::before, .aarti-text::before {
    margin-bottom: 1rem;
}
.chalisa-text::after, .aarti-text::after {
    margin-top: 1rem;
}

/* FAQ Items */
.faq-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.faq-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.faq-item h3 {
    margin-top: 0;
}

.faq-item p {
    margin-bottom: 0;
}

/* AdSense Placeholders */
.adsense-placeholder {
    background-color: #F5F5F5;
    border: 1px solid #E0E0E0;
    color: #9E9E9E;
    text-align: center;
    padding: 2rem 1rem;
    margin: 2.5rem 0;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 4px;
}

/* Footer */
footer {
    background-color: #2D1B15; /* Very dark warm brown for a grounded feel */
    color: #D7CCC8;
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    margin-top: 4rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.footer-links a {
    color: #D7CCC8;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

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

.footer-copy {
    font-size: 0.85rem;
    opacity: 0.7;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    
    main {
        padding: 2rem 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .content-section {
        padding: 1.75rem 1.25rem;
    }

    .chalisa-text, .aarti-text {
        font-size: 1.2rem;
        padding: 2rem 1rem;
    }
}

/* Subtle Pulse for Main Heading */
@keyframes subtlePulse {
    0% { opacity: 0.95; }
    50% { opacity: 1; text-shadow: 0 0 20px rgba(216, 67, 21, 0.15); }
    100% { opacity: 0.95; }
}

/* Language Switch Smooth Transition */
body.lang-switching main {
    opacity: 1;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

body.lang-switched main {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* PDF Download Section */
.pdf-benefits {
    background: #fbf3e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.pdf-benefits ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}
.pdf-benefits li {
    margin-bottom: 8px;
    padding-left: 24px;
    position: relative;
}
.pdf-benefits li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}
.pdf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}
.primary-btn {
    background: var(--primary);
    color: white;
}
.primary-btn:hover {
    background: #bf360c;
}
.secondary-btn {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.secondary-btn:hover {
    background: #fbf3e6;
}

/* Print Styles for PDF Generation */
@media print {
    @page {
        size: A4;
        margin: 20mm 15mm;
    }
    
    body {
        background: white !important;
        color: black !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Hide UI elements not meant for PDF */
    header, footer, .pdf-actions, .adsense-placeholder, .pdf-benefits, #pdf-download p, #pdf-download h2,
    #intro, #benefits, #when-to-read, #how-many-times, #meaning, #faq, .featured-image-container {
        display: none !important;
    }

    main {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    article {
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
    }

    h1 {
        text-align: center;
        font-size: 32px !important;
        color: #d84315 !important;
        margin-bottom: 30px !important;
        border-bottom: 2px solid #d84315;
        padding-bottom: 10px;
    }

    #chalisa-content, #aarti {
        display: block !important;
    }

    #chalisa-content .chalisa-text, #aarti .aarti-text {
        font-size: 22px !important; /* Large readable font */
        line-height: 2 !important;
        color: #000 !important;
        text-align: center;
        white-space: pre-wrap;
    }

    h2[data-i18n="aarti_heading"] {
        text-align: center;
        font-size: 28px !important;
        color: #d84315 !important;
        margin-top: 40px !important;
        margin-bottom: 20px !important;
        page-break-before: always;
    }

    /* Print Footer for website name */
    body::after {
        content: "Downloaded from: " attr(data-website);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 12px;
        color: #666;
        padding-top: 10px;
        border-top: 1px solid #ddd;
    }
}

/* Hamburger Menu */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

.hamburger.open span:nth-child(1) {
    transform: rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0 !important;
}

.hamburger.open span:nth-child(3) {
    transform: rotate(-45deg);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 250px;
    height: 100vh;
    background: var(--primary);
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease-in-out;
    z-index: 99;
    padding-top: 80px;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    padding: 0 1.5rem;
}

.mobile-menu a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: color 0.2s;
}

.mobile-menu a:hover {
    color: #ffccbc;
}

.content-section::before {
    content: '';
    position: absolute;
    top: 10px; left: 10px; right: 10px; bottom: 10px;
    border: 1px solid rgba(216, 67, 21, 0.2);
    border-radius: 8px;
    /* Traditional manuscript corner accents */
    background: 
        linear-gradient(#F9A825, #F9A825) top left / 20px 3px no-repeat,
        linear-gradient(#F9A825, #F9A825) top left / 3px 20px no-repeat,
        linear-gradient(#F9A825, #F9A825) top right / 20px 3px no-repeat,
        linear-gradient(#F9A825, #F9A825) top right / 3px 20px no-repeat,
        linear-gradient(#F9A825, #F9A825) bottom left / 20px 3px no-repeat,
        linear-gradient(#F9A825, #F9A825) bottom left / 3px 20px no-repeat,
        linear-gradient(#F9A825, #F9A825) bottom right / 20px 3px no-repeat,
        linear-gradient(#F9A825, #F9A825) bottom right / 3px 20px no-repeat;
    pointer-events: none;
    z-index: 1;
}