if th/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fefefe;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 1.25rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

header .header-title {
    text-align: left;
    flex: 1;
    min-width: 0; /* Allow flex item to shrink below content size */
}

header h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    line-height: 1.2;
}

header h1 a {
    color: white;
    text-decoration: none;
}

header .subtitle {
    font-size: 1rem;
    margin-top: 0;
    opacity: 0.95;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
}

header .subtitle .separator {
    opacity: 0.6;
    margin: 0 0.3rem;
}

/* Om Icon Styling - purple rounded box with white Om symbol */
.om-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Header Controls Container */
.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0; /* Prevent controls from shrinking */
    margin-left: auto; /* Push to far right */
}

/* Screen reader only label */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.language-switcher,
.theme-switcher {
    position: relative;
}

.language-switcher select,
.theme-switcher select {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 6px 24px 6px 8px;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 5px center;
    background-size: 14px;
    transition: all 0.3s ease;
}

.language-switcher select:hover,
.theme-switcher select:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

.language-switcher select:focus,
.theme-switcher select:focus {
    outline: none;
    border-color: white;
    background: rgba(255, 255, 255, 0.3);
}

.language-switcher select option,
.theme-switcher select option {
    background: white;
    color: #333;
}

@media (max-width: 768px) {
    header .header-content {
        flex-direction: column;
        text-align: center;
    }

    header .header-title {
        text-align: center;
    }

    header .subtitle {
        justify-content: center;
    }

    .header-controls {
        order: -1;
        align-self: flex-end;
        flex-direction: column;
        gap: 8px;
        width: 100%;
        max-width: 200px;
    }

    .language-switcher,
    .theme-switcher {
        width: 100%;
    }

    .language-switcher select,
    .theme-switcher select {
        width: 100%;
    }
}

/* Main Content */
main {
    padding: 1.5rem 0;
    min-height: 60vh;
}

/* Hero Section */
.hero-section {
    margin-bottom: 0.5rem;
    text-align: center;
}

.hero-section h2 {
    color: #ff6b35;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.hero-section .blessing {
    margin: 0.5rem auto 0.5rem;
    max-width: 700px;
    font-size: 1em;
    color: #666;
}

.site-description {
    margin: 0.75rem auto 0.75rem;
    max-width: 640px;
    font-size: 0.97em;
    color: #555;
    line-height: 1.6;
}

.title-image-container {
    margin: 0 auto 0.25rem;
    max-width: 350px;
}

.title-page-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.verse-image-container {
    margin: 1.5rem auto;
    max-width: 600px;
}

