/* ===== CATHEDRAL AESTHETIC THEME ===== */

:root {
    --cathedral-gold: #d4af37;
    --cathedral-gold-light: #f4e4a6;
    --cathedral-gold-dark: #b8941f;
    --cathedral-deep: #2c1810;
    --cathedral-medium: #4a3426;
    --cathedral-light: #6b4e3d;
    --cathedral-cream: #f7f0e0;
    --cathedral-parchment: #f0e8d4;
    --cathedral-shadow: rgba(44, 24, 16, 0.15);
    --cathedral-glow: rgba(212, 175, 55, 0.3);
    --cathedral-blue-soft: #87ceeb;
    
    --serif-primary: 'Crimson Text', serif;
    --serif-display: 'Cinzel', serif;
}

/* ===== GLOBAL STYLES ===== */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--serif-primary);
    background: 
        linear-gradient(135deg, var(--cathedral-cream) 0%, var(--cathedral-parchment) 50%, #f3ecda 100%),
        radial-gradient(ellipse at top, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    color: var(--cathedral-deep);
    min-height: 100vh;
    position: relative;
    line-height: 1.6;
    animation: pageFadeIn 0.6s ease-out;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Cathedral background pattern with enhanced ethereal elements */
.cathedral-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, var(--cathedral-glow) 0%, transparent 45%),
        radial-gradient(circle at 80% 80%, var(--cathedral-glow) 0%, transparent 45%),
        radial-gradient(circle at 60% 10%, rgba(255, 255, 255, 0.15) 0%, transparent 35%),
        radial-gradient(circle at 10% 70%, rgba(255, 255, 255, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 90% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 30% 90%, rgba(212, 175, 55, 0.06) 0%, transparent 30%);
    pointer-events: none;
    z-index: -1;
    opacity: 0.9;
}

/* Additional subtle texture overlay */
.cathedral-bg::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.02) 2px,
            rgba(255, 255, 255, 0.02) 4px
        );
    pointer-events: none;
    z-index: -1;
    opacity: 0.3;
}

/* ===== TYPOGRAPHY ===== */

.cathedral-title {
    font-family: var(--serif-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--cathedral-deep);
    text-shadow: 2px 2px 4px var(--cathedral-shadow);
    letter-spacing: 2px;
}
.cathedral-title i {
    font-size: 1.5em;
}

/* Search term highlighting - clean and subtle */
.highlight {
    background-color: #fffadc;
    padding: 1px 3px;
    border-radius: 2px;
}

/* Mobile-specific highlighting adjustments */
@media (max-width: 768px) {
    .search-highlight,
    mark.search-highlight {
        padding: 0.05rem 0.2rem !important;
        border-radius: 3px !important;
        font-size: inherit !important;
    }
}

/* ===== INSIGHT LOADING SCREEN WITH AKASHIC RECORDS ===== */

.insight-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    transform: none;
    background: #000;
    z-index: 9999;
    display: none;
    overflow: hidden;
}

.insight-loading-overlay:not(.d-none) {
    display: block !important;
}

.insight-loading-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0;
    margin: 0;
}

.akashic-image-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background-color: #050510;
}

.akashic-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 0;
    filter: none;
    display: block;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg, 
        rgba(10, 10, 26, 0.4) 0%, 
        rgba(10, 10, 26, 0.2) 50%,
        rgba(10, 10, 26, 0.4) 100%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 45%;
    color: white;
}

.hourglass-container {
    margin-bottom: 1.5rem;
}

.hourglass-svg {
    animation: hourglass-flip 3s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.5));
}

@keyframes hourglass-flip {
    0% { transform: rotate(0deg); }
    35% { transform: rotate(180deg); }
    50% { transform: rotate(180deg); }
    85% { transform: rotate(360deg); }
    100% { transform: rotate(360deg); }
}

.sand-stream {
    animation: sand-flow 1.5s ease-in-out infinite;
    transform-origin: center top;
}

@keyframes sand-flow {
    0% { opacity: 0.2; stroke-width: 1; }
    30% { opacity: 1; stroke-width: 2; }
    70% { opacity: 1; stroke-width: 2; }
    100% { opacity: 0.2; stroke-width: 1; }
}

.sand-top {
    animation: sand-drain 3s ease-in-out infinite;
    transform-origin: center bottom;
}

@keyframes sand-drain {
    0% { opacity: 0.8; transform: scaleY(1); }
    45% { opacity: 0.15; transform: scaleY(0.2); }
    50% { opacity: 0.15; transform: scaleY(0.2); }
    95% { opacity: 0.8; transform: scaleY(1); }
    100% { opacity: 0.8; transform: scaleY(1); }
}

.sand-bottom {
    animation: sand-fill 3s ease-in-out infinite;
    transform-origin: center top;
}

@keyframes sand-fill {
    0% { opacity: 0.2; transform: scaleY(0.2); }
    45% { opacity: 0.9; transform: scaleY(1); }
    50% { opacity: 0.9; transform: scaleY(1); }
    95% { opacity: 0.2; transform: scaleY(0.2); }
    100% { opacity: 0.2; transform: scaleY(0.2); }
}

