html, body {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}
body {
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
/* Custom scrollbar for better aesthetics */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1; /* Tailwind gray-300 */
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; /* Tailwind gray-400 */
}
/* Tooltip styles */
.tooltip {
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    z-index: 1000;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
    transform: translateY(5px);
}
.tooltip.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.highlighted-term {
    background-color: #bfdbfe; /* Tailwind blue-200 */
    cursor: help;
    border-bottom: 1px dashed #60a5fa; /* Tailwind blue-400 */
    padding: 1px 2px;
    border-radius: 3px;
}
.highlighted-term:hover {
    background-color: #93c5fd; /* Tailwind blue-300 */
}
/* D3 Treemap specific styles */
.treemap-node rect {
    stroke: #fff;
    transition: stroke 0.2s ease-in-out;
}
.treemap-node.selected-category rect {
    stroke: #3730a3; /* Darker indigo for selected border */
    stroke-width: 3px;
}
.treemap-node text {
    font-size: 0.75rem; /* text-xs */
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3); /* Add text shadow for readability */
    pointer-events: none; /* Prevent text from blocking mouse events on rect */
    fill: white; /* Default text color for treemap */
}
/* Loading spinner */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #6366f1;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Accordion specific styles (now for analysis cards) */
.analysis-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.125rem;
    color: #3730a3;
    margin-bottom: 0.75rem;
}
/* Removed .analysis-card-content.open as it's now handled by main analysis card */
.analysis-card-header .arrow-icon {
    transition: transform 0.3s ease;
}
.analysis-card-header.active .arrow-icon {
    transform: rotate(90deg);
}
/* Responsive table cell styling for wrapping text */
.table-cell-wrap {
    white-space: normal;
}

/* Sidebar specific styles */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    transition: left 0.3s ease-in-out;
    z-index: 55; /* Lower than fixed-top-bar (60) but higher than backdrop (50) */
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto; /* Enable scrolling for sidebar content */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}
.sidebar.open {
    left: 0;
}
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 50; /* Lower than sidebar */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}
.sidebar-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* Main content area styling */
.main-content-area {
    flex-grow: 1;
    padding: 1.5rem; /* Default padding */
}
@media (min-width: 768px) {
    .main-content-area {
        padding: 2.5rem; /* Larger padding on desktop */
    }
}


/* Search input field animation */
.search-input-field {
    width: 0;
    opacity: 0;
    padding: 0; /* Remove padding when closed */
    border: none; /* Remove border when closed */
    transition: width 0.3s ease-in-out, opacity 0.3s ease-in-out, padding 0.3s ease-in-out, border 0.3s ease-in-out;
}
.search-input-field.open {
    width: 250px; /* Desired width when open */
    opacity: 1;
    padding: 0.5rem 1rem; /* Add padding when open */
    border: 1px solid #d1d5db; /* Add border when open */
}
@media (max-width: 768px) {
    .search-input-field.open {
        width: 180px; /* Smaller width on mobile */
    }
}

/* Card styles for Psalms and Glossary */
.card {
    background-color: #fff;
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* shadow-md with a bit more depth */
    padding: 1.5rem; /* p-6 */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); /* shadow-lg on hover */
}
.card-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600; /* font-semibold */
    color: #3730a3; /* text-indigo-800 */
    margin-bottom: 0.75rem; /* mb-3 */
}
.card-text {
    font-size: 0.95rem; /* text-base */
    color: #4b5563; /* text-gray-700 */
    line-height: 1.5;
    flex-grow: 1; /* Allow text to take available space */
}
.card-footer {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Detail Card for Psalm Detail Page Sections */
.detail-card {
    background-color: #fff;
    border-radius: 1.5rem; /* More rounded */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); /* Deeper shadow */
    padding: 2.5rem; /* More padding */
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}
.detail-card:hover {
    transform: translateY(-5px); /* Slight lift on hover */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}


