/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Local Fonts */
@font-face {
    font-family: 'Kalpurush';
    src: url('assets/fonts/Kalpurush.ttf') format('truetype');
}

@font-face {
    font-family: 'Noorehira';
    src: url('assets/fonts/noorehira.ttf') format('truetype');
}

@font-face {
    font-family: 'Noorehuda';
    src: url('assets/fonts/noorehuda.ttf') format('truetype');
}

@font-face {
    font-family: 'SiyamRupali';
    src: url('assets/fonts/siyamrupali.ttf') format('truetype');
}

@font-face {
    font-family: 'HindSiliguri';
    src: url('assets/fonts/HindSiliguri-Medium.ttf') format('truetype');
}

@font-face {
    font-family: 'Uthman';
    src: url('assets/fonts/uthman.ttf') format('truetype');
}

@font-face {
    font-family: 'AmiriLocal';
    src: url('assets/fonts/amiri_regular.ttf') format('truetype');
}

@font-face {
    font-family: 'FedraSans';
    src: url('assets/fonts/Fedra-Sans-Medium.ttf') format('truetype');
}

:root {
    /* Colors - Islamic Green Theme */
    --primary-green: #4CAF50;
    --primary-dark: #2c5f2d;
    --primary-light: #81C784;
    --accent-gold: #FFD700;

    /* Light Mode Colors */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;

    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-arabic: #1a3a1b;

    /* Light Mode Adaptive Backgrounds */
    --dua-arabic-bg: linear-gradient(135deg, #f0f9f0 0%, #ffffff 100%);
    --dua-bengali-bg: #f8f9fa;
    --dua-pronunciation-bg: #fff9e6;

    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);

    /* Typography - Default: Kalpurush (BN), Noorehira (AR) */
    --font-bengali: 'Kalpurush', 'Noto Serif Bengali', serif;
    --font-arabic: 'Noorehira', 'Amiri', serif;
    --font-english: 'Roboto', sans-serif;

    /* Font Sizes (Pixel based) */
    --bengali-font-size: 16px;
    --arabic-font-size: 34px;
}

/* Font Family Classes for Switching */
/* Bengali Fonts */
body.font-kalpurush {
    --font-bengali: 'Kalpurush', serif;
}

body.font-hind-siliguri {
    --font-bengali: 'HindSiliguri', 'Hind Siliguri', sans-serif;
}

body.font-fedra-sans {
    --font-bengali: 'FedraSans', sans-serif;
}

/* Arabic Fonts */
body.arabic-noorehira {
    --font-arabic: 'Noorehira', serif;
}

body.arabic-amiri-local {
    --font-arabic: 'AmiriLocal', 'Amiri', serif;
}

/* Legacy support/Removals of incorrect overrides */
.legacy-font-fix {
    display: none;
}



/* Arabic Font Classes */
body.arabic-noorehira {
    --font-arabic: 'Noorehira', serif;
}

body.arabic-noorehuda {
    --font-arabic: 'Noorehuda', serif;
}

body.arabic-uthman {
    --font-arabic: 'Uthman', serif;
}

body.arabic-amiri-local {
    --font-arabic: 'AmiriLocal', serif;
}

/* Dark Mode Refined */
body.dark-mode {
    --bg-primary: #303030;
    /* Dark Grey Page Background */
    --bg-secondary: #383838;
    --bg-card: #454545;
    /* Slightly lighter for cards */

    --text-primary: #f5f5f5;
    /* Off-white */
    --text-secondary: #cccccc;
    --text-arabic: #eee8aa;
    /* Soft Yellow for Arabic */
    --primary-dark: #81C784;
    /* Invert primary dark color for readability */

    /* Dark Mode Adaptive Backgrounds */
    --dua-arabic-bg: #4c4c4c;
    --dua-bengali-bg: #3d3d3d;
    --dua-pronunciation-bg: #4a4538;

    --border-color: #555555;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
}