.loading-subtitle {
    font-size: 1.4rem;
    color: var(--cathedral-gold-light, #f4e4a6);
    font-style: italic;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
    font-family: var(--serif-display);
    letter-spacing: 0.5px;
}

.animated-dots span {
    animation: dot-cycle 1.8s steps(1) infinite;
    font-weight: bold;
}
.animated-dots span:nth-child(1) { animation-delay: 0s; }
.animated-dots span:nth-child(2) { animation-delay: 0.4s; }
.animated-dots span:nth-child(3) { animation-delay: 0.8s; }

@keyframes dot-cycle {
    0%   { opacity: 0; }
    33%  { opacity: 1; }
    100% { opacity: 0; }
}

.loading-title {
    font-family: var(--serif-display);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--cathedral-gold-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin-bottom: 0.5rem;
}

/* Mobile adjustments for insight loading */
@media (max-width: 768px) {
    .insight-loading-overlay {
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .insight-loading-content {
        padding: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 100%;
    }
    
    .akashic-image-container {
        left: 0;
        right: 0;
        width: 100%;
    }
    
    .akashic-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
        max-width: none;
    }
    
    .loading-overlay {
        padding-bottom: 10%;
    }
    
    .hourglass-svg {
        animation: hourglass-flip 3s ease-in-out infinite !important;
    }
    
    .sand-stream {
        animation: sand-flow 1.5s ease-in-out infinite !important;
    }
    
    .sand-top {
        animation: sand-drain 3s ease-in-out infinite !important;
    }
    
    .sand-bottom {
        animation: sand-fill 3s ease-in-out infinite !important;
    }
    
    .loading-title {
        font-size: 1.4rem;
    }
    
    .loading-subtitle {
        font-size: 1rem;
    }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--cathedral-medium);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.reading-count {
    font-size: 0.95rem;
    color: var(--cathedral-light);
    font-weight: 500;
}

/* ===== ORNAMENTAL ELEMENTS ===== */

.header-ornament, .footer-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

.ornament-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cathedral-gold), transparent);
    margin: 0 1rem;
}

.text-gold {
    color: var(--cathedral-gold) !important;
}

.text-cathedral-blue {
    color: var(--cathedral-blue-soft) !important;
}

.header-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.3));
}

/* ===== SEARCH SANCTUARY ===== */

.search-sanctuary {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 1.75rem 2.5rem;
    box-shadow: 
        0 10px 30px var(--cathedral-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.2);
    max-width: 800px;
    width: 100%;
    backdrop-filter: blur(10px);
    position: relative;
}

.search-sanctuary::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, var(--cathedral-gold), transparent, var(--cathedral-gold));
    border-radius: 20px;
    z-index: -1;
    opacity: 0.3;
}

/* ===== MODE SELECTOR ===== */

.mode-selector .btn-outline-gold {
    border: 2px solid #5dade2;
    color: var(--cathedral-deep);
    background: #ffffff !important;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mode-selector .btn-outline-gold:hover {
    background: var(--cathedral-gold-light) !important;
    border-color: var(--cathedral-gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--cathedral-shadow);
}

.mode-selector .btn-check:checked + .btn-outline-gold {
    background: #87ceeb !important;
    color: #2c5aa0;
    border-color: #5dade2;
    border-width: 2.5px;
    border-style: solid;
    box-shadow: 0 0 12px rgba(93, 173, 226, 0.45), 0 4px 12px rgba(135, 206, 235, 0.25);
    position: relative;
}

.mode-selector .btn-check:checked + .btn-outline-gold::before {
    content: "▶";
    position: absolute;
    top: 50%;
    left: -25px;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #5dade2;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* AI Mode always has soft yellow background */
#insightMode + .btn-outline-gold {
    background: rgba(244, 228, 166, 0.45) !important;
    border-color: #d4af37 !important;
    color: var(--cathedral-deep);
}

/* AI Mode selected state - rich gold */
#insightMode:checked + .btn-outline-gold {
    background: #d4af37 !important;
    color: #fff !important;
    border-color: #b8960c !important;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.45), 0 4px 12px rgba(212, 175, 55, 0.25) !important;
}

/* Precision Mode - Ceylon blue resting state */
.mode-selector a.btn-outline-gold[href="/precision"] {
    background: #87ceeb !important;
    border: 2.5px solid #5dade2 !important;
    color: #1a1a1a !important;
}
.mode-selector a.btn-outline-gold[href="/precision"]:hover {
    background: #74c0e0 !important;
    border-color: #4a9fd4 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(135,206,235,0.35);
}
.mode-selector a.btn-outline-gold[href="/precision"]:active {
    background: #d4af37 !important;
    border-color: #b8960c !important;
    transform: translateY(0);
}

.mode-title {
    font-family: var(--serif-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--cathedral-deep);
    letter-spacing: 0.5px;
}

.mode-description {
    font-family: var(--serif-primary);
    font-style: italic;
    font-size: 0.88rem;
    opacity: 0.75;
    margin-top: 0.25rem;
    color: var(--cathedral-medium);
}

/* ===== SEARCH INPUT ===== */

.search-container .input-group-text {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 0;
}

.chatbot-link {
    border-color: #5dade2 !important;
    background: rgba(220, 235, 252, 0.35) !important;
}
.chatbot-link:hover {
    background: rgba(220, 235, 252, 0.6) !important;
    border-color: #5dade2 !important;
}

.search-input {
    border: none;
    border-radius: 0;
    padding: 0.85rem 1.25rem;
    font-family: var(--serif-primary);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.search-container .input-group:focus-within {
    border-color: #333;
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.1);
}

.search-input:focus {
    outline: none;
    background: white;
}

