/* ==========================================================================
   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 */
.bhakti-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.05) 100%);
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
    gap: 12px;
}

.bhakti-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bhakti-header-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.5));
}

.bhakti-header-title-box {
    display: flex;
    flex-direction: column;
}

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

.bhakti-header-subtitle {
    font-size: 0.82rem;
    color: #cbd5e1;
}

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

/* Elder Font Size Controls */
.bhakti-font-controls {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 3px 6px;
    gap: 4px;
}

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

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

.bhakti-font-label {
    font-size: 0.8rem;
    color: #cbd5e1;
    padding: 0 4px;
    white-space: nowrap;
}

.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 (STOTRA CARDS GRID) */
.bhakti-stotras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.bhakti-stotra-card {
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.bhakti-stotra-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #f59e0b, #d97706);
    opacity: 0.6;
    transition: width 0.2s ease, opacity 0.2s ease;
}

.bhakti-stotra-card:hover,
.bhakti-stotra-card:focus-visible {
    transform: translateY(-3px) scale(1.01);
    border-color: #f59e0b;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.25);
    outline: none;
}

.bhakti-stotra-card:hover::before,
.bhakti-stotra-card:focus-visible::before {
    width: 6px;
    opacity: 1;
}

.bhakti-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.bhakti-card-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.4));
}

.bhakti-card-badge {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fef3c7;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

.bhakti-card-title {
    margin: 0 0 6px 0;
    font-size: 1.22rem;
    font-weight: 800;
    color: #fef08a;
    line-height: 1.35;
}

.bhakti-card-eng {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 8px;
    font-weight: 500;
}

.bhakti-card-summary {
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.45;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bhakti-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 12px;
}

.bhakti-card-time {
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.bhakti-btn-read {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
    border: none;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 7px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bhakti-btn-read:hover,
.bhakti-btn-read:focus-visible {
    background: #fbbf24;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    outline: none;
}

/* ==========================================================================
   READER VIEW (STOTRA READING INTERFACE FOR ELDERS & TV)
   ========================================================================== */
.bhakti-reader-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 820px;
    margin: 0 auto;
}

.bhakti-reader-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 14px;
    padding: 10px 16px;
    position: sticky;
    top: -10px;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.bhakti-btn-back {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fef08a;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.bhakti-btn-back:hover,
.bhakti-btn-back:focus-visible {
    background: rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
    outline: none;
}

.bhakti-reader-header-meta {
    text-align: center;
}

.bhakti-reader-stotra-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fef08a;
}

.bhakti-reader-deity-pill {
    font-size: 0.8rem;
    color: #cbd5e1;
}

/* Stotra Section Header */
.bhakti-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 12px 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.18);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fef3c7;
    font-size: 1rem;
    font-weight: 700;
    padding: 6px 18px;
    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: 16px;
    padding: 20px 24px;
    margin-bottom: 16px;
    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: 12px;
}

.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.8rem;
    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;
    line-height: 1.85;
    white-space: pre-line;
    margin-bottom: 14px;
    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: 0.95rem;
    color: #cbd5e1;
    line-height: 1.6;
}

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

/* Dynamic Font Sizes for Elder & TV Mode */
.bhakti-font-normal .bhakti-sloka-text {
    font-size: 1.25rem;
}
.bhakti-font-large .bhakti-sloka-text {
    font-size: 1.55rem;
}
.bhakti-font-xlarge .bhakti-sloka-text {
    font-size: 1.95rem;
    line-height: 1.95;
}

.bhakti-font-normal .bhakti-meaning-box {
    font-size: 0.92rem;
}
.bhakti-font-large .bhakti-meaning-box {
    font-size: 1.05rem;
}
.bhakti-font-xlarge .bhakti-meaning-box {
    font-size: 1.25rem;
}

/* 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;
}

/* 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;
    }
}