body.dark-mode .font-select,
body.dark-mode .size-btn {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body {
    font-family: var(--font-bengali);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* ==========================================
   HEADER
   ========================================== */
.header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.app-branding {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.app-logo {
    height: 42px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.app-branding:hover .app-logo {
    transform: scale(1.05);
}

.app-title-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.app-title {
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.title-icon {
    font-size: 2.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1.25rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-family: var(--font-bengali);
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.search-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    opacity: 0.6;
}

/* Font Selector */
.font-selector {
    display: flex;
    align-items: center;
}

.font-select {
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    font-family: var(--font-bengali);
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.font-select:hover {
    background: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.font-select:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.font-select option {
    padding: 0.5rem;
}

/* Settings Button */
.settings-button {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-button:hover {
    background: white;
    transform: scale(1.1);
}

/* Group Navigation Controls */
.group-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
    width: 100%;
}

.nav-btn {
    background-color: var(--primary-green);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-bengali);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.nav-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-spacer {
    flex: 1;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    color: var(--primary-dark);
    font-size: 1.5rem;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--primary-dark);
}

.modal-body {
    padding: 1.5rem;
}

.setting-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.setting-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-bengali);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: var(--primary-green);
}

input:checked+.toggle-slider:before {
    transform: translateX(30px);
}

/* Font Size Control */
.font-size-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.size-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--primary-green);
    background: var(--bg-card);
    color: var(--primary-green);
    border-radius: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.size-btn:hover {
    background: var(--primary-green);
    color: white;
}

.size-btn:active {
    transform: scale(0.95);
}

.font-size-control span {
    min-width: 60px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
}

/* Arabic Font Classes */
body.arabic-amiri {
    --font-arabic: 'Amiri', 'Traditional Arabic', serif;
}

body.arabic-scheherazade {
    --font-arabic: 'Scheherazade New', 'Traditional Arabic', serif;
}

body.arabic-lateef {
    --font-arabic: 'Lateef', 'Traditional Arabic', serif;
}

/* ==========================================
   CONTAINER & LAYOUT
   ========================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

/* ==========================================
   SIDEBAR
   ========================================== */
.sidebar {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    height: fit-content;
    position: sticky;
    top: 120px;
}

.sidebar-header h2 {
    color: var(--primary-dark);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-green);
}

.chapter-list {
    list-style: none;
}

.chapter-item {
    margin-bottom: 0.75rem;
}

.chapter-button {
    width: 100%;
    text-align: right;
    padding: 1rem 1.25rem;
    background: var(--bg-primary);
    border: 2px solid transparent;
    border-radius: 8px;
    font-family: var(--font-bengali);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.chapter-button:hover {
    background: var(--primary-light);
    color: white;
    transform: translateX(-4px);
}

.chapter-button.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-dark);
}

.chapter-icon {
    font-size: 1.5rem;
}

/* Group Buttons in Sidebar */
.group-button {
    text-align: left;
    flex-direction: row-reverse;
    padding: 1rem;
}

.group-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.group-button.active .group-number {
    background: var(--primary-dark);
}

.group-text {
    flex: 1;
    text-align: right;
}

.no-groups {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.main-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    min-height: 600px;
}

/* Home Screen */
.home-screen {
    padding: 2rem 0;
}

.welcome-header {
    text-align: center;
    margin-bottom: 3rem;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.welcome-header h2 {
    color: var(--primary-dark);
    font-size: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.welcome-subtitle {
    color: var(--primary-green);
    font-size: 1.3rem;
    font-weight: 600;
}

/* Chapter Cards Grid - Main Categories */
.chapter-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.chapter-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9f0 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chapter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.chapter-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-green);
}

.chapter-card:hover::before {
    transform: scaleX(1);
}

.chapter-card-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.chapter-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.chapter-card-count {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Header Info Section */
.header-info {
    flex: 1;
}

/* Section Header */
.section-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.back-button {
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-bengali);
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.section-title {
    color: var(--primary-dark);
    font-size: 1.75rem;
    flex: 1;
}

.section-subtitle {
    width: 100%;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: -0.5rem;
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.group-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.group-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.group-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-green);
}

.group-card:hover::before {
    transform: scaleX(1);
}

.group-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    font-weight: 700;
    margin-bottom: 1rem;
}

.group-card h3 {
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.group-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Duas Container */
.duas-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dua-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.dua-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.dua-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-green);
}

.dua-name {
    color: var(--primary-dark);
    font-size: 1.3rem;
    font-weight: 700;
}

