/* ========== Google Fonts ========== */
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@300;400;600;700;800&family=Scheherazade+New:wght@400;700&display=swap');

/* ========== CSS Variables ========== */
:root {
    --primary: #1a6b4a;
    --primary-dark: #0f4a32;
    --primary-light: #2d8f65;
    --gold: #d4a843;
    --gold-light: #e8c96a;
    --gold-dark: #b8922e;
    --bg-dark: #0a1628;
    --bg-card: rgba(255,255,255,0.04);
    --bg-card-hover: rgba(255,255,255,0.08);
    --text-primary: #f0ead6;
    --text-secondary: #a8b5c8;
    --text-gold: #d4a843;
    --border-color: rgba(212,168,67,0.15);
    --shadow-gold: 0 0 30px rgba(212,168,67,0.1);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Reset & Base ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(26,107,74,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(212,168,67,0.08) 0%, transparent 50%);
    pointer-events: none; z-index: 0;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { -webkit-appearance: none; }

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ========== Islamic Pattern ========== */
.islamic-pattern {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4a843' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none; z-index: 0;
}

/* ========== Container ========== */
.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
    z-index: 1;
}

/* ========== Hero ========== */
.hero { text-align: center; padding: 50px 16px 30px; position: relative; }
.hero-ornament { font-size: 2.2rem; color: var(--gold); margin-bottom: 8px; animation: pulse-glow 3s ease-in-out infinite; }
.hero h1 { font-family: 'Amiri', serif; font-size: 2rem; font-weight: 700; color: var(--gold); margin-bottom: 5px; text-shadow: 0 0 40px rgba(212,168,67,0.3); }
.hero .subtitle { font-family: 'Scheherazade New', serif; font-size: 1.4rem; color: var(--text-primary); margin-bottom: 6px; font-weight: 700; }
.hero .name-decorated {
    display: inline-block; padding: 8px 24px;
    border: 1px solid var(--border-color); border-radius: 50px;
    background: rgba(212,168,67,0.05); margin: 8px 0;
}
.hero .name-decorated span { font-family: 'Amiri', serif; font-size: 1.3rem; color: var(--gold); font-weight: 700; }
.hero .dua-text { font-family: 'Scheherazade New', serif; font-size: 1.1rem; color: var(--text-secondary); margin-top: 12px; line-height: 2; }
.divider { width: 70px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 25px auto; }

/* ========== Quran Card ========== */
.quran-section { text-align: center; padding: 20px 0; }
.quran-card {
    background: linear-gradient(135deg, rgba(26,107,74,0.12), rgba(212,168,67,0.06));
    border: 1px solid var(--border-color); border-radius: var(--radius);
    padding: 25px 20px; position: relative; overflow: hidden;
}
.quran-card::before { content: '﴿'; position: absolute; top: 8px; right: 15px; font-size: 2.5rem; color: var(--gold); opacity: 0.15; font-family: 'Amiri'; }
.quran-card::after { content: '﴾'; position: absolute; bottom: 8px; left: 15px; font-size: 2.5rem; color: var(--gold); opacity: 0.15; font-family: 'Amiri'; }
.quran-verse { font-family: 'Amiri', serif; font-size: 1.3rem; line-height: 2.2; color: var(--text-primary); margin-bottom: 10px; }
.quran-ref { font-family: 'Cairo'; font-size: 0.8rem; color: var(--gold); font-weight: 600; }

/* ========== Section ========== */
.section { padding: 20px 0; }
.section-title {
    font-family: 'Amiri', serif; font-size: 1.4rem; color: var(--gold);
    text-align: center; margin-bottom: 18px; position: relative;
}
.section-title::after { content: ''; display: block; width: 45px; height: 2px; background: var(--gold); margin: 6px auto 0; border-radius: 2px; }

