/* ==========================================================================
   KANUPAPA BHAKTI & STOTRAS (శ్రీ కనుపాప భక్తి - నిత్య పారాయణ స్తోత్రాలు)
   Elder-friendly, ultra-lightweight, zero-lag design for Smart TV & Mobile
   ========================================================================== */

/* Fullscreen Modal Overlay */
.bhakti-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 7, 13, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    animation: bhaktiFadeIn 0.25s ease-out forwards;
}

@keyframes bhaktiFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.bhakti-modal-card {
    width: 100%;
    max-width: 980px;
    height: 94vh;
    max-height: 920px;
    background: linear-gradient(165deg, #131722 0%, #0d111a 100%);
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.15);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #f8fafc;
}

/* Header Bar */
/* Header Bar - Compact & Clean */
.bhakti-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.14) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
    gap: 10px;
    min-height: 52px;
}

.bhakti-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.bhakti-header-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(90deg, #fef3c7, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header elements in Reader Mode */
.bhakti-header-back-btn {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fef08a;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.bhakti-header-back-btn:hover,
.bhakti-header-back-btn:focus-visible {
    background: #f59e0b;
    color: #0f172a;
    outline: none;
}

.bhakti-header-stotra-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fef08a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
}

.bhakti-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Elder Font Size Controls: A- [18] A+ */
.bhakti-font-controls {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    padding: 2px 4px;
    gap: 2px;
}

.bhakti-font-btn {
    background: transparent;
    border: none;
    color: #fef3c7;
    font-size: 0.92rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bhakti-font-btn:hover,
.bhakti-font-btn:focus-visible {
    background: rgba(245, 158, 11, 0.3);
    color: #fff;
    outline: none;
}

.bhakti-font-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: #f59e0b;
    padding: 0 4px;
    min-width: 26px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.bhakti-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.bhakti-close-btn:hover,
.bhakti-close-btn:focus-visible {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
    transform: rotate(90deg);
}

/* Category Filter Bar */
.bhakti-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    scrollbar-width: thin;
}

.bhakti-filter-bar::-webkit-scrollbar {
    height: 4px;
}

.bhakti-filter-bar::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.3);
    border-radius: 4px;
}

.bhakti-category-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.bhakti-category-pill.active {
    background: linear-gradient(135deg, #d97706, #b45309);
    border-color: #f59e0b;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(217, 119, 6, 0.4);
}

.bhakti-category-pill:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

/* Body Content Area */
.bhakti-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 158, 11, 0.35) transparent;
}

.bhakti-body::-webkit-scrollbar {
    width: 8px;
}

.bhakti-body::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.35);
    border-radius: 4px;
}

/* ==========================================================================
   LIST VIEW: DEVOTIONAL GRANTHAVALI / BOOK INDEX (విషయ సూచిక శైలి)
   Single clean row per item, zero cluttered icons/descriptions
   ========================================================================== */
.bhakti-index-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0 20px 0;
    max-width: 860px;
    margin: 0 auto;
}

.bhakti-index-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(245, 158, 11, 0.16);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    color: #f8fafc;
    position: relative;
    user-select: none;
}

.bhakti-index-row:hover,
.bhakti-index-row:focus-visible {
    background: rgba(245, 158, 11, 0.16);
    border-color: #f59e0b;
    transform: translateX(4px);
    outline: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.bhakti-index-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.bhakti-index-num {
    font-size: 0.95rem;
    font-weight: 800;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 8px;
    padding: 3px 8px;
    min-width: 32px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.bhakti-index-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fef08a;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bhakti-index-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.bhakti-index-time {
    font-size: 0.8rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bhakti-index-arrow {
    font-size: 1.4rem;
    line-height: 1;
    color: #f59e0b;
    font-weight: 700;
}

/* ==========================================================================
   READER VIEW (STOTRA READING INTERFACE FOR ELDERS & TV)
   Maximum screen real estate, no floating card blocking text
   ========================================================================== */
.bhakti-reader-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 820px;
    margin: 0 auto;
    padding-bottom: 30px;
}

/* Stotra Section Header */
.bhakti-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 10px 0;
}

.bhakti-section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.5), transparent);
}

.bhakti-section-line.right {
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.5));
}

.bhakti-section-title-pill {
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fef3c7;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 5px 16px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Verse Card */
.bhakti-verse-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s ease;
}

.bhakti-verse-card:hover,
.bhakti-verse-card:focus-visible {
    border-color: rgba(245, 158, 11, 0.5);
    outline: none;
}

.bhakti-verse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.bhakti-verse-num-badge {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fef08a;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
}

/* Sloka Text - Responsive Font Size based on Elder Mode */
.bhakti-sloka-text {
    font-family: 'Gautami', 'Mandali', 'Suranna', 'Inter', system-ui, sans-serif;
    font-weight: 700;
    color: #ffffff;
    font-size: var(--bhakti-font-size, 18px);
    line-height: 1.85;
    white-space: pre-line;
    margin-bottom: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.2px;
}

/* Meaning Box */
.bhakti-meaning-box {
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid #f59e0b;
    border-radius: 0 10px 10px 0;
    padding: 10px 14px;
    font-size: calc(var(--bhakti-font-size, 18px) * 0.88);
    color: #cbd5e1;
    line-height: 1.6;
}

.bhakti-meaning-box strong {
    color: #fef08a;
    font-weight: 700;
}

/* Mobile & TV Floating Button */
.btn-mobile-bottom-bhakti {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d97706, #92400e);
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.45);
    border-radius: 12px;
    padding: 6px 12px;
    cursor: pointer;
    color: #ffffff;
    transition: transform 0.15s ease;
}

.btn-mobile-bottom-bhakti:hover,
.btn-mobile-bottom-bhakti:focus-visible {
    transform: scale(1.05);
    outline: none;
    border-color: #f59e0b;
}

.bhakti-floating-icon {
    font-size: 1.25rem;
}

.bhakti-floating-text {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Mobile Back Navigation: Hide close button on mobile phone so user uses Android system/bottom back button */
body.role-mobile .bhakti-close-btn {
    display: none !important;
}

@media (max-width: 768px) {
    .bhakti-close-btn {
        display: none !important;
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .bhakti-modal-card {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
    .bhakti-modal-overlay {
        padding: 0;
    }
    .bhakti-header-bar {
        padding: 10px 14px;
    }
    .bhakti-header-title {
        font-size: 1.15rem;
    }
    .bhakti-header-subtitle {
        display: none;
    }
    .bhakti-stotras-grid {
        grid-template-columns: 1fr;
    }
    .bhakti-verse-card {
        padding: 14px 16px;
    }
}