.dua-count {
    background: var(--primary-green);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.dua-arabic {
    font-family: var(--font-arabic);
    font-size: var(--arabic-font-size);
    line-height: 2.2;
    text-align: right;
    direction: rtl;
    color: var(--text-arabic);
    margin: 0.75rem 0;
    padding: 1.25rem;
    background: var(--dua-arabic-bg);
    border-right: 4px solid var(--primary-green);
    border-radius: 8px;
    white-space: pre-line;
}

.dua-bengali {
    font-size: var(--bengali-font-size);
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0.75rem 0;
    padding: 1.25rem;
    background: var(--dua-bengali-bg);
    border-radius: 8px;
    white-space: pre-line;
}

/* Dua Header Redesign */
.dua-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.dua-title-section {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex: 1;
}

.dua-action-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dua-serial {
    font-family: var(--font-bengali);
    font-size: 1.2rem;
    color: var(--primary-green);
    font-weight: bold;
    min-width: 25px;
}

.dua-name {
    font-size: 1.4rem;
    color: var(--primary-dark);
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    white-space: pre-line;
    /* Handle line breaks in titles */
}

/* Header Bookmark Button */
.bookmark-btn-header {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
}

.bookmark-btn-header:hover {
    transform: scale(1.1);
}

.bookmark-btn-header.active {
    color: #FFC107;
    /* Gold color for active */
}

/* Simple Audio Button (Updated) */
.audio-btn-simple {
    background: var(--bg-primary);
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    flex-shrink: 0;
}

.audio-btn-simple:hover {
    background: var(--primary-green);
    color: white;
}

.audio-btn-simple.playing {
    background: var(--primary-green);
    color: white;
    animation: pulse 1.5s infinite;
}

.dua-pronunciation {
    font-size: calc(var(--bengali-font-size) * 0.95);
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0.75rem 0;
    padding: 1.25rem;
    background: var(--dua-pronunciation-bg);
    border-left: 4px solid var(--accent-gold);
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.share-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-btn:hover {
    background: var(--primary-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2);
}

.share-icon {
    width: 18px;
    height: 18px;
}

.share-btn:active {
    transform: scale(0.9);
}

/* App Download Section in Settings */
.app-info-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 12px;
    text-align: center;
}

.app-info-section h3 {
    font-size: 1.1rem;
    color: var(--primary-green);
    margin-bottom: 1rem;
}

.app-download-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.app-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 160px;
}

.app-btn.play-store {
    background: linear-gradient(135deg, #000000 0%, #303030 100%);
    border: 1px solid #444;
}

.app-btn.app-store {
    background: linear-gradient(135deg, #1c1c1e 0%, #3a3a3c 100%);
    border: 1px solid #444;
}

.app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    opacity: 1;
}

.app-icon {
    width: 20px;
    height: 20px;
}

.version-info {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #999;
}

/* Dua Actions */
.dua-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.bookmark-btn {
    padding: 0.6rem 1.2rem;
    background: var(--bg-primary);
    border: 2px solid var(--primary-green);
    border-radius: 8px;
    color: var(--primary-green);
    font-family: var(--font-bengali);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bookmark-btn:hover {
    background: var(--primary-green);
    color: white;
}

.bookmark-btn.bookmarked {
    background: var(--primary-green);
    color: white;
}

/* Audio Player */
.audio-player {
    background: linear-gradient(135deg, #f0f9f0 0%, #e8f5e9 100%);
    border: 2px solid var(--primary-light);
    border-radius: 12px;
    padding: 1rem;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.play-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.play-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.play-btn:active {
    transform: scale(0.95);
}

.audio-progress {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: var(--primary-green);
    width: 0%;
    transition: width 0.1s ease;
}

.audio-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-english);
}

.dua-reference {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-weight: 500;
}

.dua-reference strong {
    color: var(--primary-green);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
    background: var(--primary-dark);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.footer a {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Dark Mode Footer */
body.dark-mode .footer {
    background: #0d0d0d;
    border-top: 2px solid var(--primary-green);
}

body.dark-mode .footer a {
    color: #FFD700;
}

body.dark-mode .footer a:hover {
    color: var(--primary-light);
}



/* Font Slider Styles - Global */
.font-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    margin: 10px 0;
}

.font-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-green);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease;
}

.font-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

.font-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-green);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: none;
}