/* ========== Surah Fatiha ========== */
.fatiha-card {
    background: linear-gradient(135deg, rgba(26,107,74,0.1), rgba(212,168,67,0.05));
    border: 1px solid var(--border-color); border-radius: var(--radius);
    padding: 25px 18px; text-align: center;
}
.fatiha-card .surah-text {
    font-family: 'Amiri', serif; font-size: 1.25rem;
    line-height: 2.4; color: var(--text-primary); margin-bottom: 15px;
}
.fatiha-card .surah-label { font-size: 0.8rem; color: var(--gold); font-weight: 600; margin-bottom: 12px; }
.fatiha-btn-wrap { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* ========== Amal Grid ========== */
.amal-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.amal-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); padding: 16px;
    transition: var(--transition); display: flex; align-items: flex-start; gap: 12px;
}
.amal-card:active { transform: scale(0.98); }
.amal-icon {
    width: 46px; height: 46px; min-width: 46px; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.amal-card h3 { font-size: 0.95rem; color: var(--text-primary); margin-bottom: 3px; font-weight: 700; }
.amal-card p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.7; }

/* ========== Azkar Section ========== */
.azkar-container { display: grid; gap: 10px; }
.zikr-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); padding: 16px; text-align: center;
    transition: var(--transition); cursor: pointer; position: relative; overflow: hidden;
    user-select: none; -webkit-user-select: none;
}
.zikr-card:active { transform: scale(0.97); }
.zikr-card.completed { opacity: 0.4; border-color: var(--primary); }
.zikr-card.completed::after {
    content: '✓'; position: absolute; top: 8px; left: 8px;
    color: var(--primary-light); font-size: 1.2rem; font-weight: 700;
}
.zikr-text { font-family: 'Amiri', serif; font-size: 1.15rem; line-height: 2; color: var(--text-primary); margin-bottom: 8px; }
.zikr-count-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(26,107,74,0.2); color: var(--primary-light);
    padding: 3px 12px; border-radius: 50px; font-size: 0.75rem; font-weight: 700;
}
.zikr-remaining { font-size: 0.7rem; color: var(--text-secondary); margin-top: 4px; }

/* ========== Dua Cards ========== */
.dua-cards { display: grid; gap: 10px; }
.dua-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); padding: 16px 18px; text-align: center;
    transition: var(--transition);
}
.dua-card .dua-arabic { font-family: 'Amiri', serif; font-size: 1.1rem; color: var(--text-primary); line-height: 2; margin-bottom: 5px; }
.dua-card .dua-source { font-size: 0.7rem; color: var(--gold); font-weight: 600; }

/* ========== Counter ========== */
.counter-section { text-align: center; padding: 25px 0; }
.counter-box {
    background: linear-gradient(135deg, rgba(26,107,74,0.15), rgba(212,168,67,0.08));
    border: 1px solid var(--border-color); border-radius: var(--radius); padding: 25px 16px;
}
.counter-label { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 10px; }
.counter-display {
    font-family: 'Amiri', serif; font-size: 2.8rem; color: var(--gold); font-weight: 700;
    margin-bottom: 12px; text-shadow: 0 0 20px rgba(212,168,67,0.3);
    min-height: 50px; line-height: 1; transition: transform 0.2s ease;
}
.counter-type-label { font-size: 0.8rem; color: var(--primary-light); margin-bottom: 12px; font-weight: 600; }
.counter-buttons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.counter-types { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 15px; }