/* Verse explanation styles */
.verse-explanation-container {
    background-color: #eef2ff; /* Tailwind indigo-50 */
    border-left: 4px solid #a5b4fc; /* Tailwind indigo-300 */
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    display: none; /* Hidden by default */
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}
.verse-explanation-container.open {
    display: block;
    max-height: 500px; /* Arbitrary large enough value */
    opacity: 1;
}
.verse-explanation-text {
    color: #3730a3; /* Tailwind indigo-800 */
    font-size: 0.9rem;
    line-height: 1.4;
}
.verse-explanation-error {
    color: #dc2626; /* Tailwind red-600 */
    font-size: 0.85rem;
}
.verse-explanation-button {
    background-color: #3b82f6; /* Tailwind blue-500 */
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 0.375rem; /* rounded-md */
    font-size: 0.75rem; /* text-xs */
    font-weight: 500;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    margin-left: 0.5rem;
    display: inline-flex;
    align-items: center;
}
.verse-explanation-button:hover {
    background-color: #2563eb; /* Tailwind blue-600 */
    transform: translateY(-1px);
}
.verse-explanation-button:disabled {
    background-color: #93c5fd; /* Tailwind blue-300 */
    cursor: not-allowed;
}
.verse-explanation-button .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    animation: spin 1s linear infinite;
    margin-right: 0.25rem;
}

/* Home Page specific styles */
.home-card {
    background-color: #fff;
    border-radius: 1.5rem; /* More rounded */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); /* Deeper shadow */
    padding: 4rem; /* More padding */
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    max-width: 600px; /* Max width for the card */
    width: 100%; /* Responsive width */
}
.home-card:hover {
    transform: translateY(-10px) scale(1.02); /* More pronounced hover */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}
.home-card-icon {
    font-size: 4rem; /* Large icon */
    color: #6366f1; /* Indigo color */
    margin-bottom: 1.5rem;
}
.home-card-title {
    font-size: 2.5rem; /* Larger title */
    font-weight: 700; /* Bolder */
    color: #3730a3;
    margin-bottom: 1rem;
}
.home-card-description {
    font-size: 1.125rem; /* Larger text */
    color: #4b5563;
    line-height: 1.6;
}

/* New: Current Verse Highlight */
.verse-paragraph {
    /* Base styles for all verse paragraphs */
    transition: background-color 0.3s ease, border-left-color 0.3s ease, padding-left 0.3s ease;
    border-radius: 0.25rem; /* rounded-sm */
    padding-left: 0; /* Default padding */
}
.verse-paragraph.current-verse {
    background-color: #e0f2fe; /* Light blue background */
    border-left: 4px solid #3b82f6; /* Blue border */
    padding-left: 10px; /* Add some padding for the border */
}