.search-input::placeholder {
    color: var(--cathedral-light);
    font-style: italic;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

/* ===== SEARCH BUTTON ===== */

.btn-gold {
    background: linear-gradient(135deg, #87ceeb, #5dade2);
    border: none;
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #5dade2, #87ceeb);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(135, 206, 235, 0.4);
}

.btn-gold:active {
    transform: translateY(0);
}

/* ===== RESULTS CONTAINERS ===== */

.results-container {
    margin-top: 2rem;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header h3 {
    font-family: var(--serif-display);
    color: var(--cathedral-deep);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.results-meta {
    color: var(--cathedral-medium);
    font-style: italic;
    margin-bottom: 1.5rem;
}

/* ===== PRECISION RESULTS ===== */

.precision-results .result-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.precision-results .result-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--cathedral-gold);
    box-shadow: 0 5px 15px var(--cathedral-shadow);
    transform: translateY(-2px);
}

.reading-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.reading-actions {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}

.reading-id {
    font-weight: 600;
    color: var(--cathedral-deep);
    font-size: 0.9rem;
}

a.reading-link {
    color: #1a6fb5;
    text-decoration: none;
    border-bottom: 1px solid #1a6fb5;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
    cursor: pointer;
}

a.reading-link:hover {
    color: #1250a0;
    border-bottom: 1px solid #1250a0;
}

.insight-text a.reading-link {
    font-weight: 600;
    color: #1a6fb5;
}

.insight-text a.reading-link:hover {
    color: #1250a0;
}

.snippet-header a.reading-link {
    color: #1a6fb5;
    font-weight: 600;
    font-size: 0.9rem;
}

.snippet-header a.reading-link:hover {
    color: #1250a0;
}

.relevance-score {
    font-size: 0.8rem;
    color: var(--cathedral-medium);
    background: #fffadc;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
}

.reading-text {
    line-height: 1.7;
    color: var(--cathedral-deep);
    font-size: 1.05rem;
}

/* ===== READING TABS ===== */

.reading-tabs {
    margin-top: 1rem;
}

.reading-nav .nav-link {
    border: 2px solid rgba(139, 119, 72, 0.5);
    color: var(--cathedral-deep);
    background: rgba(245, 240, 230, 0.7);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    margin-right: 0.25rem;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
}

.reading-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: #8b7748;
    color: var(--cathedral-deep);
}

.reading-nav .nav-link.active {
    background: white;
    border-color: #8b7748;
    border-width: 2px;
    border-bottom: 2px solid white;
    color: var(--cathedral-deep);
    font-weight: 600;
}

.reading-content {
    background: white;
    border: 1px solid var(--cathedral-gold);
    border-radius: 0 0 8px 8px;
    padding: 1.5rem;
    margin-top: -1px;
}

.reading-content .tab-pane {
    min-height: 150px;
}

.full-reading {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.reading-background,
.reading-reports {
    color: var(--cathedral-medium);
    font-style: italic;
}

.reading-background p,
.reading-reports p {
    margin-bottom: 0.75rem;
}

.reading-background strong,
.reading-reports strong {
    color: var(--cathedral-deep);
    font-style: normal;
}

/* Mobile responsiveness for reading tabs */
@media (max-width: 768px) {
    .reading-nav .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        margin-right: 0.1rem;
    }
    
    .reading-nav .nav-link i {
        display: none;
    }
    
    .reading-content {
        padding: 1rem;
    }
    
    .full-reading {
        max-height: 300px;
    }
}

@media (max-width: 576px) {
    .reading-nav {
        flex-wrap: wrap;
    }
    
    .reading-nav .nav-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
        margin-bottom: 0.25rem;
        border-radius: 6px;
    }
    
    .reading-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .reading-content {
        padding: 0.75rem;
    }
}

/* ===== INSIGHT RESULTS ===== */

.insight-results {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(244, 228, 166, 0.1));
    border: 2px solid var(--cathedral-gold);
    border-radius: 15px;
    padding: 1rem 0.5rem;
}

.insight-content {
    font-size: 1.1rem;
    line-height: 1.8;
    width: 100%;
}

.insight-text {
    background: rgba(255, 255, 255, 0.6);
    padding: 1.2rem 0.5rem 1.2rem 1.5rem;
    border-radius: 10px;
    border-left: 1px solid var(--cathedral-gold);
    margin-left: -15px;
    margin-right: -0.5rem;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: var(--cathedral-deep);
    position: relative;
    width: calc(100% + 1rem);
    box-sizing: border-box;
}

.insight-text::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--cathedral-gold);
    border-radius: 2px;
}

.related-readings h5,
.book-recommendations h5 {
    color: var(--cathedral-deep);
    font-family: var(--serif-display);
    margin-bottom: 1rem;
}

.reading-references {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reading-ref {
    background: var(--cathedral-gold);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.book-list {
    list-style: none;
    padding: 0;
}

.book-list li {
    background: rgba(255, 255, 255, 0.6);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border-left: 3px solid var(--cathedral-gold);
    position: relative;
}

.book-list li::before {
    content: '📖';
    margin-right: 0.5rem;
}

/* ===== HAMBURGER MENU ===== */

.hamburger-menu {
    z-index: 1050;
}

.hamburger-btn {
    border: 2px solid var(--cathedral-gold);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    background: var(--cathedral-gold-light);
    border-color: var(--cathedral-gold-dark);
}

.hamburger-lines {
    display: flex;
    flex-direction: column;
    width: 20px;
    height: 15px;
    justify-content: space-between;
}

.hamburger-lines span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--cathedral-deep);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.dropdown-menu {
    border: 2px solid var(--cathedral-gold);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    color: var(--cathedral-deep);
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: var(--cathedral-gold-light);
    color: var(--cathedral-deep);
}

/* ===== ENHANCED READABILITY FOR MODALS ===== */

.enhanced-readability {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--cathedral-deep);
}

.enhanced-readability .large-text {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.7;
}

.enhanced-readability .contact-section {
    background: rgba(244, 228, 166, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--cathedral-gold);
}

.enhanced-readability .contact-item {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--cathedral-deep);
}

.enhanced-readability .contact-item i {
    color: var(--cathedral-gold);
    width: 30px;
}

.enhanced-readability .large-alert {
    font-size: 1.3rem;
    font-weight: 600;
    padding: 1.5rem;
}