/* ========== Buttons ========== */
.btn {
    font-family: 'Cairo'; padding: 10px 20px; border-radius: 50px;
    border: none; cursor: pointer; font-size: 0.85rem; font-weight: 700;
    transition: var(--transition); touch-action: manipulation;
}
.btn:active { transform: scale(0.95) !important; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; border: 1px solid rgba(255,255,255,0.1); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: var(--bg-dark); }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-sm { padding: 6px 14px; font-size: 0.75rem; }
.btn-type { padding: 6px 14px; font-size: 0.75rem; border-radius: 50px; border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; font-family: 'Cairo'; font-weight: 600; transition: var(--transition); }
.btn-type.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ========== Share ========== */
.share-section { text-align: center; padding: 20px 0; }
.share-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.share-btn {
    width: 46px; height: 46px; border-radius: 50%;
    border: 1px solid var(--border-color); background: var(--bg-card);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer; transition: var(--transition); color: var(--text-secondary);
}
.share-btn:active { transform: scale(0.9); }
.share-btn.whatsapp:active, .share-btn.whatsapp:hover { background: #25D366; border-color: #25D366; color: #fff; }
.share-btn.facebook:active, .share-btn.facebook:hover { background: #1877F2; border-color: #1877F2; color: #fff; }
.share-btn.twitter:active, .share-btn.twitter:hover { background: #1DA1F2; border-color: #1DA1F2; color: #fff; }
.share-btn.copy:active, .share-btn.copy:hover { background: var(--gold); border-color: var(--gold); color: var(--bg-dark); }

/* ========== Footer ========== */
.footer { text-align: center; padding: 25px 16px; margin-top: 15px; border-top: 1px solid var(--border-color); }
.footer p { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.8; }
.footer .heart { color: #e74c3c; animation: heartbeat 1.5s ease-in-out infinite; display: inline-block; }
.footer .dev-name { color: var(--primary-light); font-weight: 700; }

/* ========== Toast ========== */
.toast {
    position: fixed; bottom: 25px; left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary); color: white;
    padding: 10px 22px; border-radius: 50px;
    font-size: 0.8rem; font-weight: 600; z-index: 1000;
    opacity: 0; transition: all 0.4s ease; white-space: nowrap;
    font-family: 'Cairo';
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========== Ripple Effect ========== */
.ripple { position: absolute; border-radius: 50%; background: rgba(212,168,67,0.3); animation: ripple-anim 0.6s ease-out; pointer-events: none; }
@keyframes ripple-anim { to { transform: scale(4); opacity: 0; } }

/* ========== Animations ========== */
@keyframes pulse-glow { 0%, 100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.fade-in { animation: fadeInUp 0.5s ease forwards; }
.fade-in-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.15s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.2s; opacity: 0; }
.fade-in-delay-4 { animation-delay: 0.25s; opacity: 0; }
.fade-in-delay-5 { animation-delay: 0.3s; opacity: 0; }

/* ========== Desktop Hover (non-touch) ========== */
@media (hover: hover) {
    .amal-card:hover { background: var(--bg-card-hover); transform: translateY(-2px); box-shadow: var(--shadow-gold); }
    .dua-card:hover { background: var(--bg-card-hover); border-color: rgba(212,168,67,0.3); }
    .zikr-card:hover { background: var(--bg-card-hover); }
    .btn-primary:hover { background: linear-gradient(135deg, var(--primary-light), var(--primary)); }
    .btn-gold:hover { box-shadow: 0 5px 20px rgba(212,168,67,0.3); }
    .btn-outline:hover { border-color: var(--gold); color: var(--gold); }
    .btn-type:hover { border-color: var(--primary-light); color: var(--primary-light); }
}

/* ========== Tablet ========== */
@media (min-width: 550px) {
    .amal-grid { grid-template-columns: 1fr 1fr; }
    .hero h1 { font-size: 2.5rem; }
    .hero .subtitle { font-size: 1.6rem; }
}

/* ========== Small Mobile ========== */
@media (max-width: 380px) {
    html { font-size: 14px; }
    .container { padding: 0 12px; }
    .hero { padding: 40px 12px 25px; }
    .hero h1 { font-size: 1.7rem; }
    .hero .subtitle { font-size: 1.2rem; }
    .hero .name-decorated span { font-size: 1.1rem; }
    .quran-verse { font-size: 1.1rem; }
    .counter-display { font-size: 2.3rem; }
    .section-title { font-size: 1.2rem; }
    .btn { padding: 9px 16px; font-size: 0.8rem; }
    .share-btn { width: 42px; height: 42px; }
}
