/*
Theme Name: Premmoy Uponnash
Theme URI: https://codevibestudio.com/premmoy
Author: Premmoy Team
Author URI: https://codevibestudio.com
Description: Fast, lightweight, mobile-first Bengali novel reading theme tailored for Google SEO indexing, Rank Math integration, and maximum Android app downloads.
Version: 1.0.1
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: premmoy-theme
*/

@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700;800&display=swap');

/* Reset & Global Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'SolaimanLipi', 'Hind Siliguri', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1A1A1A;
    background-color: #F8F9FA;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input {
    font-family: inherit;
    outline: none;
    border: none;
}


/* ==========================================================================
   Premmoy App Core Design System
   Matches Android App: com.premmoy.uponnash
   ========================================================================== */

/* Typography: SolaimanLipi */
@font-face {
    font-family: 'SolaimanLipi';
    src: url('../fonts/solaiman_lipi.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Hind Siliguri';
    src: url('../fonts/hind_siliguri_medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-plum: #5C1A4A;
    --primary-plum-dark: #3A0F2E;
    --primary-plum-light: #F5E8F0;
    --accent-rose: #E91E8C;
    --accent-rose-dark: #B5136D;
    --accent-rose-light: #FCE4F3;
    --surface-white: #FFFFFF;
    --surface-offwhite: #F8F9FA;
    --surface-gray: #F0F2F5;
    --border-subtle: #EDE8ED;
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-muted: #888888;
    --status-green: #2E7D32;
    --status-green-bg: #E8F5E9;
    --status-blue: #1565C0;
    --status-blue-bg: #E3F2FD;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-card: 0 4px 14px rgba(92, 26, 74, 0.07);
    --shadow-hover: 0 8px 24px rgba(92, 26, 74, 0.12);
}

/* App Viewport Shell: Mobile-First Focus */
.app-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--surface-white);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
}

@media (min-width: 601px) {
    body {
        background-color: #ECEFF1;
    }
}

/* Header Section (Replicates Android Top Bar) */
.app-header {
    height: 56px;
    background: var(--surface-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 990;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-plum);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-plum);
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease;
}

.header-icon-btn:hover {
    background: var(--primary-plum-light);
}

/* Breadcrumbs (SEO & Navigation) */
.app-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 10px 16px;
    background: var(--surface-offwhite);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    white-space: nowrap;
}

.app-breadcrumbs a {
    color: var(--primary-plum);
    font-weight: 600;
}

.app-breadcrumbs span.sep {
    display: inline-flex;
    align-items: center;
    color: #BBBBBB;
}

/* Category Filter Chips / Pills (Horizontal Scroll) */
.category-chips-wrapper {
    padding: 12px 16px;
    background: var(--surface-white);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-chips-wrapper::-webkit-scrollbar {
    display: none;
}

.category-chips {
    display: inline-flex;
    gap: 8px;
}

.chip-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 600;
    background: var(--surface-gray);
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.chip-item.active, .chip-item:hover {
    background: var(--primary-plum-light);
    color: var(--primary-plum);
    border-color: rgba(92, 26, 74, 0.2);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 10px 16px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-plum);
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--accent-rose);
    border-radius: 2px;
}

.section-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-rose-dark);
}

/* Trending Slider (Replicates item_slider_book.xml) */
.slider-container {
    padding: 4px 16px 16px 16px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    display: flex;
    gap: 12px;
}

.slider-container::-webkit-scrollbar {
    display: none;
}

.slider-card {
    flex: 0 0 130px;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    background: var(--surface-white);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.slider-card:active {
    transform: scale(0.98);
}

.slider-cover-wrap {
    width: 130px;
    height: 175px;
    position: relative;
    overflow: hidden;
    background: #E0E0E0;
}

.slider-cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-info {
    padding: 8px 10px;
}

.slider-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.slider-author {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
}

/* Novel List Grid (Replicates item_popular_novel.xml) */
.novel-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 16px 20px 16px;
}

.novel-card {
    display: flex;
    gap: 14px;
    background: var(--surface-white);
    padding: 12px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
}

.novel-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(92, 26, 74, 0.15);
}

.novel-cover {
    width: 82px;
    height: 114px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    background: #E0E0E0;
}

.novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novel-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.novel-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.novel-author-pill {
    display: inline-flex;
    align-self: flex-start;
    padding: 2px 10px;
    background: var(--primary-plum-light);
    color: var(--primary-plum);
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 700;
    margin-top: 6px;
}

.novel-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.78rem;
}

.novel-views {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
}

.status-badge.ongoing {
    background: var(--status-green-bg);
    color: var(--status-green);
}

.status-badge.completed {
    background: var(--status-blue-bg);
    color: var(--status-blue);
}

/* ==========================================================================
   Book Details Screen (Replicates activity_book_details.xml)
   ========================================================================== */
.book-details-hero {
    background: linear-gradient(180deg, var(--primary-plum-light) 0%, var(--surface-white) 100%);
    padding: 18px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.book-hero-card {
    display: flex;
    gap: 16px;
}

.book-hero-cover {
    width: 110px;
    height: 154px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    background: #DDDDDD;
}

.book-hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-hero-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-hero-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-plum-dark);
    line-height: 1.3;
}

.book-hero-author {
    display: inline-block;
    padding: 3px 12px;
    background: var(--primary-plum);
    color: #FFFFFF;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 8px;
    align-self: flex-start;
}

.book-hero-genre {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.book-hero-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: auto;
    padding-top: 10px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Dual Action Buttons (Web Read & App Download) */
.book-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.btn-read-web {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    background: var(--primary-plum);
    color: #FFFFFF;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(92, 26, 74, 0.25);
    transition: opacity 0.2s ease;
}

.btn-read-web:active {
    opacity: 0.9;
}

.btn-app-install {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    background: #00875A;
    color: #FFFFFF;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0, 135, 90, 0.25);
    transition: opacity 0.2s ease;
}

.btn-app-install:active {
    opacity: 0.9;
}

/* Chapter List Container */
.chapter-section {
    padding: 18px 16px 30px 16px;
}

.chapter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.chapter-count-badge {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-plum);
    background: var(--primary-plum-light);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chapter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.chapter-item:hover, .chapter-item:active {
    background: var(--primary-plum-light);
    border-color: rgba(92, 26, 74, 0.2);
}

.chapter-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.chapter-num {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--surface-gray);
    color: var(--primary-plum);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.chapter-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-item-arrow {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 20px 16px;
}

.pagination .page-numbers {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pagination .page-numbers.current {
    background: var(--primary-plum);
    color: #FFFFFF;
    border-color: var(--primary-plum);
}


/* ==========================================================================
   Premmoy Smart App Banner & Conversion Styles
   Engineered for Maximum Play Store Installs
   ========================================================================== */

/* Top Smart App Banner */
.smart-app-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0D1433; /* Primary dark 900 */
    color: #FFFFFF;
    padding: 8px 12px;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

/* Push sticky banner down if WordPress Admin Bar is present */
.admin-bar .smart-app-banner {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .smart-app-banner {
        top: 46px;
    }
}

.smart-app-banner.dismissed {
    display: none !important;
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.banner-close-btn {
    background: transparent;
    border: none;
    color: #A0A5BA;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.banner-app-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: linear-gradient(135deg, #E91E8C, #5C1A4A);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    color: #FFFFFF;
    font-weight: 800;
    font-size: 1.1rem;
}

.banner-text-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.banner-app-name {
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #FFFFFF;
}

.banner-app-rating {
    font-size: 0.72rem;
    color: #FFC107;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 1px;
}

.banner-app-rating span.rating-count {
    color: #A0A5BA;
    font-size: 0.68rem;
}

.banner-install-btn {
    background: #00875A; /* Google Play green */
    color: #FFFFFF;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 135, 90, 0.4);
    transition: transform 0.15s ease;
}

.banner-install-btn:active {
    transform: scale(0.95);
}

/* Floating Bottom In-Reader Bar */
.floating-reader-cta {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 560px;
    background: rgba(13, 20, 51, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #FFFFFF;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 998;
    border: 1px solid rgba(255, 255, 255, 0.12);
    animation: slideUpFloating 0.4s ease-out;
}

@keyframes slideUpFloating {
    from {
        transform: translate(-50%, 40px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.floating-cta-text {
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #FFFFFF;
}

.floating-cta-btn {
    background: var(--accent-rose);
    color: #FFFFFF;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.floating-cta-btn:active {
    transform: scale(0.95);
}


/* ==========================================================================
   Premmoy Reader Stylesheet
   Matches Android App: activity_reader.xml
   ========================================================================== */

/* Reading Progress Bar (Fixed at top) */
.reader-progress-bar-wrap {
    position: sticky;
    top: 56px;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.06);
    z-index: 995;
}

.reader-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-plum);
    transition: width 0.1s ease;
}

/* Reader Toolbar & Settings Bar */
.reader-settings-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--surface-offwhite);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
}

.font-size-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-font-size {
    padding: 4px 10px;
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}

.theme-switches {
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-btn {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.theme-btn:active {
    transform: scale(0.9);
}

.theme-btn.active {
    border-color: var(--primary-plum);
    box-shadow: 0 0 0 2px rgba(92, 26, 74, 0.3);
}

.theme-btn-light {
    background: #FFFFFF;
    border: 1px solid #D0D0D0;
}

.theme-btn-sepia {
    background: #F4ECD8;
    border: 1px solid #D7C6A6;
}

.theme-btn-dark {
    background: #121212;
    border: 1px solid #333333;
}

/* Chapter Container & Typography */
.reader-viewport {
    padding: 20px 18px 40px 18px;
    min-height: calc(100vh - 120px);
    transition: background 0.3s ease, color 0.3s ease;
}

.chapter-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--border-subtle);
}

.chapter-novel-parent-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-plum);
    margin-bottom: 8px;
}