.verse-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* About Section (Collapsible) */
.about-section {
    max-width: 700px;
    margin: 0.5rem auto;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.about-section summary {
    cursor: pointer;
    font-weight: 600;
    color: #ff6b35;
    padding: 0.5rem;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-section summary::-webkit-details-marker {
    display: none;
}

.about-section summary::before {
    content: "▶ ";
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.about-section[open] summary::before {
    transform: rotate(90deg);
}

.about-section summary:hover {
    color: #e55a2b;
}

.about-section p {
    margin: 1rem 0;
    text-align: left;
    line-height: 1.6;
}

/* Intro Section (Legacy) */
.intro {
    margin-bottom: 3rem;
    text-align: center;
}

.intro h2 {
    color: #ff6b35;
    margin-bottom: 1rem;
}

.intro p {
    margin: 1rem auto;
    max-width: 700px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

/* Inline theme switcher */
.theme-switcher-inline {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: white;
    border: 2px solid #ff6b35;
    border-radius: 8px;
}

.theme-switcher-inline label {
    margin: 0;
    font-size: 1.1rem;
}

.theme-switcher-inline select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Collection metadata row */
.collection-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 0.5rem 0;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.about-section-compact {
    padding: 4px 12px;
    background: transparent;
    border: none;
    margin: 0;
}

.about-section-compact summary {
    cursor: pointer;
    color: #666;
    padding: 0;
    font-weight: normal;
    font-size: 0.9rem;
    display: inline;
}

.about-section-compact summary:hover {
    color: #ff6b35;
}

.about-section-compact p {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.puranic-legend-compact {
    color: #666;
    font-size: 0.85rem;
    padding: 4px 8px;
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
    background: white;
    color: #ff6b35;
    border: 2px solid #ff6b35;
}

.btn-secondary:hover {
    background: #fff5f0;
    transform: translateY(-2px);
}

/* Verse Navigation */
.verse-navigation {
    margin: 1.5rem 0;
}

.verse-navigation h3 {
    color: #ff6b35;
    margin: 2.5rem 0 1.5rem;
    font-size: 1.8rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.verse-navigation h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff6b35, transparent);
}

.verse-navigation h3:first-of-type {
    margin-top: 0.5rem;
}

/* Doha lists - larger, special styling */
.verse-navigation > ul:nth-of-type(1),
.verse-navigation > ul:last-of-type {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.verse-navigation > ul:nth-of-type(1) li a,
.verse-navigation > ul:last-of-type li a {
    display: block;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff8f5 0%, #fff 100%);
    border: 2px solid #ff6b35;
    border-radius: 8px;
    text-decoration: none;
    color: #ff6b35;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.1);
}

.verse-navigation > ul:nth-of-type(1) li a:hover,
.verse-navigation > ul:last-of-type li a:hover {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* Main verse list */
.verse-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.verse-list li {
    position: relative;
}

.verse-list li a {
    display: block;
    padding: 1rem 1.25rem;
    background: white;
    border: 1px solid #dee2e6;
    border-left: 4px solid #ff6b35;
    border-radius: 4px;
    text-decoration: none;
    color: #495057;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.verse-list li a:hover {
    background: #ff6b35;
    color: white;
    border-color: #e55a2b;
    transform: translateX(4px);
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.2);
}

/* Verse number badge */
.verse-list li a:before {
    content: attr(data-verse);
    display: inline-block;
    background: #ff6b35;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-right: 0.5rem;
}

.verse-list li a:hover:before {
    background: white;
    color: #ff6b35;
}

/* Verse Container */
.verse-container {
    max-width: 800px;
    margin: 0 auto;
}

.verse-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid #dee2e6;
}

.verse-nav.bottom {
    margin-top: 3rem;
    margin-bottom: 0;
    border-top: 2px solid #dee2e6;
    border-bottom: none;
    padding-top: 2rem;
}

.nav-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #ff6b35;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-button:hover {
    background: #e55a2b;
}

.nav-button.disabled {
    background: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

.nav-button.home {
    background: #6c757d;
}

.nav-button.home:hover {
    background: #5a6268;
}

/* Collection Badge */
.collection-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #fff8f5 0%, #fff 100%);
    border: 2px solid #ff6b35;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.1);
}

.collection-badge .collection-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.collection-badge .collection-name {
    color: #ff6b35;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.collection-badge .collection-name:hover {
    color: #e55a2b;
    text-decoration: underline;
}

/* Verse Content */
.verse-content h1 {
    color: #ff6b35;
    margin-bottom: 2rem;
    text-align: center;
}

.verse-content h2 {
    color: #495057;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
}

.verse-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Broken image placeholder styling */
.verse-content img[alt]::after {
    display: block;
    content: attr(alt);
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

/* Hide broken image icon but show alt text */
.verse-content img[alt] {
    position: relative;
    min-height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
    color: #6c757d;
    text-align: center;
    padding: 3rem 2rem;
}

.verse-content pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 1.1rem;
    line-height: 1.8;
}

.verse-content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.verse-content li {
    margin: 0.5rem 0;
}

.verse-content strong {
    color: #ff6b35;
}

/* Verse Sections */
.verse-section {
    margin: 3rem 0;
}

.verse-section:first-of-type {
    margin-top: 2rem;
}

.section-header {
    font-size: 1.5rem;
    color: #ff6b35;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #ffe5dc;
    font-weight: 600;
}

/* Verse Grid Cards */
.verse-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin: 2rem 0;
    justify-items: center;
}

/* Center-align doha sections with fewer cards */
.verse-navigation h3:first-of-type + .verse-grid,
.verse-navigation h3:last-of-type + .verse-grid {
    justify-content: center;
    grid-template-columns: repeat(3, 1fr);
}

.verse-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.verse-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
    border-color: #ff6b35;
}

.card-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.3s ease;
}

