:root {
    --bg-dark: #0a0a0f;
    --text-main: #f0f0f5;
    --text-muted: #a0a0b0;
    --accent: #f0a500;
    --accent-glow: rgba(240, 165, 0, 0.4);
    --glass-bg: rgba(20, 20, 30, 0.5);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4 {
    letter-spacing: -0.02em;
    font-weight: 600;
}

/* Glass Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.nav-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    justify-self: start;
    width: 220px;
    /* Fixed width to contain the wide logo */
    height: 60px;
    /* Fixed height for the navbar */
    overflow: hidden;
    /* This crops out the empty vertical space in the image */
    position: relative;
}

.logo img {
    height: 240px;
    /* Scale up to fill the 60px height with just the middle part */
    width: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Center the zoomed image */
    filter: drop-shadow(0 0 15px rgba(240, 165, 0, 0.4));
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: translate(-50%, -50%) scale(1.05);
    /* Subtle hover zoom */
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-separator {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.nav-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(to right, #ffffff, #ffe0b2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-title-separator {
    width: 40px;
    height: 2px;
    background: var(--accent);
    margin: 4px 0;
    border-radius: 2px;
    box-shadow: 0 0 8px var(--accent-glow);
}

.nav-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.5px;
}

@media (max-width: 900px) {
    .nav-brand-text {
        display: none;
    }

    .nav-content {
        grid-template-columns: 1fr 1fr;
    }
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    justify-self: end;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 400;
    font-size: 1rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Page Header */
/* Page Layout Reset */
.main-content {
    padding-top: 100px;
    /* Increased to account for larger 60px logo + padding */
}

/* Remove legacy page header styles */
.page-header,
.page-title,
.page-subtitle {
    display: none;
}

/* Main Content */
.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.section-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.accent-line {
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 0 auto;
    border-radius: 2px;
}

/* Theme Filter Bar */
.theme-filter-container {
    max-width: 1200px;
    margin: 0 auto 3rem;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    position: sticky;
    top: 80px;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.filter-pill {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: var(--accent);
    color: var(--text-main);
    transform: translateY(-2px);
}

.filter-pill.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Stories Grid */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    transition: all 0.5s ease;
}

.story-card.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.95);
}

