/* Tabler Icons & Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400;1,700&family=Noto+Naskh+Arabic:wght@400..700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --color-bg: #1C2B27;           /* Koyu zümrüt yeşili */
    --color-bg-dark: #14201D;      /* Daha koyu yeşil panel */
    --color-accent: #BFA76A;       /* Altın / Bronz vurgu */
    --color-text-primary: #EDE6D6; /* Krem renkli ana metin */
    --color-text-muted: rgba(237, 230, 214, 0.5);
    --color-text-muted-dark: rgba(237, 230, 214, 0.3);
    
    --border-card: 1px solid rgba(191, 167, 106, 0.15);
    --border-card-active: 1px solid #BFA76A;
    --border-light: 1px solid rgba(255, 255, 255, 0.08);
    
    --font-ui: 'Outfit', sans-serif;
    --font-arabic: 'Noto Naskh Arabic', 'Amiri', serif;
    
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0f1816;
    color: var(--color-text-primary);
    font-family: var(--font-ui);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.5;
}

/* App Container - Desktop'ta telefon simülatörü, Mobilde tam ekran */
.app-container {
    width: 100%;
    max-width: 410px;
    height: 100vh;
    min-height: 720px;
    max-height: 860px;
    background-color: var(--color-bg);
    border: var(--border-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

@media (max-width: 480px) {
    body {
        background-color: var(--color-bg);
    }
    .app-container {
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
}

/* Screen Management */
.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    background-color: var(--color-bg);
    z-index: 10;
}

.screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1;
}

/* Loading Panel Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(28, 43, 39, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    gap: 16px;
    transition: opacity 0.2s ease;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(191, 167, 106, 0.2);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- AUTH SCREEN --- */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 24px;
    gap: 24px;
}

.auth-header {
    text-align: center;
}

.auth-logo {
    font-size: 48px;
    color: var(--color-accent);
    margin-bottom: 8px;
}