.enhanced-readability .large-list li {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.enhanced-readability h4, 
.enhanced-readability h5, 
.enhanced-readability h6 {
    color: var(--cathedral-deep);
    font-weight: 700;
    margin-bottom: 1rem;
}

.enhanced-readability a {
    color: var(--cathedral-gold-dark);
    text-decoration: none;
    font-weight: 700;
}

.enhanced-readability a:hover {
    color: var(--cathedral-gold);
    text-decoration: underline;
}

/* ===== MEDITATION MODE ===== */

.meditation-shortcut {
    z-index: 1000;
}

.btn-meditation-shortcut {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--cathedral-gold), var(--cathedral-gold-dark));
    border: 2px solid var(--cathedral-gold-light);
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-meditation-shortcut:hover {
    background: linear-gradient(135deg, var(--cathedral-gold-dark), var(--cathedral-gold));
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.6);
    color: white;
}

.btn-meditation-shortcut:active {
    transform: translateY(0);
    box-shadow: 0 2px 15px rgba(212, 175, 55, 0.5);
}

.meditation-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(244, 228, 166, 0.1));
    border: 2px solid var(--cathedral-gold);
}

.timer-circle {
    width: 150px;
    height: 150px;
    border: 4px solid var(--cathedral-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--cathedral-deep);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.affirmation-text {
    font-style: italic;
    font-size: 1.3rem;
    font-weight: bold;
    line-height: 1.6;
    color: #000000 !important;
    border-left: 4px solid var(--cathedral-gold);
    background: rgba(255, 255, 255, 0.9) !important;
    text-shadow: none;
}

.timer-setup, .meditation-session {
    padding: 1rem;
}

/* ===== FOOTER ===== */

footer {
    background: rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    margin-top: 2rem;
}

.footer-text {
    font-style: italic;
    color: var(--cathedral-medium);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.copyright {
    font-size: 1rem;
    font-weight: bold;
    color: var(--cathedral-light);
    margin: 0;
}

/* ===== LOADING SPINNER ===== */

#loadingSpinner .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .cathedral-title {
        font-size: 2.5rem;
    }
    
    .search-sanctuary {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
    }
    
    .mode-selector .btn-outline-gold {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .search-input, .btn-gold {
        font-size: 1rem;
        padding: 0.875rem 1.25rem;
    }
    
    .reading-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .reading-references {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    body {
        min-height: auto !important;
    }

    main.flex-grow-1 {
        flex-grow: 0 !important;
        align-items: flex-start !important;
    }

    footer.py-3 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    header.py-4 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.25rem !important;
    }

    .cathedral-title {
        font-size: 1.75rem;
    }
    
    .cathedral-title i {
        font-size: 1.2em;
    }
    
    .search-sanctuary {
        padding: 0.75rem 0.75rem;
        margin: 0.25rem;
        border-radius: 15px;
    }

    .mode-selector .btn-outline-gold {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .mode-selector .mb-3,
    .search-container.mb-4 {
        margin-bottom: 0.5rem !important;
    }
    
    .ornament-line {
        width: 30px;
    }
}

/* ===== ACCESSIBILITY ===== */

.btn:focus,
.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem var(--cathedral-glow);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== MODAL MOBILE COMPATIBILITY ===== */

#insightDisclaimerModal .modal-dialog {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
}

#insightDisclaimerModal .modal-content {
    border-radius: 12px;
    border: 2px solid #5dade2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#insightDisclaimerModal .modal-header {
    background: linear-gradient(135deg, var(--cathedral-cream), var(--cathedral-parchment));
    border-bottom: 1px solid #5dade2;
    border-radius: 10px 10px 0 0;
}

#insightDisclaimerModal .modal-title {
    font-family: var(--serif-display);
    color: var(--cathedral-deep);
    font-size: 1.4rem;
    font-weight: 600;
}

#insightDisclaimerModal .modal-body {
    background: white;
    color: var(--cathedral-deep);
    font-family: var(--serif-primary);
    line-height: 1.6;
    padding: 1.5rem;
}

#insightDisclaimerModal .modal-body p {
    margin-bottom: 1rem;
}

#insightDisclaimerModal .modal-footer {
    background: var(--cathedral-parchment);
    border-top: 1px solid #5dade2;
    border-radius: 0 0 10px 10px;
    justify-content: center;
}

#gotItButton {
    background: linear-gradient(135deg, #87ceeb, #5dade2);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: var(--serif-primary);
    transition: all 0.3s ease;
}

#gotItButton:hover {
    background: linear-gradient(135deg, #5dade2, #87ceeb);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(135, 206, 235, 0.4);
}

/* Mobile-specific modal adjustments */
@media (max-width: 768px) {
    #insightDisclaimerModal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        display: flex;
        align-items: center;
    }
    
    #insightDisclaimerModal .modal-content {
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    #insightDisclaimerModal .modal-title {
        font-size: 1.2rem;
    }
    
    #insightDisclaimerModal .modal-body {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    #gotItButton {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }
}

/* App store and PWA compatibility */
@media (display-mode: standalone) {
    #insightDisclaimerModal .modal-dialog {
        margin-top: calc(env(safe-area-inset-top, 0px) + 1rem);
        margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
    }
}