.verse-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 1rem;
    text-align: center;
}

.verse-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ff6b35;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.verse-title {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #495057;
    font-weight: 500;
}

.verse-card:hover .verse-title {
    color: #ff6b35;
}

/* Responsive adjustments for verse grid */
@media (max-width: 1200px) {
    .verse-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .verse-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .card-content {
        padding: 0.75rem;
    }

    .verse-number {
        font-size: 0.75rem;
    }

    .verse-title {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .verse-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Resources Section */
.resources {
    margin: 3rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.resources h3 {
    color: #ff6b35;
    margin-bottom: 1rem;
}

.resources ul {
    list-style: none;
}

.resources li {
    margin: 0.5rem 0;
}

.resources a {
    color: #495057;
    text-decoration: none;
    transition: color 0.2s;
}

.resources a:hover {
    color: #ff6b35;
}

/* Footer */
footer {
    background: #f8f9fa;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid #dee2e6;
}

footer .footer-links {
    margin-top: 1rem;
    font-size: 0.9rem;
}

footer .footer-links a {
    color: #495057;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.2s;
}

footer .footer-links a:hover {
    color: #ff6b35;
}

/* Audio Player Styles */
.audio-player-container {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fff5e6 0%, #ffe0b3 100%);
    border-radius: 8px;
    border-left: 4px solid #ff6b35;
}

.audio-players {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.audio-player {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.audio-player label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.audio-player audio {
    width: 100%;
    max-width: 500px;
    height: 40px;
    border-radius: 4px;
    outline: none;
}

.audio-player audio:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .verse-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-button {
        flex: 1 1 auto;
        text-align: center;
        min-width: 100px;
    }

    .verse-list {
        grid-template-columns: 1fr;
    }
}

/* Multi-Collection Styles */
.collections-section {
    margin: 3rem 0;
}

.collections-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #ff6b35;
}

.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.collection-card {
    display: flex;
    flex-direction: column;
    background: white;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid #ff6b35;
    border-radius: 12px;
    padding: 0;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    min-height: 250px;
}

.collection-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.2);
    border-color: #f7931e;
}

.collection-card-overlay {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0.6) 40%,
        rgba(255, 255, 255, 0.9) 100%);
    height: 100%;
}

.collection-card-overlay .collection-header,
.collection-card-overlay .collection-description,
.collection-card-overlay .collection-footer {
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9),
                 0 0 10px rgba(255, 255, 255, 0.8);
}

.collection-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.collection-icon {
    font-size: 3rem;
    line-height: 1;
}

.collection-title h3 {
    font-size: 1.5rem;
    margin: 0 0 0.25rem 0;
    color: #ff6b35;
}

.collection-author {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    font-style: italic;
}

.collection-description {
    flex: 1;
    color: #555;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.collection-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
}

.verse-count {
    color: #666;
    font-weight: 500;
}

.collection-link {
    color: #ff6b35;
    font-weight: 600;
}

@media (max-width: 768px) {
    .collections-grid {
        grid-template-columns: 1fr;
    }

    .collection-icon {
        font-size: 2.5rem;
    }
}