.auth-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.auth-header p {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-input {
    background-color: rgba(255, 255, 255, 0.04);
    border: var(--border-card);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--color-text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.custom-input:focus {
    border-color: var(--color-accent);
}

.primary-btn {
    background-color: var(--color-accent);
    color: var(--color-bg);
    border: none;
    border-radius: var(--radius-md);
    padding: 13px;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.primary-btn:hover {
    background-color: #d8be7c;
}

.secondary-action {
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
}

.secondary-action a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-error {
    color: #ff6b6b;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}

/* --- LIST SCREEN (Juz & Surah Select) --- */
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 10px;
    border-bottom: var(--border-light);
}

.header-title-section {
    text-align: center;
    flex: 1;
}

.header-title-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.header-subtitle {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.icon-action {
    color: var(--color-text-primary);
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.icon-action:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Juz Progress Section */
.juz-progress-section {
    padding: 24px 20px 16px;
    text-align: center;
    background-color: var(--color-bg-dark);
    border-bottom: var(--border-light);
}

.juz-progress-meta {
    font-size: 12px;
    color: var(--color-accent);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.juz-progress-title {
    font-size: 20px;
    font-weight: 500;
    margin: 4px 0 12px;
}

.progress-bar-wrapper {
    height: 4px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--color-accent);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-pct-text {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* Surah Cards List */
.scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.surah-card {
    background-color: rgba(255, 255, 255, 0.02);
    border: var(--border-card);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.surah-card:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.surah-card.active {
    background-color: rgba(191, 167, 106, 0.12);
    border-color: var(--color-accent);
}

.badge-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--color-text-muted-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}

.surah-card.active .badge-circle {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.surah-meta {
    flex: 1;
    min-width: 0;
}

.surah-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-primary);
}

.surah-subinfo {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.surah-status-badge {
    background-color: var(--color-accent);
    color: var(--color-bg);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

/* Bottom Tab Navigation */
.bottom-tabs {
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: var(--border-light);
    background-color: var(--color-bg-dark);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--color-text-muted);
    font-size: 10px;
    cursor: pointer;
    transition: color 0.2s ease;
    flex: 1;
}

.tab-item i {
    font-size: 20px;
}

.tab-item.active {
    color: var(--color-accent);
}

/* --- READING SCREEN --- */
.view-mode-selector {
    display: flex;
    gap: 8px;
    padding: 6px 20px 12px;
    border-bottom: var(--border-light);
    background-color: var(--color-bg-dark);
}

.mode-btn {
    flex: 1;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-text-muted);
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 500;
    padding: 6px 4px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn.active {
    background-color: rgba(191, 167, 106, 0.15);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.reading-content-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Surah Header / Description inside Reading flow */
.surah-header-block {
    border: var(--border-card);
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 8px;
}

.surah-header-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.surah-header-title-tr {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.surah-header-title-ar {
    font-family: var(--font-arabic);
    font-size: 20px;
    color: var(--color-accent);
}

.surah-desc-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--color-accent);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-ui);
    padding: 2px 0;
}

.surah-desc-drawer {
    font-size: 12px;
    line-height: 1.6;
    color: var(--color-text-muted);
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.surah-desc-drawer.hidden {
    display: none;
}

/* Mushaf Text block */
.mushaf-arabic-text {
    direction: rtl;
    text-align: justify;
    font-family: var(--font-arabic);
    font-size: 23px;
    line-height: 2.1;
    color: var(--color-text-primary);
    margin-bottom: 16px;
}

.verse-num-inline {
    display: inline-flex;
    width: 24px;
    height: 24px;
    border: 1px solid var(--color-accent);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    font-size: 10px;
    margin: 0 4px;
    vertical-align: middle;
    font-family: var(--font-ui);
    font-weight: 500;
}

.verse-num-inline.active {
    background-color: var(--color-accent);
    color: var(--color-bg);
}

/* Meal Section (Türkçe meali göster panel) */
.meal-toggle-row {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-accent);
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 8px;
    user-select: none;
}

.meal-scroll-panel {
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    max-height: 150px;
    overflow-y: auto;
    border: var(--border-card);
}

.meal-scroll-panel.hidden {
    display: none;
}

.meal-row {
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.meal-row:last-child {
    margin-bottom: 0;
}

.meal-row-num {
    color: var(--color-accent);
    font-weight: 600;
    margin-right: 4px;
}

/* Single verse style for Sadece Türkçe / Sadece Arapça list view */
.verse-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding-bottom: 12px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.verse-item:last-child {
    border-bottom: none;
}

.verse-item-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.verse-item-badge {
    width: 22px;
    height: 22px;
    border: 1px solid var(--color-text-muted-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 10px;
}

.verse-item.active {
    background-color: rgba(191, 167, 106, 0.08);
    border-left: 3px solid var(--color-accent);
    padding: 10px 10px 10px 8px;
    margin: 0 -8px;
    border-radius: var(--radius-md);
}

.verse-item.active .verse-item-badge {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-bg);
    font-weight: 600;
}

.verse-item-ar {
    direction: rtl;
    text-align: right;
    font-family: var(--font-arabic);
    font-size: 21px;
    line-height: 1.9;
    color: var(--color-text-primary);
    margin-bottom: 6px;
}

.verse-item-tr {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(237, 230, 214, 0.65);
}

/* Bookmark Save Footer Button */
.reading-footer-section {
    padding: 14px 20px 16px;
    border-top: var(--border-light);
    background-color: var(--color-bg-dark);
}

.bookmark-save-btn {
    width: 100%;
    background-color: var(--color-accent);
    color: var(--color-bg);
    text-align: center;
    padding: 12px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease;
}

.bookmark-save-btn:hover {
    background-color: #d8be7c;
}

/* Stats / Hatim Dashboard */
.stats-container {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-box {
    background-color: rgba(255, 255, 255, 0.03);
    border: var(--border-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
}

.stat-box-val {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-accent);
    margin-top: 4px;
}

.stat-box-lbl {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-large-box {
    background-color: rgba(191, 167, 106, 0.08);
    border: var(--border-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

.stat-large-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
}

.stat-large-val {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-accent);
    margin: 8px 0;
}

/* Settings View elements */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 20px;
}

.settings-item {
    background-color: rgba(255, 255, 255, 0.02);
    border: var(--border-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.settings-info p {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.danger-btn {
    background-color: transparent;
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.danger-btn:hover {
    background-color: #ff6b6b;
    color: #ffffff;
}

/* Screen and panel visibility controller */
.hidden {
    display: none !important;
}