/* iOS Safari specific adjustments */
@supports (-webkit-touch-callout: none) {
    #insightDisclaimerModal .modal-dialog {
        margin-top: max(1rem, env(safe-area-inset-top));
        margin-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* ===== FONT SIZE ADJUSTER ===== */

.font-size-btn {
    border: 1.5px solid var(--cathedral-deep);
    color: var(--cathedral-deep);
    background: transparent;
    font-weight: 700;
    font-family: var(--serif-primary);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    line-height: 1.2;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.font-size-btn:hover {
    background: var(--cathedral-deep);
    color: white;
}

body.dark-mode .font-size-btn {
    border-color: var(--cathedral-gold);
    color: var(--cathedral-gold);
}

body.dark-mode .font-size-btn:hover {
    background: var(--cathedral-gold);
    color: var(--cathedral-deep);
}

.font-size-floating {
    position: fixed;
    bottom: 5rem;
    right: 2rem;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    background: rgba(255,255,255,0.95);
    border: 2px solid var(--cathedral-gold);
    border-radius: 10px;
    padding: 0.4rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.font-size-floating .font-size-btn {
    padding: 0.25rem 0.55rem;
    font-size: 0.9rem;
}

body.dark-mode .font-size-floating {
    background: rgba(30,30,50,0.95);
    border-color: rgba(212,175,55,0.4);
}

@media (max-width: 576px) {
    .font-size-floating {
        bottom: 4.5rem;
        right: 1rem;
    }
}

/* ===== UTILITY CLASSES ===== */

.text-cathedral-deep { color: var(--cathedral-deep) !important; }
.text-cathedral-medium { color: var(--cathedral-medium) !important; }
.text-cathedral-light { color: var(--cathedral-light) !important; }
.bg-cathedral-gold { background-color: var(--cathedral-gold) !important; }
.border-cathedral-gold { border-color: var(--cathedral-gold) !important; }
.text-purple { color: #8A2BE2 !important; }

.btn-outline-purple {
    color: var(--purple);
    border-color: var(--purple);
    background: rgba(138, 43, 226, 0.1);
    backdrop-filter: blur(10px);
}

.btn-outline-purple:hover {
    color: #fff;
    background-color: var(--purple);
    border-color: var(--purple);
}

.btn-outline-blue {
    color: var(--soft-blue);
    border-color: var(--soft-blue);
    background: rgba(70, 130, 180, 0.1);
    backdrop-filter: blur(10px);
}

.btn-outline-blue:hover {
    color: #fff;
    background-color: var(--soft-blue);
    border-color: var(--soft-blue);
}

/* ===== API KEY SECTION STYLES ===== */

.api-key-section {
    transition: all 0.3s ease;
}

.api-key-section .alert {
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.1), rgba(173, 216, 230, 0.1));
    border: 1px solid rgba(135, 206, 235, 0.3);
    border-radius: 10px;
    font-family: var(--serif-primary);
}

.api-key-section .input-group input {
    border: 1px solid rgba(135, 206, 235, 0.4);
    border-radius: 6px 0 0 6px;
    background: rgba(255, 255, 255, 0.9);
    font-family: var(--serif-primary);
}

.api-key-section .input-group button {
    border: 1px solid rgba(135, 206, 235, 0.4);
    border-left: none;
    background: var(--cathedral-blue-soft);
    color: white;
    font-family: var(--serif-primary);
    font-weight: 600;
    transition: all 0.3s ease;
}

.api-key-section .input-group button:hover {
    background: linear-gradient(135deg, #5dade2, #87ceeb);
    transform: translateY(-1px);
}

/* ===== INSIGHT RESULTS STYLES ===== */

.insight-results {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9), 
        rgba(248, 245, 240, 0.95)
    );
    border: 2px solid var(--cathedral-glow);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 
        0 8px 32px rgba(212, 175, 55, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.insight-results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--cathedral-gold), 
        var(--cathedral-gold-light), 
        var(--cathedral-gold)
    );
}

.insight-results .results-header h3 {
    color: var(--cathedral-deep);
    font-family: var(--serif-display);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.insight-results .search-summary {
    background: rgba(212, 175, 55, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--cathedral-gold);
    font-style: italic;
}

.insight-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--cathedral-deep);
    text-align: justify;
    padding: 1.5rem;
}