/* Collection Landing Page Banner */
.collection-banner {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(247, 147, 30, 0.1) 100%);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.collection-icon-large {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.collection-banner h1 {
    font-size: 2.5rem;
    color: #ff6b35;
    margin-bottom: 0.5rem;
}

.collection-author-large {
    font-size: 1.2rem;
    color: #666;
    font-style: italic;
    margin-bottom: 1rem;
}

.collection-description-large {
    font-size: 1.1rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .collection-icon-large {
        font-size: 3rem;
    }

    .collection-banner h1 {
        font-size: 2rem;
    }

    .collection-author-large {
        font-size: 1rem;
    }

    .collection-description-large {
        font-size: 1rem;
    }
}

/* Theme Showcase */
.theme-showcase {
    margin: 2rem 0;
}

.theme-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.theme-preview {
    text-align: center;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.theme-preview:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.theme-thumbnail {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.theme-preview h4 {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    color: #ff6b35;
}

.theme-description {
    font-size: 0.9rem;
    color: #666;
    margin: 0.5rem 0;
}

.theme-note {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fff3e0;
    border-left: 4px solid #ff6b35;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Verse page theme switcher */
.verse-theme-switcher {
    text-align: center;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: 8px;
}

.verse-theme-switcher label {
    margin-right: 0.5rem;
    font-weight: 500;
}

.verse-theme-switcher select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

/* ============================================================
   PURANIC CONTEXT BOXES
   ============================================================ */

.puranic-context-section {
    margin: 3rem 0 2rem 0;
    max-width: 100%;
    width: 100%;
}

.puranic-context-heading {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #ff6b35;
}

/* Puranic Sources Legend */
.puranic-sources-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: #666;
}

.legend-label {
    font-weight: 600;
    color: #888;
}

.legend-badge {
    background: #fff8f0;
    border: 1px solid #f0c090;
    border-radius: 20px;
    padding: 0.2rem 0.75rem;
    color: #b36a00;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Container for better content width control */
.verse-container .puranic-context-section {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* Grid Layout for Context Boxes - ALWAYS single column for now */
.puranic-context-grid {
    display: block;
    margin-bottom: 1.5rem;
}

.puranic-context-grid .puranic-context-box {
    margin-bottom: 1.5rem;
}

.puranic-context-grid .puranic-context-box:last-child {
    margin-bottom: 0;
}

/* Reasonable width on larger screens */
@media (min-width: 768px) {
    .puranic-context-grid {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Base Context Box Styling */
.puranic-context-box {
    border: 2px solid;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 0; /* Prevent grid blowout */
}

@media (min-width: 1024px) {
    .puranic-context-box {
        padding: 1.5rem;
    }
}

.puranic-context-box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Context Box Color */
.puranic-context-box {
    border-color: #ff6b35;
    background-color: #fff8f0;
}

[data-theme="dark"] .puranic-context-box {
    border-color: #ffa366;
    background-color: #2d1810;
}

/* Decorative Corner */
.puranic-context-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    opacity: 0.1;
    border-radius: 0 0 0 100%;
    pointer-events: none;
}

.puranic-context-box::before {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
}

/* Box Header */
.context-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.context-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.context-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.context-title {
    color: #ff6b35;
}

[data-theme="dark"] .context-title {
    color: #ffa366;
}

/* Section Styling */
.context-section {
    margin-bottom: 0.75rem;
}

.context-section:last-child {
    margin-bottom: 0;
}

.context-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.context-section-label {
    color: #f7931e;
}

[data-theme="dark"] .context-section-label {
    color: #ffa366;
}

.section-icon {
    font-size: 0.9rem;
}

.context-section-content {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: none;
}

[data-theme="dark"] .context-section-content {
    color: #e5e5e5;
}

/* Better text flow for paragraph-style content */
.context-section-content p {
    margin: 0 0 0.5rem 0;
    text-align: left;
    white-space: normal;
}

.context-section-content p:last-child {
    margin-bottom: 0;
}

/* Remove extra spacing from divs inside content */
.context-section-content > div {
    margin: 0;
}

/* Bilingual Layout - Keep stacked by default */
.context-bilingual {
    display: block;
}

.context-bilingual > div {
    margin-bottom: 0.75rem;
}

.context-bilingual > div:last-child {
    margin-bottom: 0;
}

/* Only use side-by-side layout on extra wide screens */
@media (min-width: 1600px) {
    .context-bilingual {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .context-bilingual > div {
        margin-bottom: 0;
    }
}

/* Etymology Specific Styles */
.word-breakdown {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    margin-top: 0.5rem;
}

[data-theme="dark"] .word-breakdown {
    background: rgba(255, 255, 255, 0.05);
}

.original-word {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.75rem;
    color: #ff6b35;
}

[data-theme="dark"] .original-word {
    color: #ffa366;
}

.word-components {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.component {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

[data-theme="dark"] .component {
    background: rgba(0, 0, 0, 0.2);
}

/* Lists */
.alternative-names-list,
.key-terms-list,
.related-texts-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.alternative-names-list li,
.key-terms-list li,
.related-texts-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.alternative-names-list li:last-child,
.key-terms-list li:last-child,
.related-texts-list li:last-child {
    border-bottom: none;
}

[data-theme="dark"] .alternative-names-list li,
[data-theme="dark"] .key-terms-list li,
[data-theme="dark"] .related-texts-list li {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.name-context,
.text-relevance {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

[data-theme="dark"] .name-context,
[data-theme="dark"] .text-relevance {
    color: #aaa;
}

/* Meta Information */
.context-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.8rem;
    color: #666;
}

[data-theme="dark"] .context-meta {
    border-top-color: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.meta-item {
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem;
}

.meta-item:last-child {
    margin-bottom: 0;
}

.meta-icon {
    font-size: 0.85rem;
}

/* Related Verse Chips */
.context-related-verses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.verse-chip {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #ff6b35;
    color: white;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s ease, transform 0.2s ease;
}

.verse-chip:hover {
    background: #f7931e;
    transform: scale(1.05);
}


/* Expandable Contexts */
.puranic-context-expandable {
    margin-bottom: 1.5rem;
}

.puranic-expand-toggle {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 107, 53, 0.06);
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: #ff6b35;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.puranic-expand-toggle:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: #ff6b35;
}

[data-theme="dark"] .puranic-expand-toggle {
    background: rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 163, 102, 0.4);
    color: #ffa366;
}

.expand-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.puranic-expand-toggle[aria-expanded="true"] .expand-icon {
    transform: rotate(90deg);
}

.context-collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.3s ease, margin-top 0.3s ease;
    margin-top: 0;
}

.context-expanded {
    max-height: 5000px;
    opacity: 1;
    margin-top: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .puranic-context-box {
        padding: 1rem;
    }

    .context-title {
        font-size: 1rem;
    }

    .context-section-content {
        font-size: 0.9rem;
    }

    .context-icon {
        font-size: 1.5rem;
    }

    .puranic-context-heading {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .puranic-context-box {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #666;
        box-shadow: none;
    }

    .context-collapsed {
        max-height: none !important;
        opacity: 1 !important;
    }

    .puranic-expand-toggle {
        display: none;
    }

    .verse-chip {
        background: #ddd;
        color: #000;
    }
}

/* Coming Soon Section */
.coming-soon-section {
    margin: 3rem 0;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
    border-radius: 12px;
    border: 2px dashed rgba(139, 92, 246, 0.2);
}

.coming-soon-section h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #8b5cf6;
}

.coming-soon-section .section-subtitle {
    text-align: center;
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
    font-style: italic;
}

.coming-soon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.coming-soon-card {
    background: white;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.coming-soon-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-radius: 0 0 0 100%;
}

.coming-soon-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.15);
    border-color: #8b5cf6;
}

.coming-soon-card .collection-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.85;
}

.coming-soon-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #8b5cf6;
}

.coming-soon-card .coming-soon-author {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
    margin-bottom: 0.75rem;
}

.coming-soon-card .coming-soon-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .coming-soon-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .coming-soon-section {
        padding: 1.5rem 1rem;
    }

    .coming-soon-section h2 {
        font-size: 1.5rem;
    }

    .coming-soon-card .collection-icon {
        font-size: 2rem;
    }
}

/* Puranic Context Legend and Badges */
.puranic-legend {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
    border: 2px solid #ff6b35;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.15);
}

.puranic-legend .legend-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.puranic-legend span[data-lang] {
    font-size: 0.95rem;
    color: #663300;
    font-weight: 500;
}

/* Badge on verse cards */
.verse-card {
    position: relative;
}

.puranic-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

.puranic-badge .badge-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.verse-card.has-puranic-context {
    border-color: #ff6b35;
}

.verse-card.has-puranic-context:hover {
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .puranic-legend {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        gap: 0.5rem;
    }

    .puranic-legend span[data-lang] {
        font-size: 0.875rem;
    }

    .puranic-badge {
        padding: 0.3rem 0.5rem;
    }

    .puranic-badge .badge-icon {
        font-size: 1rem;
    }
}
