/* =============================================
   القرآن الكريم - Application Styles
   ============================================= */

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

:root {
    --primary-color: #1a6b5a;
    --primary-dark: #004d40;
    --primary-light: #26a69a;
    --secondary-color: #c9a84c;
    --secondary-light: #f0d080;
    --bg-color: #f0f4f3;
    --bg-secondary: #e8f0ee;
    --text-color: #1a2e2b;
    --text-muted: #6b8a84;
    --card-bg: #ffffff;
    --card-border: rgba(26, 107, 90, 0.08);
    --header-bg: linear-gradient(135deg, #004d40 0%, #1a6b5a 100%);
    --nav-bg: #ffffff;
    --nav-active: #1a6b5a;
    --nav-inactive: #9eb0ac;
    --shadow-sm: 0 2px 8px rgba(0,77,64,0.08);
    --shadow-md: 0 4px 16px rgba(0,77,64,0.12);
    --shadow-lg: 0 8px 32px rgba(0,77,64,0.15);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #0d1a18;
    --bg-secondary: #141f1d;
    --text-color: #e8f0ee;
    --text-muted: #7a9e97;
    --card-bg: #1a2e2b;
    --card-border: rgba(26, 107, 90, 0.2);
    --nav-bg: #1a2e2b;
    --nav-inactive: #5a7a75;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 75px;
    transition: background-color 0.3s, color 0.3s;
}

/* =============================================
   HEADER
   ============================================= */
.app-header {
    background: var(--header-bg);
    color: #fff;
    padding: 0.9rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.4rem;
    opacity: 0.9;
}

.header-content h1 {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0.01em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.header-actions button {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 50px;
    padding: 0.35rem 0.7rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.header-actions button:hover {
    background: rgba(255,255,255,0.25);
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.app-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h3, .card h4 {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* =============================================
   HOME PAGE
   ============================================= */
.welcome-section {
    text-align: center;
    padding: 1.5rem 1rem 0.5rem;
}

.welcome-section h2 {
    font-family: 'Amiri', serif;
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 0.3rem;
}

.welcome-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Countdown Card */
.countdown-card {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.countdown-card::before {
    content: '☪';
    position: absolute;
    right: -10px;
    top: -10px;
    font-size: 5rem;
    opacity: 0.07;
}

.countdown-card h3 {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.countdown-card .timer {
    font-size: 2.4rem;
    font-weight: 700;
    font-family: 'Cairo', monospace;
    color: var(--secondary-light);
    letter-spacing: 2px;
    margin: 0.5rem 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.countdown-card .timer-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

.countdown-card .badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 0.2rem 0.8rem;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Prayer Summary */
.prayer-summary h3 {
    font-size: 1rem;
    color: var(--primary-color);
}

.prayer-list .prayer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--card-border);
    font-size: 0.9rem;
}

.prayer-list .prayer-row:last-child {
    border-bottom: none;
}

.prayer-list .prayer-row.next-prayer {
    color: var(--primary-color);
    font-weight: 700;
    background: linear-gradient(90deg, rgba(26,107,90,0.06) 0%, transparent 100%);
    border-radius: 8px;
    padding: 0.7rem 0.5rem;
    margin: 0 -0.5rem;
}

.prayer-list .prayer-row.next-prayer .prayer-name::before {
    content: '▸ ';
    color: var(--secondary-color);
}

.prayer-list strong {
    font-family: 'Cairo', monospace;
    font-size: 0.95rem;
}

/* Hadith Card */
.daily-hadith {
    background: linear-gradient(135deg, #fffbf0 0%, #fff8e1 100%);
    border-right: 4px solid var(--secondary-color);
    border-left: none;
}

[data-theme="dark"] .daily-hadith {
    background: linear-gradient(135deg, #2a2010 0%, #241e0a 100%);
}

.daily-hadith h4 {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 0.7rem;
}

.daily-hadith p {
    font-family: 'Amiri', serif;
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-color);
    direction: rtl;
}

.daily-hadith .hadith-source {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-family: 'Cairo', sans-serif;
}

/* Stats row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 0.9rem 0.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
    color: var(--primary-color);
}

.stat-card .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-color);
    font-family: 'Cairo', sans-serif;
}

.stat-card .stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* =============================================
   QURAN PAGE
   ============================================= */
.quran-search {
    position: relative;
}

.quran-search .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.95rem;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(26,107,90,0.1);
}

.quran-container {
    min-height: 200px;
}

.ayah-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
    transition: var(--transition);
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ayah-card:hover {
    box-shadow: var(--shadow-md);
}

.ayah-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.ayah-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ayah-ar {
    font-family: 'Amiri', serif;
    font-size: 1.45rem;
    direction: rtl;
    text-align: right;
    line-height: 2.4;
    color: var(--text-color);
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.8rem;
}

.ayah-translation {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
    direction: ltr;
    text-align: left;
}

.surah-header {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    border-radius: var(--radius-md);
    color: white;
    margin-bottom: 1rem;
}

.surah-header h2 {
    font-family: 'Amiri', serif;
    font-size: 2rem;
    color: var(--secondary-light);
    margin-bottom: 0.3rem;
}

.surah-header .bismillah {
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.9);
    margin: 0.5rem 0;
}

.surah-header p {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
}

#audio-player-container {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: white;
    border-radius: var(--radius-md);
}

#audio-player-container h4 {
    color: var(--secondary-light);
    text-align: center;
    font-family: 'Cairo', sans-serif;
    margin-bottom: 0.7rem;
}

audio {
    width: 100%;
    border-radius: 8px;
    accent-color: var(--secondary-color);
}

/* =============================================
   PRAYER PAGE
   ============================================= */
.prayer-page .location-card {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: white;
}

.prayer-page .location-card h3 {
    color: white;
    font-size: 1.1rem;
}

.prayer-page .location-card .text-gold {
    color: var(--secondary-light);
}

.prayer-page .location-card p {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
}

.prayer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 0.5rem;
    border-bottom: 1px solid var(--card-border);
    border-radius: 8px;
    transition: var(--transition);
}

.prayer-row:last-child {
    border-bottom: none;
}

.prayer-row:hover {
    background: var(--bg-secondary);
}

.prayer-name {
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.prayer-name .prayer-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.prayer-time {
    font-family: 'Cairo', monospace;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
}

.next-prayer {
    background: linear-gradient(90deg, rgba(26,107,90,0.08) 0%, rgba(26,107,90,0.02) 100%) !important;
    border-radius: 10px !important;
    border: 1px solid rgba(26,107,90,0.15) !important;
}

.next-prayer .prayer-name,
.next-prayer .prayer-time {
    color: var(--primary-color);
}

.next-prayer .prayer-icon {
    background: var(--primary-color);
    color: white;
}

/* Qibla Compass */
.qibla-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.compass-container {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 3px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md), inset 0 2px 8px rgba(0,0,0,0.05);
}

.compass-container::before {
    content: 'ش';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

.compass-container::after {
    content: 'ج';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

#compass-icon {
    font-size: 80px;
    color: var(--primary-color);
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 4px rgba(0,77,64,0.2));
}

.kaaba-marker {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--secondary-color);
    font-size: 1rem;
    z-index: 2;
}

/* =============================================
   BOTTOM NAVIGATION
   ============================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    background-color: var(--nav-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 1000;
    border-top: 1px solid var(--card-border);
    padding: 0 0.5rem;
    backdrop-filter: blur(10px);
}

.nav-item {
    text-decoration: none;
    color: var(--nav-inactive);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.68rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    transition: var(--transition);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    flex: 1;
    gap: 0.15rem;
}

.nav-item i {
    font-size: 1rem;
    transition: var(--transition);
}

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

.nav-item.active i {
    transform: scale(1.1);
}

/* =============================================
   UTILITIES
   ============================================= */
.text-gold { color: var(--secondary-color); }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }

.arabic {
    font-family: 'Amiri', serif;
    direction: rtl;
    text-align: right;
}

/* Loading spinner */
.fa-spinner {
    color: var(--primary-color);
}

/* Section title */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7rem;
}

.section-title h3 {
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 700;
}

.section-title small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* RTL Support */
[dir="rtl"] .form-control {
    text-align: right;
}

[dir="rtl"] .daily-hadith {
    border-right: 4px solid var(--secondary-color);
    border-left: none;
}

[dir="ltr"] .daily-hadith {
    border-left: 4px solid var(--secondary-color);
    border-right: none;
}

/* Scroll to top */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive safe area for mobile */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(68px + env(safe-area-inset-bottom));
    }
    body {
        padding-bottom: calc(75px + env(safe-area-inset-bottom));
    }
}

/* Next prayer badge */
.next-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.65rem;
    margin-right: 0.4rem;
    font-family: 'Cairo', sans-serif;
}

/* Reciter select */
#reciter-select {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
}

/* Bouton ville dans le header */
#city-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 50px;
    padding: 0.35rem 0.7rem;
    transition: var(--transition);
}
#city-btn:hover { background: rgba(255,255,255,0.25); }


/* =============================================
   NEW FEATURES - Asmaul Husna, Dua, Events
   ============================================= */

/* Stat cards links */
a.stat-card {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s;
}
a.stat-card:hover { transform: translateY(-3px); }

/* Pulsing gold shimmer for stat-icon */
.stat-icon {
    animation: none;
}

/* Islamic events card */
#events-list .event-row:last-child {
    border-bottom: none !important;
}

/* Streak calendar dots */
#streak-calendar > div {
    transition: all 0.2s;
}

/* Bottom nav More button active */
#more-nav-btn.active-more {
    color: var(--primary-color) !important;
}

/* Smooth appear animation for new cards */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeSlideUp 0.3s ease both;
}

/* Share button hover */
#share-ayah-btn:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Quick access grid links */
.stats-row a.stat-card, div a .stat-card {
    transition: transform 0.2s, box-shadow 0.2s;
}
div a:hover .stat-card {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