.chapter-main-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary-plum-dark);
    line-height: 1.35;
}

.chapter-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* The Novel Content itself: SolaimanLipi, optimized reading */
.reader-content {
    font-family: 'SolaimanLipi', -apple-system, sans-serif;
    font-size: 19px;
    line-height: 1.85;
    color: #222222;
    letter-spacing: 0.1px;
}

.reader-content p {
    margin-bottom: 1.4em;
    text-align: justify;
}

/* ==========================================================================
   Reader Themes (Light, Sepia, Dark)
   Matches Theme.Premmoy.Sepia & Theme.Premmoy.DeepNight
   ========================================================================== */
/* Sepia Theme */
body.reader-theme-sepia .app-container,
body.reader-theme-sepia .reader-viewport {
    background-color: #F4ECD8 !important;
    color: #3E2723 !important;
}

body.reader-theme-sepia .reader-content,
body.reader-theme-sepia .chapter-main-title {
    color: #3E2723 !important;
}

body.reader-theme-sepia .app-header,
body.reader-theme-sepia .reader-settings-bar {
    background: #EAD9C0 !important;
    border-color: #DECDB3 !important;
}

body.reader-theme-sepia .reader-progress-bar {
    background: #8B5A2B !important;
}

/* Deep Night (Dark Mode) Theme */
body.reader-theme-dark .app-container,
body.reader-theme-dark .reader-viewport {
    background-color: #121212 !important;
    color: #D1A3FF !important;
}

body.reader-theme-dark .reader-content {
    color: #DDDDDD !important;
}

body.reader-theme-dark .chapter-main-title {
    color: #FFFFFF !important;
}

body.reader-theme-dark .app-header,
body.reader-theme-dark .reader-settings-bar {
    background: #1E1E1E !important;
    border-color: #2A2A2A !important;
}

body.reader-theme-dark .header-title {
    color: #D1A3FF !important;
}

body.reader-theme-dark .reader-progress-bar {
    background: #D1A3FF !important;
}

/* ==========================================================================
   Completion Block (Matches layoutCompletionBlock in activity_reader.xml)
   ========================================================================== */
.chapter-completion-card {
    margin-top: 36px;
    padding: 24px 18px;
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(92, 26, 74, 0.08);
    border: 1px solid var(--border-subtle);
    text-align: center;
}

.completion-badge {
    font-size: 2.2rem;
    margin-bottom: 6px;
}

.completion-heading {
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--primary-plum);
    margin-bottom: 4px;
}