/* Dark mode for sliders */
body.dark-mode .font-slider {
    background: #444;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 250px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {

    /* Header adjustments */
    .header-content {
        padding: 0 1rem;
        gap: 1rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .app-title {
        font-size: 1.5rem;
    }

    .app-title-text {
        display: none;
    }

    .title-icon {
        font-size: 2rem;
    }

    .search-container {
        flex: 1;
        max-width: 100%;
    }

    .search-input {
        padding: 0.6rem 2.5rem 0.6rem 1rem;
        font-size: 0.95rem;
    }

    /* Font selector on mobile */
    .font-selector {
        display: none;
        /* Hide on small screens */
    }

    /* Container & Sidebar */
    .container {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 0;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 80px;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 80px);
        background: white;
        z-index: 999;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .sidebar-header h2 {
        font-size: 1.3rem;
    }

    .chapter-button {
        padding: 1.2rem 1rem;
        font-size: 1rem;
        min-height: 56px;
    }

    /* Main content */
    .main-content {
        padding: 1rem;
        border-radius: 8px;
    }

    /* HOME PAGE - SMALLER CHAPTER CARDS */
    .home-screen {
        padding: 1rem 0;
    }

    .welcome-header {
        margin-bottom: 1.5rem;
    }

    .welcome-icon {
        font-size: 3rem;
        margin-bottom: 0.75rem;
    }

    .welcome-header h2 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    .welcome-subtitle {
        font-size: 1rem;
    }

    .chapter-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .chapter-card {
        padding: 1.25rem 1rem;
        border-radius: 12px;
    }

    .chapter-card-icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }

    .chapter-card-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .chapter-card-count {
        font-size: 0.85rem;
    }

    /* Groups */
    .groups-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .group-card {
        padding: 1.25rem;
    }

    .group-card h3 {
        font-size: 1.1rem;
    }

    /* Duas */
    .dua-card {
        padding: 1.5rem 1rem;
    }

    .dua-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .dua-name {
        font-size: 1.15rem;
    }

    .dua-arabic {
        font-size: 1.6rem;
        line-height: 2.5;
        padding: 1rem;
    }

    .dua-bengali,
    .dua-pronunciation {
        font-size: 1rem;
        padding: 1rem;
        line-height: 1.8;
    }

    /* Welcome screen */
    .welcome-content h2 {
        font-size: 1.5rem;
    }

    .welcome-subtitle {
        font-size: 1.1rem;
    }

    .welcome-description {
        font-size: 1rem;
    }



    .back-button {
        padding: 0.65rem 1.25rem;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }
}

/* Extra small devices - Even smaller cards */
@media (max-width: 480px) {
    .header-content {
        padding: 0 0.75rem;
    }

    .sidebar {
        width: 85%;
    }

    .app-title {
        font-size: 1.25rem;
    }

    .title-icon {
        font-size: 1.75rem;
    }

    /* Smaller cards on very small screens */
    .chapter-cards-grid {
        gap: 0.5rem;
    }

    .chapter-card {
        padding: 1rem 0.75rem;
    }

    .chapter-card-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .chapter-card-title {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .chapter-card-count {
        font-size: 0.75rem;
    }

    .dua-arabic {
        font-size: 1.4rem;
        line-height: 2.3;
    }

    .main-content {
        padding: 1rem 0.75rem;
    }
}

/* Font Preview Box in Settings */
.font-preview-box {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.preview-text-bengali {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-family: var(--font-bengali);
    font-size: var(--bengali-font-size);
}

.preview-text-arabic {
    direction: rtl;
    color: var(--text-arabic);
    font-family: var(--font-arabic);
    font-size: var(--arabic-font-size);
}

/* ==========================================
   FOOTER STYLES
   ========================================== */
.footer {
    background-color: var(--primary-dark);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    font-family: var(--font-bengali);
    /* Restored Bengali font */
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    /* Increased gap */
}

.footer span {
    color: #dfdfdf;
}

.footer a {
    color: #999999 !important;
    /* Proper grey */
    text-decoration: none;
    font-weight: normal;
    transition: color 0.2s;
}

.footer a:hover {
    color: white !important;
    text-decoration: underline;
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {

    .header,
    .sidebar,
    .footer,
    .back-button,
    .search-container {
        display: none;
    }

    .container {
        grid-template-columns: 1fr;
    }

    .dua-card {
        page-break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 2rem;
    }
}