.insight-response .card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.1);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 768px) {
    .api-key-section .alert {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .insight-results {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .insight-content {
        font-size: 1rem;
        padding: 1rem;
    }
}

/* ===== FULL PAGE MEDITATION MODE ===== */
.meditation-fullpage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    overflow: auto;
}

.meditation-background {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(44, 90, 160, 0.9) 0%, 
        rgba(87, 173, 226, 0.8) 25%,
        rgba(135, 206, 235, 0.7) 50%,
        rgba(93, 173, 226, 0.8) 75%,
        rgba(44, 90, 160, 0.9) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="stars" cx="50%" cy="50%" r="50%"><stop offset="0%" style="stop-color:rgba(255,255,255,0.3)"/><stop offset="100%" style="stop-color:rgba(255,255,255,0)"/></radialGradient></defs><circle cx="20" cy="30" r="1" fill="rgba(255,255,255,0.8)"/><circle cx="80" cy="20" r="0.5" fill="rgba(255,255,255,0.6)"/><circle cx="60" cy="70" r="1.5" fill="rgba(255,255,255,0.7)"/><circle cx="30" cy="80" r="0.8" fill="rgba(255,255,255,0.5)"/><circle cx="90" cy="60" r="1" fill="rgba(255,255,255,0.8)"/><circle cx="10" cy="90" r="0.6" fill="rgba(255,255,255,0.4)"/><circle cx="70" cy="40" r="0.7" fill="rgba(255,255,255,0.6)"/><circle cx="40" cy="10" r="1.2" fill="rgba(255,255,255,0.9)"/></svg>');
    background-size: 200px 200px, cover;
    animation: starsTwinkle 20s linear infinite;
}

@keyframes starsTwinkle {
    0% { background-position: 0 0, center; }
    100% { background-position: 200px 200px, center; }
}

.meditation-overlay {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.meditation-back-btn {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.45rem 1.2rem;
    border: 1.5px solid rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    color: #1a1a1a;
    text-shadow: none;
    box-shadow: none;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.meditation-back-btn:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.6);
    color: #000;
    transform: translateX(-50%) translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.meditation-back-btn:active {
    transform: translateX(-50%);
}

.meditation-container {
    max-width: 800px;
    width: 100%;
}

.meditation-title {
    color: white;
    font-family: var(--serif-display);
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
}

.meditation-content-wrapper {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 3rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.timer-circle-large {
    width: 200px;
    height: 200px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.timer-text {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* ===== MEDITATION SHORTCUT ICON ===== */
.meditation-shortcut {
    position: fixed;
    top: 1.5rem;
    left: 2rem;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #2c5aa0, #1a3d6b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 2px solid white;
    font-size: 1.8rem;
    line-height: 1;
}

.meditation-shortcut:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #1a3d6b, #2c5aa0);
}

.meditation-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    white-space: nowrap;
    font-size: 0.7rem;
    font-family: 'Cinzel', serif;
    color: #d4af37;
    background: rgba(20, 10, 5, 0.85);
    padding: 4px 10px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    letter-spacing: 0.5px;
}

.meditation-shortcut:hover .meditation-tooltip {
    opacity: 1;
}

/* ===== SHARE BUTTON ===== */
.btn-share-insight {
    background: transparent;
    border: 1px solid var(--cathedral-gold);
    color: var(--cathedral-gold);
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-family: var(--serif-primary);
}

.btn-share-insight:hover {
    background: var(--cathedral-gold);
    color: white;
}

/* ===== COPY BUTTON ===== */
.btn-copy-result {
    background: transparent;
    border: 1px solid #333;
    color: #333;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-family: var(--serif-primary);
}

.btn-copy-result:hover {
    background: #333;
    color: white;
}

.btn-copy-result.copied {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.btn-pagination {
    background: transparent;
    border: 2px solid #333;
    color: #333;
    font-size: 1rem;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: var(--serif-primary);
    font-weight: 600;
}

.btn-pagination:hover {
    background: #333;
    color: white;
}

.btn-print-reading {
    background: transparent;
    border: 1px solid #333;
    color: #333;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-family: var(--serif-primary);
}

.btn-print-reading:hover {
    background: #333;
    color: white;
}

/* ===== INTERACTIVE TUTORIAL ===== */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: none;
    pointer-events: none;
}
.tutorial-overlay.active {
    display: block;
    pointer-events: auto;
}
.tutorial-overlay::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(20, 15, 10, 0.6);
    z-index: 1;
}
.tutorial-highlight {
    position: absolute;
    z-index: 2;
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(20, 15, 10, 0.6), 0 0 20px rgba(212,175,55,0.4);
    border: 2px solid rgba(212,175,55,0.6);
    transition: all 0.4s cubic-bezier(0.22,1,0.36,1);
    pointer-events: none;
}
.tutorial-tooltip {
    position: absolute;
    z-index: 3;
    max-width: 360px;
    width: 90vw;
    padding: 1.5rem;
    background: linear-gradient(170deg, #faf6ee, #f3edd8);
    border-radius: 10px;
    border: 1px solid #d4c9a8;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: all 0.4s cubic-bezier(0.22,1,0.36,1);
    opacity: 0;
    transform: translateY(8px);
}
.tutorial-overlay.active .tutorial-tooltip {
    transform: translateY(0);
}
.tutorial-step-indicator {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #b8943e;
    margin-bottom: 0.5rem;
}
.tutorial-text {
    font-family: 'Crimson Text', serif;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #3a2a1a;
    margin-bottom: 1rem;
}
.tutorial-buttons {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}
.tutorial-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.tutorial-skip {
    background: transparent;
    color: #2c1810;
    border: 1px solid #c9b99a;
    font-weight: 600;
}
.tutorial-skip:hover {
    background: rgba(0,0,0,0.05);
}
.tutorial-next {
    background: linear-gradient(135deg, #d4af37, #b8943e);
    color: white;
    box-shadow: 0 2px 8px rgba(212,175,55,0.3);
}
.tutorial-next:hover {
    box-shadow: 0 4px 12px rgba(212,175,55,0.5);
    transform: translateY(-1px);
}

/* ===== AFFIRMATION OVERLAY ===== */
.affirmation-book {
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
}
.affirmation-book:hover {
    color: #d4af37 !important;
    transform: scale(1.15);
}
.vision-book {
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
}
.vision-book:hover {
    color: #d4af37 !important;
    transform: scale(1.15);
}
#cayceVisionPlayer {
    transition: opacity 0.3s ease;
}
.affirmation-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(20, 15, 10, 0.75);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.affirmation-overlay.active {
    display: flex;
    opacity: 1;
}
.affirmation-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.2s ease;
}
.affirmation-scroll {
    max-width: 560px;
    width: 90%;
    padding: 2.5rem 2rem 1.5rem;
    background: linear-gradient(170deg, #faf6ee, #f3edd8);
    border-radius: 8px;
    border: 1px solid #d4c9a8;
    box-shadow: 0 12px 48px rgba(0,0,0,0.35), inset 0 0 40px rgba(212,175,55,0.08);
    text-align: center;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.22,1,0.36,1), opacity 0.6s ease;
}
.affirmation-overlay.active .affirmation-scroll {
    transform: scale(1);
    opacity: 1;
}
.affirmation-quill {
    font-size: 2rem;
    color: #b8943e;
    margin-bottom: 1rem;
}
.affirmation-body {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #3a2a1a;
    overflow: hidden;
}
.affirmation-body .aff-char {
    opacity: 0;
    display: inline;
    animation: charReveal 0.04s ease forwards;
}
@keyframes charReveal {
    to { opacity: 1; }
}
.affirmation-body .aff-char-english {
    font-size: 0.85em;
    color: #7a6a5a;
    font-style: italic;
}
.affirmation-body .aff-divider {
    display: block;
    margin: 0.75rem 0 0.5rem 0;
    opacity: 0;
    animation: charReveal 0.3s ease forwards;
    text-align: center;
}
.affirmation-hint {
    margin-top: 1.25rem;
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-size: 0.8rem;
    color: #a09080;
    letter-spacing: 0.5px;
}

/* ===== CLEAR SEARCH BUTTON ===== */
.search-input-icons {
    position: absolute;
    right: 6px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    z-index: 12;
}

.btn-clear-search {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-clear-search:hover {
    color: #222;
}

.search-container .input-group {
    position: relative;
}

.search-input {
    padding-right: 75px !important;
}

.search-mic-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.15rem;
    padding: 0.25rem 0.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.search-mic-btn:hover {
    color: #2c1810;
    background: transparent !important;
}
.search-mic-btn:focus,
.search-mic-btn:active {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}
.search-mic-btn.listening {
    color: #ee5a24;
    animation: search-mic-pulse 1.5s ease-in-out infinite;
    background: transparent !important;
}
@keyframes search-mic-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
body.dark-mode .search-mic-btn {
    color: #8a7a6a;
}
body.dark-mode .search-mic-btn:hover {
    color: #d0c6b8;
}
body.dark-mode .search-mic-btn.listening {
    color: #ee5a24;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cathedral-gold), var(--cathedral-gold-dark));
    color: white;
    border: 2px solid var(--cathedral-gold-light);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.back-to-top-btn.d-none {
    display: none !important;
}

/* ===== PRINT BUTTON ===== */
.btn-print-results {
    background: transparent;
    border: 1px solid #333;
    color: #333;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-family: var(--serif-primary);
}

.btn-print-results:hover {
    background: #333;
    color: white;
}

/* ===== RESULTS COUNT BADGE ===== */
.results-count-badge {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    font-size: 1.05rem;
    color: #333;
    margin-bottom: 1rem;
    font-family: var(--serif-primary);
    display: inline-block;
}

.results-count-badge strong {
    font-size: 1.3rem;
    color: #333;
}

/* ===== RESULTS HEADER FLEX ===== */
.results-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.results-header h3 {
    margin-bottom: 0;
}

/* ===== DARK MODE ===== */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e0d6c8;
}

body.dark-mode .cathedral-bg::before {
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(212, 175, 55, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.1) 0%, transparent 45%);
    opacity: 0.5;
}

body.dark-mode .search-sanctuary {
    background: rgba(30, 30, 50, 0.85);
    border-color: rgba(212, 175, 55, 0.3);
}

body.dark-mode .cathedral-title {
    color: var(--cathedral-gold-light);
}

body.dark-mode .subtitle {
    color: #b8a88a;
}

body.dark-mode .search-input {
    background: rgba(40, 40, 60, 0.9);
    color: #e0d6c8;
    border-color: rgba(212, 175, 55, 0.3);
}

body.dark-mode .search-input::placeholder {
    color: var(--cathedral-gold-light);
    opacity: 0.7;
}

body.dark-mode .input-group-text {
    background: rgba(40, 40, 60, 0.9);
    border-color: rgba(212, 175, 55, 0.3);
    color: #e0d6c8;
}

body.dark-mode .btn-outline-gold {
    background: rgba(30, 30, 50, 0.8);
    color: var(--cathedral-gold-light);
    border-color: rgba(212, 175, 55, 0.4);
}

body.dark-mode .btn-check:checked + .btn-outline-gold {
    background: rgba(212, 175, 55, 0.2);
    color: var(--cathedral-gold-light);
}

body.dark-mode #precisionMode + .btn-outline-gold .mode-title,
body.dark-mode #precisionMode + .btn-outline-gold .mode-description {
    color: var(--cathedral-gold-light);
}

body.dark-mode #insightMode + .btn-outline-gold .mode-title,
body.dark-mode #insightMode + .btn-outline-gold .mode-description {
    color: var(--cathedral-deep);
}