.completion-subtext {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

/* Chapter Navigation (Next / Previous) */
.chapter-nav-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.btn-nav-prev, .btn-nav-next {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 46px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-nav-prev {
    background: var(--surface-gray);
    color: var(--text-primary);
}

.btn-nav-next {
    background: var(--primary-plum);
    color: #FFFFFF;
}

.btn-nav-next.single-full {
    grid-column: span 2;
}

/* The Big App Download Callout inside completion card */
.completion-app-callout {
    background: linear-gradient(135deg, #FAF0F6 0%, #F5E8F0 100%);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
    border: 1px dashed rgba(92, 26, 74, 0.3);
}

.completion-app-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--primary-plum-dark);
    margin-bottom: 6px;
}

.completion-app-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.45;
}

.btn-google-play-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #0D1433;
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(13, 20, 51, 0.3);
    transition: transform 0.2s ease;
}

.btn-google-play-badge:active {
    transform: scale(0.97);
}


/* ==========================================================================
   Category Navigation Drawer (Slide-in Menu)
   ========================================================================== */
.drawer-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 20, 51, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
}

.drawer-backdrop.active {
    display: block;
}

.category-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 82%;
    max-width: 320px;
    height: 100%;
    background: var(--surface-white);
    z-index: 99999;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.25);
    flex-direction: column;
    overflow-y: auto;
}

.category-drawer.active {
    display: flex;
}

.drawer-header {
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-plum-dark) 0%, var(--primary-plum) 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.drawer-brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #FFFFFF;
}

.drawer-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #FFFFFF;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
}

.drawer-body {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.drawer-section-title {
    padding: 8px 16px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.drawer-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.drawer-category-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--surface-gray);
    transition: background 0.15s ease, color 0.15s ease;
}

.drawer-category-item a:hover,
.drawer-category-item a:active {
    background: var(--primary-plum-light);
    color: var(--primary-plum);
}

.drawer-category-item a .cat-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-category-item a .cat-icon {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    background: var(--surface-gray);
    color: var(--primary-plum);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.drawer-category-item a .cat-arrow {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.drawer-footer {
    padding: 16px;
    background: var(--surface-offwhite);
    border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Content Badges & Segmented Type Filter
   ========================================================================== */
.cover-type-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
    line-height: 1.3;
}

.cover-type-badge.badge-audio {
    background: linear-gradient(135deg, #E91E8C 0%, #7A185E 100%);
    color: #FFFFFF;
}

.cover-type-badge.badge-ebook {
    background: rgba(25, 25, 25, 0.82);
    color: #FFFFFF;
}

.content-type-filter-bar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    scrollbar-width: none;
}

.content-type-filter-bar::-webkit-scrollbar {
    display: none;
}

.type-filter-btn {
    background: var(--surface-gray);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.type-filter-btn:hover {
    background: var(--primary-plum-light);
    color: var(--primary-plum);
}

.type-filter-btn.active {
    background: var(--primary-plum);
    color: #FFFFFF;
    border-color: var(--primary-plum);
    box-shadow: 0 2px 8px rgba(92, 26, 74, 0.25);
}

/* ==========================================================================
   Dedicated Audio Highlight Section
   ========================================================================== */
.audio-highlight-section {
    background: linear-gradient(180deg, #FBF4F9 0%, #FFFFFF 100%);
    border-top: 1px solid #F3E6EE;
    border-bottom: 1px solid #F3E6EE;
    padding-top: 14px;
    padding-bottom: 14px;
}

.audio-slider-card .slider-audio-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: all 0.2s ease;
}

.audio-slider-card:hover .slider-audio-play-overlay {
    background: rgba(233, 30, 140, 0.4);
    opacity: 1;
}

.audio-views-count {
    display: inline-block;
    margin-top: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-rose);
}

/* ==========================================================================
   Audiobook Player Screen
   Matches Android App: activity_audio_main.xml
   ========================================================================== */
.audio-player-viewport {
    max-width: 600px;
    margin: 0 auto;
    padding: 12px 16px 40px 16px;
}

.audio-parent-header {
    margin-bottom: 14px;
}

.audio-player-card {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    padding: 24px 20px 20px 20px;
    text-align: center;
}

.audio-cover-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-bottom: 16px;
}

.audio-cover-ring {
    width: 170px;
    height: 170px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 24px rgba(92, 26, 74, 0.22);
    border: 3px solid #FFFFFF;
    transition: transform 0.3s ease;
}

.audio-cover-ring.playing {
    box-shadow: 0 0 0 4px rgba(233, 30, 140, 0.35), 0 8px 26px rgba(92, 26, 74, 0.3);
}

.audio-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.audio-type-pill {
    position: absolute;
    bottom: -10px;
    background: linear-gradient(135deg, #E91E8C, #5C1A4A);
    color: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    white-space: nowrap;
}

.audio-track-info {
    margin-top: 14px;
    margin-bottom: 18px;
}

.audio-track-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-plum);
    line-height: 1.35;
    margin-bottom: 6px;
}