.story-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.story-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.card-image-wrapper {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.story-card:hover .card-image-wrapper img {
    transform: scale(1.08);
}

.card-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-indicator {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
}

.placeholder-gradient-1 {
    background: linear-gradient(135deg, #2b1055, #7597de);
}

.placeholder-gradient-2 {
    background: linear-gradient(135deg, #141e30, #243b55);
}

.card-content {
    padding: 1.5rem;
}

.tag {
    display: inline-block;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.card-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

.read-more {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--accent);
}

.arrow {
    transition: transform 0.3s ease;
}

.read-more:hover .arrow {
    transform: translateX(5px);
}

/* Glass Section (About) */
.glass-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 3rem 2rem;
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.about-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
}

/* Ad Container */
.ad-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
}

.ad-wrapper {
    width: 100%;
    max-width: 900px;
    background: var(--glass-bg);
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    position: relative;
    min-height: 120px;
}

.ad-label {
    position: absolute;
    top: -10px;
    left: 1rem;
    background: var(--bg-dark);
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.delay-1 {
    transition-delay: 0.2s;
}

.delay-2 {
    transition-delay: 0.4s;
}

/* --- Kindle Modal Styling --- */
.kindle-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.kindle-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.kindle-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.kindle-modal-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    background-color: #fbf8f1;
    /* Warm sepia-like Kindle tone */
    color: #2c2c2c;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

@media (min-width: 768px) {
    .kindle-modal-container {
        height: 90vh;
        border-radius: 12px;
        overflow: hidden;
    }
}

.kindle-modal-container.is-fullscreen {
    max-width: none !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.kindle-modal.is-open .kindle-modal-container {
    transform: translateY(0);
}

.kindle-topbar {
    padding: 1rem 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-bottom: 1px solid #e2ddce;
    flex-shrink: 0;
    background: #f4efdf;
}

.kindle-btn {
    background: transparent;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.kindle-btn:hover {
    color: #000;
}

.kindle-scroll-area {
    overflow-y: auto;
    flex-grow: 1;
    padding: 3rem 2rem 5rem;
}

.kindle-content {
    max-width: 600px;
    margin: 0 auto;
}

.kindle-header {
    text-align: center;
    margin-bottom: 3rem;
}

.kindle-tag {
    display: inline-block;
    color: #d35400;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 1rem;
    font-family: 'Outfit', sans-serif;
}

.kindle-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    color: #111;
    line-height: 1.2;
}

.kindle-body {
    font-family: 'Lora', serif;
    font-size: 1.25rem;
    line-height: 1.8;
    color: #333;
}

.kindle-body p {
    margin-bottom: 1.5rem;
}

.kindle-body h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    margin: 3rem 0 1rem;
    color: #111;
}

.kindle-body .dropcap {
    float: left;
    font-family: 'Outfit', sans-serif;
    font-size: 4rem;
    line-height: 0.8;
    font-weight: 800;
    color: #111;
    margin: 0.2rem 0.5rem 0 0;
}

/* Modifiers */
.pt-0 {
    padding-top: 0 !important;
}

.story-card {
    cursor: pointer;
}

.story-card button.read-more {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h2 {
        font-size: 2.8rem;
    }

    .nav-links {
        display: none;
    }

    .glass-section {
        padding: 3rem 1.5rem;
    }
}

/* --- Audio Features --- */
.audio-btn {
    margin-right: 1.5rem;
    color: #e67e22;
    background: transparent;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.audio-btn:hover {
    color: #000;
}

.audio-speed {
    color: var(--text-muted);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    margin-right: 1.5rem;
    transition: color 0.2s, border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    text-align: center;
}

.audio-speed:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.audio-speed:focus {
    outline: none;
}

.audio-speed option {
    background: var(--surface-light);
    color: var(--text-light);
}

.audio-btn.playing {
    animation: pulse 2s infinite;
    color: #c0392b;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Karaoke Reading Mode */
.kindle-body.reading-mode {
    padding-bottom: 2rem;
}

.kindle-body.reading-mode>p,
.kindle-body.reading-mode>h3 {
    opacity: 0.3;
    transition: opacity 0.5s ease, transform 0.5s ease, color 0.5s ease;
}

.kindle-body.reading-mode>*.reading-active {
    opacity: 1;
    transform: scale(1.02);
    transform-origin: left center;
    color: #000;
}

/* ==========================================
   Language Switcher Styles
   ========================================== */

/* Hide by default using important to combat other display rules */
.lang-hi,
.lang-hi-rom {
    display: none !important;
}

/* Base states */
.lang-en {
    display: inline !important;
}

div.lang-en,
p.lang-en,
h3.lang-en {
    display: block !important;
}

/* English Active */
body.lang-en-active .lang-hi,
body.lang-en-active .lang-hi-rom {
    display: none !important;
}

body.lang-en-active .lang-en {
    display: inline !important;
}

body.lang-en-active div.lang-en,
body.lang-en-active p.lang-en,
body.lang-en-active h3.lang-en {
    display: block !important;
}

/* Hindi Devanagari Active */
body.lang-hi-active .lang-en,
body.lang-hi-active .lang-hi-rom {
    display: none !important;
}

body.lang-hi-active .lang-hi {
    display: inline !important;
}

body.lang-hi-active div.lang-hi,
body.lang-hi-active p.lang-hi,
body.lang-hi-active h3.lang-hi {
    display: block !important;
}

/* Hindi Romanized Active */
body.lang-hi-rom-active .lang-en,
body.lang-hi-rom-active .lang-hi {
    display: none !important;
}

body.lang-hi-rom-active .lang-hi-rom {
    display: inline !important;
}

body.lang-hi-rom-active div.lang-hi-rom,
body.lang-hi-rom-active p.lang-hi-rom,
body.lang-hi-rom-active h3.lang-hi-rom {
    display: block !important;
}

/* Language Select Dropdown Styling */
.lang-select {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.lang-select:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

.lang-select option {
    background: #ffffff;
    color: #333333;
    font-weight: 400;
    padding: 10px;
}