body.dark-mode .results-container {
    background: rgba(30, 30, 50, 0.85);
    border-color: rgba(212, 175, 55, 0.3);
}

body.dark-mode .result-item {
    background: rgba(40, 40, 60, 0.8);
    border-color: rgba(212, 175, 55, 0.2);
}

body.dark-mode .reading-text,
body.dark-mode .reading-background,
body.dark-mode .reading-reports {
    color: #d0c6b8;
}

body.dark-mode .insight-results {
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.9), rgba(40, 40, 60, 0.95));
}

body.dark-mode .insight-content {
    color: #d0c6b8;
}

body.dark-mode .snippet-card {
    background: rgba(40, 40, 60, 0.8);
    border-color: rgba(212, 175, 55, 0.2);
}

body.dark-mode .nav-tabs .nav-link {
    color: #b8a88a;
}

body.dark-mode .nav-tabs .nav-link.active {
    background: rgba(40, 40, 60, 0.9);
    color: var(--cathedral-gold-light);
    border-color: rgba(212, 175, 55, 0.7);
    border-width: 2px;
}

body.dark-mode footer {
    background: rgba(20, 20, 35, 0.5);
    border-top-color: rgba(212, 175, 55, 0.2);
}

body.dark-mode .footer-text {
    color: #b8a88a;
}

body.dark-mode .copyright {
    color: #a09080;
}

body.dark-mode .dropdown-menu {
    background: rgba(30, 30, 50, 0.95);
    border-color: rgba(212, 175, 55, 0.3);
}

body.dark-mode .dropdown-item {
    color: #d0c6b8;
}

body.dark-mode .dropdown-item:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--cathedral-gold-light);
}

body.dark-mode .btn-copy-result {
    border-color: var(--cathedral-gold);
    color: var(--cathedral-gold);
}