.audio-track-novel {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.audio-track-author {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Audio Progress */
.audio-progress-container {
    margin: 16px 0;
}

.audio-time-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.audio-progress-slider {
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: #E8DEE5;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.audio-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-rose);
    box-shadow: 0 2px 6px rgba(233, 30, 140, 0.4);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.audio-progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Controls */
.audio-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin: 16px 0;
}

.audio-seek-btn {
    background: var(--surface-gray);
    color: var(--primary-plum);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    transition: all 0.15s ease;
}

.audio-seek-btn:active {
    transform: scale(0.92);
    background: var(--primary-plum-light);
}

.audio-play-master {
    background: linear-gradient(135deg, #7A185E 0%, #E91E8C 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    width: 66px;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(233, 30, 140, 0.42);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.audio-play-master:active {
    transform: scale(0.94);
    box-shadow: 0 3px 10px rgba(233, 30, 140, 0.3);
}

.audio-sub-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.audio-speed-btn {
    background: var(--surface-gray);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

/* In-Player App Advantage Callout */
.audio-app-callout {
    margin-top: 20px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #FDF7FA 0%, #F5EAF1 100%);
    border: 1px dashed rgba(233, 30, 140, 0.35);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
}

.callout-text strong {
    font-size: 0.85rem;
    color: var(--primary-plum);
    display: block;
    margin-bottom: 2px;
}

.callout-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.btn-audio-callout-install {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #00875A;
    color: #FFFFFF;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 135, 90, 0.25);
    flex-shrink: 0;
}

.chapter-item.active-track {
    background: #FCF1F7;
    border-left: 4px solid var(--accent-rose);
}

/* ==========================================================================
   4-Minute Conversion Soft-Lock Modal
   ========================================================================== */
.audio-lock-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(18, 5, 15, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: lockFadeIn 0.3s ease;
}

@keyframes lockFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.audio-lock-modal {
    background: #FFFFFF;
    border-radius: 20px;
    max-width: 440px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    animation: lockScaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

@keyframes lockScaleUp {
    from { transform: scale(0.88); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.audio-lock-header {
    background: linear-gradient(135deg, #5C1A4A 0%, #E91E8C 100%);
    padding: 24px 20px 20px 20px;
    color: #FFFFFF;
}

.audio-lock-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin: 0 auto 12px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.audio-lock-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.35;
}

.audio-lock-body {
    padding: 22px 20px 24px 20px;
}

.audio-lock-badge {
    display: inline-block;
    background: #FFF3E0;
    color: #E65100;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid #FFE0B2;
}

.audio-lock-desc {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 14px;
}

.audio-lock-perks {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    text-align: left;
    background: var(--surface-offwhite);
    border-radius: 12px;
    padding: 12px 14px;
}

.audio-lock-perks li {
    font-size: 0.82rem;
    font-weight: 600;
    color: #333333;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-lock-perks .perk-check {
    color: #00875A;
    font-weight: 800;
}

.audio-lock-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-audio-lock-install {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #00875A;
    color: #FFFFFF;
    padding: 13px 20px;
    border-radius: 28px;
    font-size: 0.95rem;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(0, 135, 90, 0.35);
    transition: transform 0.15s ease, background 0.15s ease;
}

.btn-audio-lock-install:hover {
    background: #006644;
}

.btn-audio-lock-install:active {
    transform: scale(0.98);
}

.btn-audio-lock-continue {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.btn-audio-lock-continue:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