/* Styles for Category Constellation Graph */
.category-constellation-container {
    width: 100%;
    height: 400px; /* Adjusted height */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    background-color: #f8fafc; /* Light background for the chart area */
    border-radius: 1rem;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden; /* Hide overflow from simulation */
}
.constellation-link {
    stroke: #94a3b8; /* Tailwind gray-400 */
    stroke-opacity: 0.6;
    stroke-width: 1px;
}
.constellation-node circle {
    stroke: #fff;
    stroke-width: 2px;
    cursor: pointer;
    transition: stroke 0.2s ease-in-out, transform 0.2s ease-in-out, stroke-width 0.2s ease-in-out;
}
.constellation-node circle:hover {
    stroke: #6366f1; /* Indigo border on hover */
    transform: scale(1.05);
}
/* New: Highlighted node style */
.constellation-node.highlighted-constellation-node circle {
    stroke: #3730a3; /* Darker indigo for selected border */
    stroke-width: 4px; /* Thicker border */
    transform: scale(1.1); /* Slightly larger */
    box-shadow: 0 0 15px rgba(55, 48, 163, 0.5); /* Glow effect */
}
.constellation-node text {
    font-size: 0.8rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3); /* Add text shadow for readability */
    pointer-events: none; /* Prevent text from blocking mouse events on rect */
    fill: white; /* Default text color for treemap */
}
/* Glossary Alphabet Filter Buttons */
.alphabet-filter-button {
    background-color: #e0e7ff; /* Light indigo */
    color: #3730a3; /* Dark indigo */
    padding: 0.4rem 0.7rem;
    border-radius: 0.3rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap; /* Prevent wrapping */
    min-width: 35px; /* Ensure consistent width */
    text-align: center;
}
.alphabet-filter-button:hover {
    background-color: #c7d2fe; /* Lighter indigo on hover */
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.alphabet-filter-button.active {
    background-color: #6366f1; /* Active indigo */
    color: white;
    border-color: #4f46e5;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}
.alphabet-filter-button.active:hover {
    background-color: #4f46e5;
}

/* Glossary Search Bar Responsive Styles */
.glossary-search-container {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative; /* For the search input positioning */
}
.glossary-search-input-desktop {
    flex-grow: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: width 0.3s ease-in-out, opacity 0.3s ease-in-out, padding 0.3s ease-in-out, border 0.3s ease-in-out;
}

/* Mobile specific styles for glossary search */
@media (max-width: 767px) {
    .glossary-search-input-desktop {
        position: absolute; /* Position absolutely to allow icon to stay in place */
        right: 0;
        width: 0;
        opacity: 0;
        padding: 0;
        border: none;
        pointer-events: none; /* Disable interaction when hidden */
    }
    .glossary-search-input-desktop.open-mobile {
        width: calc(100% - 48px); /* Full width minus icon button width */
        opacity: 1;
        padding: 0.5rem 1rem;
        border: 1px solid #d1d5db;
        pointer-events: auto; /* Enable interaction when open */
    }
    .glossary-search-icon-button-mobile {
        display: block; /* Show icon on mobile */
        margin-left: auto; /* Push to the right */
    }
}

/* Desktop specific styles for glossary search */
@media (min-width: 768px) {
    .glossary-search-input-desktop {
        width: 100%; /* Always full width on desktop */
        opacity: 1;
        padding: 0.5rem 1rem;
        border: 1px solid #d1d5db;
        pointer-events: auto;
    }
    .glossary-search-icon-button-mobile {
        display: none; /* Hide icon on desktop */
    }
}

/* Fixed Header Bar */
.fixed-header-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white */
    backdrop-filter: blur(5px); /* Frosted glass effect */
    -webkit-backdrop-filter: blur(5px); /* For Safari */
    z-index: 60; /* Higher than sidebar */
    padding: 0.75rem 1.5rem; /* py-3 px-6 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom-left-radius: 0.75rem; /* rounded-xl */
    border-bottom-right-radius: 0.75rem; /* rounded-xl */
}

/* Adjust main content padding to account for fixed header */
main {
    padding-top: 5rem; /* Adjusted padding-top */
}

/* Glossary Filter Box */
.glossary-filter-content {
    /* Default hidden state for the dropdown */
    visibility: hidden; /* Use visibility instead of display for transitions */
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    padding: 0; /* No padding when closed */
    pointer-events: none; /* Disable interactions when hidden */
    transition: max-height 0.3s ease-out, opacity 0.3s ease-in-out, padding 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.glossary-filter-content.open { /* Class for open state, applies to both mobile/desktop */
    visibility: visible;
    max-height: 200px; /* Sufficient height when open */
    opacity: 1; /* Become visible */
    padding: 0.5rem; /* Add padding when open, adjust as needed for dropdown */
    pointer-events: auto; /* Enable interactions when open */
}

/* Ensure filter icon is always visible */
.glossary-filter-icon-button {
    display: block; /* Always show filter icon */
}

/* Adjust the container for the filter so it aligns properly when the dropdown is hidden */
/* This targets the div wrapping search and filter controls */
.flex.justify-end.items-center.gap-4.mb-6.relative { /* Updated selector */
    flex-direction: row; /* Always row on desktop */
    justify-content: flex-end; /* Push to right */
    align-items: center;
    gap: 1rem;
}

@media (max-width: 639px) { /* Mobile specific adjustments for the container */
    .flex.justify-end.items-center.gap-4.mb-6.relative {
        flex-direction: row; /* Keep as row on mobile too */
        justify-content: flex-end; /* Align to end */
        gap: 0.5rem;
    }
    /* Adjust width of glossary search container on mobile */
    .glossary-search-container {
        flex-grow: 1; /* Allow it to grow */
    }
}


/* Styles for the embedded iframe */
.embedded-iframe {
    width: 100%;
    height: 80vh; /* Adjust height as needed */
    border: none; /* No border for iframe */
    border-radius: 0.75rem; /* Rounded corners for the iframe itself */
    /* Removed box-shadow and other padding/margin as the parent container will handle it */
}
/* Style for the container when it holds an iframe */
.article-iframe-container {
    padding: 0 !important; /* Remove padding when it's just an iframe container */
    background-color: transparent !important; /* No background */
    box-shadow: none !important; /* No shadow */
    border-radius: 0 !important; /* No border radius */
}

/* Sidebar submenu styles */
.submenu-container {
    margin-top: 1rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
}
.submenu-title {
    font-size: 1.125rem; /* text-lg */
    font-weight: 600; /* font-semibold */
    color: #3730a3; /* text-indigo-800 */
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.submenu-title .arrow-icon {
    margin-left: auto;
    transition: transform 0.2s ease-in-out;
}
.submenu-title.open .arrow-icon {
    transform: rotate(90deg);
}
.submenu-items {
    display: none; /* Hidden by default */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 1rem; /* Indent submenu items */
}
.submenu-items.open {
    display: block; /* Show when open */
    max-height: 500px; /* Sufficiently large to show all items */
}
.submenu-item-button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.95rem;
    color: #4b5563;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}
.submenu-item-button:hover {
    background-color: #e0e7ff; /* Light indigo */
    color: #3730a3; /* Dark indigo */
}
.submenu-item-button.active {
    background-color: #c7d2fe; /* Slightly darker indigo */
    color: #3730a3;
    font-weight: 600;
}

/* Image Modal Styles */
.image-modal { /* Corrected from .infographic-modal */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Dark overlay */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100; /* Above everything else */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    padding: 1rem;
}
.image-modal.open { /* Corrected from .infographic-modal.open */
    opacity: 1;
    visibility: visible;
}
.image-modal-content { /* Corrected from .infographic-modal-content */
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center content vertically */
    background-color: #fff; /* White background for content */
    border-radius: 0.75rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    padding: 1.5rem; /* Default padding for the content box */
}

/* Adjust padding for smaller screens */
@media (max-width: 767px) { /* Mobile breakpoint */
    .image-modal-content {
        padding: 0.5rem; /* Reduced padding for mobile */
    }
}

/* Styles for the dynamic display area */
.image-display-area { /* Corrected from .infographic-display-area */
    width: 100%;
    height: 85vh; /* Take up most of the modal height */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Hide scrollbars if content overflows */
}

/* Styles for image within the display area */
.image-content { /* Corrected from .infographic-image */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Ensure image fits without cropping */
    border-radius: 0.75rem;
    display: block; /* Ensure it's a block element */
}

/* Styles for iframe (PDF) within the display area */
.image-iframe { /* Corrected from .infographic-iframe (if used for PDF in modal) */
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0.75rem;
}

.image-modal-close-btn { /* Corrected from .infographic-modal-close-btn */
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    z-index: 1001; /* Increased z-index to ensure it's always on top */
}
.image-modal-close-btn:hover { /* Corrected from .infographic-modal-close-btn:hover */
    background-color: rgba(255, 255, 255, 0.4);
}
.image-modal-actions { /* Corrected from .infographic-modal-actions */
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center; /* Center items vertically */
    justify-content: center; /* Center items horizontally */
}
.image-modal-actions button { /* Corrected from .infographic-modal-actions button */
    background-color: #6366f1; /* Indigo */
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-modal-actions button:hover { /* Corrected from .infographic-modal-actions button:hover */
    background-color: #4f46e5; /* Darker indigo */
    transform: translateY(-2px);
}

/* New styles for Analysis Cards */
/* Main Analysis Card */
.main-analysis-card {
    background-color: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 2.5rem;
    /* Removed cursor, transform, box-shadow transitions that imply toggle */
    cursor: default; /* No pointer cursor */
    transition: none; /* No transition on hover */
}
.main-analysis-card:hover {
    transform: none; /* No transform on hover */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); /* Keep base shadow */
}
.main-analysis-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 2rem; /* text-3xl */
    color: #3730a3;
    margin-bottom: 0.75rem;
}
.main-analysis-card-header .arrow-icon {
    display: none; /* Hide arrow icon */
}
.main-analysis-content {
    display: block; /* Always visible */
    overflow: visible; /* Allow content to flow naturally */
    max-height: none; /* No max-height constraint */
    opacity: 1; /* Always fully opaque */
    transition: none; /* No transition */
    padding-top: 1.5rem; /* Add padding when open */
    border-top: 1px solid #e2e8f0; /* Separator */
    margin-top: 1.5rem;
}
/* Individual Analysis Sub-sections (now used for the single display area) */
.analysis-sub-section {
    background-color: #f8fafc; /* Light background for sub-sections */
    border-radius: 0.75rem;
    box-shadow: inset 0 1px 5px rgba(0,0,0,0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem; /* Space between sub-sections */
    border: 1px solid #e2e8f0;
}
.analysis-sub-section-title {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 700;
    color: #3730a3;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}
.analysis-sub-section-title i {
    margin-right: 0.75rem;
    font-size: 1.75rem;
    color: #6366f1;
}
.analysis-sub-section-text {
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
    max-height: 300px; /* Limit height and make scrollable */
    overflow-y: auto;
    padding-right: 10px; /* Space for scrollbar */
}
.analysis-sub-section-text.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}
.analysis-sub-section-text.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.analysis-sub-section-text.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.analysis-sub-section-text.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* AI Reflection and Quote within sub-sections */
.reflection-section, .quote-section {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
}
.reflection-section {
    background-color: #e0e7ff; /* Indigo-100 */
    border-left: 4px solid #818cf8; /* Indigo-400 */
    color: #3730a3; /* Indigo-800 */
}
.quote-section {
    background-color: #d1fae5; /* Green-100 */
    border-left: 4px solid #34d399; /* Green-400 */
    color: #065f46; /* Green-800 */
}
.reflection-section .font-semibold, .quote-section .font-semibold {
    color: inherit; /* Inherit color from parent section */
}
.reflection-section i, .quote-section i {
    color: inherit; /* Inherit color from parent section */
}


/* Styles for the combined multimedia card */
.multimedia-card-content {
    display: flex;
    flex-direction: column; /* Default to column for mobile */
    gap: 1.5rem; /* Space between sections */
    align-items: center; /* Center items horizontally in column */
    justify-content: center; /* Center items vertically in column */
}

@media (min-width: 768px) {
    .multimedia-card-content {
        flex-direction: row; /* Side-by-side on larger screens */
        justify-content: center; /* Center the items horizontally */
        align-items: flex-start; /* Align sections to the top, allowing different heights */
        gap: 4rem; /* Add a larger gap between items when centered */
    }
    .multimedia-section-wrapper { /* Wrapper for each circle + text */
        flex: 0 0 auto; /* Prevent growing/shrinking, base on content */
        min-width: 200px; /* Ensure a minimum width for each section */
        display: flex;
        flex-direction: column;
        align-items: center; /* Center children within the wrapper */
        text-align: center;
        width: auto; /* Allow width to be determined by content and gap */
    }
}
.multimedia-section-wrapper h4 {
    font-size: 1.125rem; /* text-lg */
    font-weight: 600;
    color: #3730a3;
    margin-bottom: 0.75rem;
}
/* Hide multimedia section titles on mobile */
@media (max-width: 767px) {
    .multimedia-section-wrapper h4 {
        display: none;
    }
}
.multimedia-section-wrapper p {
    color: #4b5563;
    margin-bottom: 1rem;
}

/* Circular elements for multimedia */
.multimedia-circle {
    width: 120px; /* Increased size */
    height: 120px; /* Increased size */
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    margin-bottom: 1rem; /* Space below the circle */
}
.multimedia-circle.visual {
    background: linear-gradient(45deg, #3b82f6, #6366f1); /* Blue to Indigo gradient */
}
.multimedia-circle.audio {
    background: linear-gradient(45deg, #10b981, #059669); /* Emerald to Dark Green gradient */
}
.multimedia-circle.image { /* New style for the image generation circle */
    background: linear-gradient(45deg, #ef4444, #dc2626); /* Red gradient */
}
.multimedia-circle:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 15px rgba(0,0,0,0.25);
}
.multimedia-circle i {
    font-size: 2.5rem; /* Larger icon */
    margin-bottom: 0.5rem;
}

/* Content revealed when circle is clicked - REMOVED for multimedia */
/* .multimedia-circle-content {
    display: none;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out;
    width: 100%;
    padding-top: 1rem;
}
.multimedia-circle-content.open {
    display: block;
    opacity: 1;
    max-height: 500px;
}
.multimedia-circle-content button {
    width: 100%;
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
} */

/* New styles for Analysis Circles */
.analysis-circle {
    width: 100px; /* Smaller than multimedia circles */
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem; /* Smaller font */
    font-weight: 600;
    color: white;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: linear-gradient(45deg, #a78bfa, #8b5cf6); /* Purple gradient for analysis */
    border: 3px solid transparent; /* For active state */
}
.analysis-circle:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.analysis-circle i {
    font-size: 2rem; /* Smaller icon */
    margin-bottom: 0.3rem;
}
.analysis-circle.active {
    border-color: #4f46e5; /* Darker indigo border for active */
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.5); /* Outer glow for active */
    transform: scale(1.05); /* Slightly larger when active */
}
/* Specific colors for analysis circles (optional, can use a scale if many types) */
.analysis-circle.individual { background: linear-gradient(45deg, #a78bfa, #8b5cf6); } /* Purple */
.analysis-circle.historicalCritical { background: linear-gradient(45deg, #f6ad55, #ed8936); } /* Orange */
.analysis-circle.biblical { background: linear-gradient(45deg, #48bb78, #38a169); } /* Green */
.analysis-circle.tradition { background: linear-gradient(45deg, #ecc94b, #d69e2e); } /* Yellow */
.analysis-circle.mystical { background: linear-gradient(45deg, #667eea, #5a67d8); } /* Blue-purple */

/* NEW: Analysis Fullscreen Modal */
.analysis-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Dark overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90; /* Below infographic modal, above sidebar */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    padding: 1rem;
}
.analysis-modal.open {
    opacity: 1;
    visibility: visible;
}
.analysis-modal-content {
    position: relative;
    background-color: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    padding: 2.5rem;
    max-width: 90%; /* Adjust width */
    max-height: 90%; /* Adjust height */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(20px);
    transition: transform 0.3s ease-in-out;
}
.analysis-modal.open .analysis-modal-content {
    transform: translateY(0);
}
.analysis-modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: #e0e7ff;
    color: #3730a3;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    z-index: 10;
}
.analysis-modal-close-btn:hover {
    background-color: #c7d2fe;
    transform: scale(1.05);
}
.analysis-modal-title {
    font-size: 2.5rem; /* text-4xl */
    font-weight: 700;
    color: #3730a3;
    margin-bottom: 1.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.analysis-modal-title i {
    margin-right: 1rem;
    font-size: 2.75rem;
    color: #6366f1;
}
.analysis-modal-text {
    font-size: 1.1rem;
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 2rem;
    padding-right: 10px; /* Space for scrollbar */
}
.analysis-modal-text.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}
.analysis-modal-text.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.analysis-modal-text.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.analysis-modal-text.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.analysis-modal .reflection-section,
.analysis-modal .quote-section {
    padding: 1.25rem;
    margin-top: 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}
.analysis-modal .reflection-section .font-semibold,
.analysis-modal .quote-section .font-semibold {
    font-size: 1.1rem;
}
.analysis-modal .reflection-section i,
.analysis-modal .quote-section i {
    color: inherit; /* Inherit color from parent section */
}

/* NEW: Category Detail Fullscreen Modal Styles */
.category-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Slightly darker overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 115; /* Above constellation fullscreen modal */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    padding: 1rem;
}
.category-detail-modal.open {
    opacity: 1;
    visibility: visible;
}
.category-detail-modal-content {
    position: relative;
    background-color: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3); /* Deeper shadow */
    padding: 3rem; /* More padding */
    max-width: 800px; /* Max width for readability */
    max-height: 90%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(30px); /* Start lower for entry animation */
    transition: transform 0.3s ease-in-out;
}
.category-detail-modal.open .category-detail-modal-content {
    transform: translateY(0);
}
.category-detail-modal-close-btn {
    position: absolute;
    top: 1.5rem; /* Slightly more padding from top/right */
    right: 1.5rem;
    background-color: #e0e7ff;
    color: #3730a3;
    border-radius: 50%;
    width: 45px; /* Slightly larger button */
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem; /* Larger icon */
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    z-index: 10;
}
.category-detail-modal-close-btn:hover {
    background-color: #c7d2fe;
    transform: scale(1.08); /* More pronounced hover */
}
.category-detail-modal-title {
    font-size: 3rem; /* Larger title */
    font-weight: 800; /* Extra bold */
    color: #3730a3;
    margin-bottom: 2rem; /* More space below title */
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.category-detail-modal-title i {
    margin-right: 1.25rem; /* More space for icon */
    font-size: 3.2rem; /* Larger icon */
    color: #6366f1;
}
.category-detail-modal-text {
    font-size: 1.15rem; /* Slightly larger text */
    color: #4b5563;
    line-height: 1.8; /* More comfortable line height */
}

/* NEW: Styles for Psalm tags inside the category detail modal */
.psalm-tag {
    background-color: #e0e7ff;
    color: #3730a3;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 1px solid #c7d2fe;
}
.psalm-tag:hover {
    background-color: #c7d2fe;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* NEW: Styles for the toggle switch */
.toggle-bg {
    transition: background-color 0.2s ease;
}
.toggle-dot {
    transition: transform 0.2s ease;
}
input:checked ~ .toggle-bg {
    background-color: #4f46e5; /* Indigo-600 */
}
input:checked ~ .toggle-dot {
    transform: translateX(100%);
}

/* REMOVED: Styles for the now-deleted category-psalms-modal */

/* NEW: Constellation Fullscreen Modal */
.constellation-fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(248, 250, 252, 0.98); /* Light background, almost opaque */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 110; /* Above everything */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}
.constellation-fullscreen-modal.open {
    opacity: 1;
    visibility: visible;
}
.constellation-modal-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background-color: #e5e7eb;
    color: #4b5563;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 111;
}
.constellation-modal-close-btn:hover {
    background-color: #d1d5db;
    transform: rotate(90deg);
}
.constellation-fullscreen-container {
    width: 100%;
    height: 100%;
}
#constellation-fullscreen-svg {
    width: 100%;
    height: 100%;
}