body.dark-mode .btn-copy-result:hover {
    background: var(--cathedral-gold);
    color: white;
}

body.dark-mode .btn-pagination {
    border-color: var(--cathedral-gold);
    color: var(--cathedral-gold);
}

body.dark-mode .btn-pagination:hover {
    background: var(--cathedral-gold);
    color: #1a1a2e;
}

body.dark-mode .btn-print-reading {
    border-color: var(--cathedral-gold);
    color: var(--cathedral-gold);
}

body.dark-mode .btn-print-reading:hover {
    background: var(--cathedral-gold);
    color: white;
}

body.dark-mode .btn-print-results {
    border-color: var(--cathedral-gold);
    color: var(--cathedral-gold);
}

body.dark-mode .btn-print-results:hover {
    background: var(--cathedral-gold);
    color: white;
}

body.dark-mode .results-count-badge {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
    color: #d0c6b8;
    border-color: rgba(212, 175, 55, 0.25);
}

body.dark-mode .modal-content {
    background: #1e1e32;
    color: #d0c6b8;
}

body.dark-mode .modal-header {
    background: rgba(30, 30, 50, 0.95);
    border-bottom-color: rgba(212, 175, 55, 0.3);
}

body.dark-mode .modal-title {
    color: #e8dcc8;
}

body.dark-mode .modal-body,
body.dark-mode .modal-body p,
body.dark-mode .modal-body h4,
body.dark-mode .modal-body h5,
body.dark-mode .modal-body span,
body.dark-mode .modal-body strong {
    color: #d0c6b8 !important;
}

body.dark-mode .modal-body a {
    color: #d4af37;
}

body.dark-mode .modal-body .contact-item,
body.dark-mode .modal-body .contact-item span {
    color: #d0c6b8 !important;
}

body.dark-mode .modal-footer {
    background: rgba(30, 30, 50, 0.95);
    border-top-color: rgba(212, 175, 55, 0.3);
}

body.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body.dark-mode .about-section {
    background: rgba(30, 30, 50, 0.9);
    border-color: rgba(212, 175, 55, 0.3);
}

body.dark-mode .about-section h2 {
    color: #e8dcc8;
    border-bottom-color: rgba(212, 175, 55, 0.3);
}

body.dark-mode .about-section p,
body.dark-mode .about-section .about-highlight {
    color: #d0c6b8 !important;
}

body.dark-mode .about-header h1 {
    color: #e8dcc8;
}

body.dark-mode .about-header .about-subtitle {
    color: #b0a090;
}

body.dark-mode .about-back-link {
    color: #d4af37;
}

body.dark-mode .about-close-btn {
    background: rgba(30, 30, 50, 0.95);
    color: #d0c6b8;
    border-color: #d4af37;
}

body.dark-mode .about-cta {
    background: linear-gradient(135deg, rgba(212,175,55,0.1), rgba(212,175,55,0.2));
}

body.dark-mode .about-cta p {
    color: #d0c6b8 !important;
}

body.dark-mode .alert {
    background: rgba(40, 40, 60, 0.8);
    border-color: rgba(212, 175, 55, 0.3);
    color: #d0c6b8;
}

body.dark-mode .highlight {
    background-color: rgba(212, 175, 55, 0.3);
    color: #fff;
}

body.dark-mode .book-list li {
    color: #d0c6b8;
}

body.dark-mode .reading-ref {
    background: rgba(40, 40, 60, 0.8);
    color: #d0c6b8;
}

body.dark-mode .btn-clear-search {
    color: #8a7a6a;
}

body.dark-mode .btn-clear-search:hover {
    color: #d0c6b8;
}

@media print {
    .back-to-top-btn,
    .meditation-shortcut,
    #mainHamburgerMenu,
    .search-sanctuary,
    footer,
    .cathedral-bg,
    .btn-copy-result,
    .btn-print-results,
    .btn-print-reading {
        display: none !important;
    }
    
    .result-item.printing-single {
        display: block !important;
    }
    
    .result-item:not(.printing-single) {
        display: none !important;
    }
    
    body.printing-single-reading .results-header,
    body.printing-single-reading .results-count-badge {
        display: none !important;
    }
    
    body:not(.printing-single-reading) .result-item {
        display: block !important;
    }
    
    .results-container {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    body.dark-mode {
        background: white !important;
        color: black !important;
    }
    
    body.dark-mode .results-container,
    body.dark-mode .result-item,
    body.dark-mode .insight-results,
    body.dark-mode .insight-content,
    body.dark-mode .reading-text,
    body.dark-mode .snippet-card {
        background: white !important;
        color: black !important;
    }
}

.language-selector {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    position: relative;
    margin-top: 0.5rem;
}
.language-globe {
    font-size: 1.15rem;
    color: #d4af37;
    transition: transform 0.3s ease, color 0.2s;
}
.language-selector:hover .language-globe {
    transform: rotate(20deg);
    color: #87ceeb;
}
.language-current {
    font-family: var(--serif-primary);
    font-size: 0.85rem;
    color: #555;
    font-weight: 600;
}
.language-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1.5px solid #d4af37;
    border-radius: 10px;
    padding: 0.4rem 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 10000;
    min-width: 140px;
    margin-bottom: 6px;
}
.language-dropdown.open {
    display: block;
    animation: langFadeIn 0.2s ease;
}
@keyframes langFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.language-option {
    display: block;
    width: 100%;
    padding: 0.45rem 1rem;
    font-family: var(--serif-primary);
    font-size: 0.9rem;
    color: #333;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}
.language-option:hover {
    background: rgba(212,175,55,0.12);
}
.language-option.active {
    color: #d4af37;
    font-weight: 700;
}
.language-option .lang-check {
    float: right;
    color: #d4af37;
}
