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

:root {
    --bg-deep: #0a1628;
    --bg-dark: #0f2340;
    --bg-card: #162d50;
    --bg-card-light: #1e3a5f;
    --gold: #d4a843;
    --gold-light: #f0d078;
    --gold-dark: #b8922e;
    --teal: #26a69a;
    --teal-light: #4db6ac;
    --pink: #e91e63;
    --red: #e53935;
    --blue: #1e88e5;
    --blue-light: #42a5f5;
    --gray-100: #f5f5f5;
    --gray-400: #bdbdbd;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
}

body {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    background: var(--bg-deep);
    color: var(--gray-100);
    font-size: 14px;
    padding-bottom: 70px;
}

.app { max-width: 480px; margin: 0 auto; }

/* NAV */
.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px;
    background: var(--bg-dark);
    display: flex; justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 50;
}
.nav-item {
    background: none; border: none; color: var(--gray-400);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    cursor: pointer; padding: 6px 16px; border-radius: 12px;
    transition: all 0.3s; font-family: inherit;
}
.nav-item.active { color: var(--gold); background: rgba(212,168,67,0.1); }
.nav-icon { font-size: 22px; }
.nav-label { font-size: 11px; font-weight: 500; }

/* PAGES */
.page { display: none; min-height: 100vh; }
.page.active { display: block; }

/* HERO */
.hero {
    position: relative;
    background: linear-gradient(135deg, var(--bg-deep), var(--bg-dark), #1a3a5c);
    padding: 32px 20px 28px;
    overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(212,168,67,0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(38,166,154,0.1) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; text-align: center; }
.app-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 15px rgba(212,168,67,0.5));
    animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.hero-date { font-size: 22px; font-weight: 800; color: var(--gold-light); margin-bottom: 4px; cursor: pointer; }
.hero-date:hover { text-shadow: 0 0 15px rgba(212,168,67,0.4); }
.hero-date-sub { font-size: 13px; color: var(--gray-400); margin-bottom: 20px; }

.hero-countdown {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(212,168,67,0.25);
    border-radius: var(--radius);
    padding: 16px;
}
.countdown-label { font-size: 12px; color: var(--gray-400); display: block; margin-bottom: 8px; }
.countdown-time { font-size: 38px; font-weight: 800; color: #fff; display: block; letter-spacing: 2px; }
.countdown-prayer { font-size: 14px; color: var(--gold); display: block; margin-top: 4px; font-weight: 600; }

/* QUICK PRAYERS */
.quick-prayers {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 16px;
}
.q-prayer {
    background: var(--bg-card); border-radius: var(--radius-sm); padding: 12px 4px;
    text-align: center; border: 1px solid rgba(255,255,255,0.05);
}
.q-prayer.next { background: rgba(212,168,67,0.15); border-color: var(--gold-dark); }
.q-prayer-label { font-size: 10px; color: var(--gray-400); display: block; margin-bottom: 6px; }
.q-prayer-time { font-size: 14px; font-weight: 700; color: #fff; display: block; }
.q-prayer.next .q-prayer-time { color: var(--gold-light); }

/* CITY */
.city-bar { padding: 0 16px 12px; }
.city-select-btn {
    width: 100%; padding: 12px; background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm);
    color: #fff; font-family: inherit; font-size: 14px;
    display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}

/* MONTH NAV */
.month-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; margin: 0 16px 8px;
    background: var(--bg-card); border-radius: var(--radius-sm);
}
.month-nav button {
    width: 36px; height: 36px; border: none; background: var(--bg-card-light);
    color: var(--gold); border-radius: 50%; font-size: 14px; cursor: pointer;
}
.month-title { text-align: center; }
.month-title h2 { font-size: 18px; color: var(--gold-light); font-weight: 700; }
.month-title span { font-size: 12px; color: var(--gray-400); }

/* CALENDAR */
.calendar { background: var(--bg-card); margin: 0 16px 16px; border-radius: var(--radius); padding: 16px; }
.week-row {
    display: grid; grid-template-columns: repeat(7, 1fr);
    margin-bottom: 8px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.week-cell { text-align: center; font-size: 11px; color: var(--gray-400); font-weight: 500; }
.week-cell:first-child { color: var(--red); }

.days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.day-cell {
    aspect-ratio: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; border-radius: var(--radius-xs); cursor: pointer;
    font-size: 14px; font-weight: 500; color: var(--gray-100);
    position: relative; min-height: 42px;
}
.day-cell.empty { cursor: default; }
.day-cell.today { background: var(--gold); color: var(--bg-deep); font-weight: 800; }
.day-cell.holiday { color: var(--red); background: rgba(229,57,53,0.15); }
.day-cell.birthday { color: var(--pink); background: rgba(233,30,99,0.15); }
.day-dot { width: 4px; height: 4px; border-radius: 50%; position: absolute; bottom: 4px; background: var(--red); }
.day-dot.bday { background: var(--pink); }
.day-cell.today .day-dot { background: var(--bg-deep); }

/* EVENTS */
.events-card { background: var(--bg-card); margin: 0 16px 16px; border-radius: var(--radius); padding: 16px; }
.events-title { font-size: 15px; font-weight: 700; color: var(--gold-light); margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.event-item { display: flex; gap: 10px; padding: 10px; background: rgba(255,255,255,0.05); border-radius: var(--radius-xs); margin-bottom: 6px; align-items: center; }
.event-day { min-width: 36px; padding: 6px; background: var(--bg-card-light); border-radius: var(--radius-xs); text-align: center; font-size: 13px; font-weight: 600; }
.event-item.type-holiday .event-day { background: rgba(229,57,53,0.3); color: var(--red); }
.event-item.type-birthday .event-day { background: rgba(233,30,99,0.3); color: var(--pink); }
.event-item.type-event .event-day { background: rgba(30,136,229,0.3); color: var(--blue-light); }
.event-text { font-size: 13px; }
.empty-state { text-align: center; padding: 24px; color: var(--gray-400); font-size: 13px; }

/* PAGE HEADER */
.page-header { padding: 24px 20px 16px; background: linear-gradient(var(--bg-dark), var(--bg-deep)); text-align: center; }
.page-header h1 { font-size: 22px; font-weight: 800; color: var(--gold-light); }
.page-subtitle { font-size: 13px; color: var(--gray-400); }

/* ADHAN */
.adhan-section { padding: 0 16px 16px; }
.adhan-player { background: var(--bg-card); border-radius: var(--radius); padding: 20px; border: 1px solid rgba(212,168,67,0.2); margin-bottom: 12px; }
.adhan-art { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.adhan-icon { font-size: 40px; width: 64px; height: 64px; background: rgba(212,168,67,0.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.adhan-info h3 { font-size: 16px; color: var(--gold-light); margin-bottom: 4px; font-weight: 700; }
.adhan-info p { font-size: 12px; color: var(--gray-400); }
.adhan-controls { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 14px; }
.adhan-ctrl { width: 42px; height: 42px; border: none; background: var(--bg-card-light); color: var(--gold); border-radius: 50%; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.adhan-ctrl-main { width: 52px; height: 52px; background: var(--gold); color: var(--bg-deep); font-size: 22px; }
.adhan-progress { display: flex; align-items: center; gap: 10px; }
.progress-bar { flex: 1; height: 4px; background: var(--bg-deep); border-radius: 2px; overflow: hidden; cursor: pointer; }
.progress-fill { height: 100%; width: 0%; background: var(--gold); border-radius: 2px; }
.progress-time { font-size: 11px; color: var(--gray-400); min-width: 35px; text-align: left; }
.reciter-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; }
.reciter-tabs::-webkit-scrollbar { display: none; }
.auto-adhan-toggle {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-card); border-radius: var(--radius-sm);
    padding: 12px 16px; margin-bottom: 12px;
    border: 1px solid rgba(38,166,154,0.2);
}
.auto-adhan-label { font-size: 14px; color: var(--teal-light); font-weight: 600; }
.switch { position: relative; width: 48px; height: 26px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--bg-card-light); border-radius: 26px;
    transition: 0.3s;
}
.switch-slider::before {
    content: ''; position: absolute; width: 20px; height: 20px;
    left: 3px; bottom: 3px; background: var(--gray-400);
    border-radius: 50%; transition: 0.3s;
}
.switch input:checked + .switch-slider { background: var(--teal); }
.switch input:checked + .switch-slider::before {
    transform: translateX(22px); background: #fff;
}
.reciter-tab { padding: 8px 14px; background: var(--bg-card); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; color: var(--gray-400); font-family: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
.reciter-tab.active { background: rgba(212,168,67,0.2); border-color: var(--gold-dark); color: var(--gold-light); }

/* PRAYER CARDS */
.prayer-cards { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.prayer-card { background: var(--bg-card); border-radius: var(--radius-sm); padding: 14px; display: flex; align-items: center; gap: 12px; border: 1px solid rgba(255,255,255,0.05); }
.prayer-card.next { background: rgba(212,168,67,0.12); border-color: var(--gold-dark); }
.prayer-icon { font-size: 28px; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; background: var(--bg-card-light); border-radius: var(--radius-xs); }
.prayer-card.next .prayer-icon { background: rgba(212,168,67,0.2); }
.prayer-info { flex: 1; }
.prayer-name { font-size: 15px; font-weight: 600; }
.prayer-time-text { font-size: 12px; color: var(--teal-light); min-height: 16px; }
.prayer-card-time { font-size: 20px; font-weight: 800; color: var(--gold-light); direction: ltr; }

/* AZKAR */
.azkar-categories { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 16px; }
.azkar-cat { background: var(--bg-card); border-radius: var(--radius-sm); padding: 18px 12px; text-align: center; cursor: pointer; border: 1px solid rgba(255,255,255,0.05); }
.azkar-cat:active { transform: scale(0.97); }
.azkar-cat-icon { font-size: 30px; margin-bottom: 8px; }
.azkar-cat-name { font-size: 14px; font-weight: 600; color: var(--gold-light); margin-bottom: 4px; }
.azkar-cat-count { font-size: 11px; color: var(--gray-400); }
.azkar-content { padding: 0 16px 16px; }
.zikr-item { background: var(--bg-card); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.05); }
.zikr-text { font-size: 17px; font-weight: 600; color: var(--gold-light); text-align: center; line-height: 1.9; margin-bottom: 10px; }
.zikr-translation { font-size: 13px; color: var(--gray-400); text-align: center; margin-bottom: 10px; }
.zikr-meta { display: flex; justify-content: space-between; align-items: center; }
.zikr-count-badge { font-size: 12px; color: var(--teal-light); background: rgba(38,166,154,0.15); padding: 4px 10px; border-radius: 12px; }
.zikr-progress { width: 60px; height: 4px; background: var(--bg-deep); border-radius: 2px; overflow: hidden; }
.zikr-progress-fill { height: 100%; background: var(--teal); }
.zikr-counter-btn { width: 100%; padding: 10px; background: var(--bg-card-light); border: 1px solid rgba(38,166,154,0.3); border-radius: var(--radius-xs); color: var(--teal-light); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 10px; }

/* TOOLS */
.tools-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px; }
.tool-card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; text-align: center; cursor: pointer; border: 1px solid rgba(255,255,255,0.05); }
.tool-card:active { transform: scale(0.97); }
.tool-icon { font-size: 36px; margin-bottom: 10px; }
.tool-card h3 { font-size: 15px; color: var(--gold-light); margin-bottom: 4px; }
.tool-card p { font-size: 12px; color: var(--gray-400); }
.tool-panel { padding: 0 16px 16px; }

/* TASBIH */
.tasbih-panel { background: var(--bg-card); border-radius: var(--radius); padding: 24px 20px; text-align: center; margin-bottom: 16px; }
.tasbih-dhikr { font-size: 22px; font-weight: 700; color: var(--gold-light); margin-bottom: 6px; line-height: 1.6; }
.tasbih-translation { font-size: 13px; color: var(--gray-400); margin-bottom: 24px; }
.tasbih-counter { font-size: 72px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.tasbih-target { font-size: 14px; color: var(--gray-400); margin-bottom: 24px; }
.tasbih-btn { width: 100%; padding: 18px; background: var(--gold); border: none; border-radius: var(--radius-sm); color: var(--bg-deep); font-family: inherit; font-size: 18px; font-weight: 700; cursor: pointer; margin-bottom: 10px; }
.tasbih-reset { background: var(--bg-card-light); border: none; padding: 10px 24px; border-radius: var(--radius-xs); color: var(--gray-400); font-family: inherit; font-size: 13px; cursor: pointer; }
.tasbih-nav { display: flex; gap: 6px; margin-top: 16px; justify-content: center; flex-wrap: wrap; }
.tasbih-nav-btn { padding: 8px 12px; background: var(--bg-card-light); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-xs); color: var(--gray-100); font-family: inherit; font-size: 12px; cursor: pointer; }
.tasbih-nav-btn.active { background: rgba(212,168,67,0.2); border-color: var(--gold-dark); color: var(--gold-light); }

/* QIBLA */
.qibla-panel { background: var(--bg-card); border-radius: var(--radius); padding: 24px 20px; text-align: center; margin-bottom: 16px; }
.compass { width: 200px; height: 200px; margin: 0 auto 20px; position: relative; }
.compass-ring { width: 100%; height: 100%; border: 3px solid var(--gold); border-radius: 50%; position: relative; background: var(--bg-card-light); }
.compass-north { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); color: var(--red); font-weight: 700; font-size: 14px; }
.compass-arrow { position: absolute; top: 50%; left: 50%; width: 4px; height: 80px; background: var(--gold); transform-origin: bottom center; transform: translate(-50%, -100%) rotate(0deg); border-radius: 2px; }
.compass-arrow::after { content: ''; position: absolute; top: -8px; left: 50%; transform: translateX(-50%); border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 12px solid var(--gold-light); }
.compass-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 14px; height: 14px; background: var(--gold); border-radius: 50%; z-index: 2; }
.qibla-degree { font-size: 28px; font-weight: 800; color: var(--gold-light); }
.qibla-label { font-size: 14px; color: var(--gray-400); }

/* CONVERTER */
.converter-panel { background: var(--bg-card); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.converter-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.converter-label { color: var(--gray-400); font-size: 13px; }
.converter-input { display: flex; gap: 8px; }
.converter-input input { flex: 1; padding: 12px; background: var(--bg-card-light); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-xs); color: #fff; font-family: inherit; font-size: 14px; text-align: center; }
.converter-btn { width: 100%; padding: 14px; background: var(--gold); border: none; border-radius: var(--radius-xs); color: var(--bg-deep); font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.converter-result { background: var(--bg-card-light); border-radius: var(--radius-xs); padding: 16px; margin-top: 16px; }
.converter-result-line { font-size: 14px; margin-bottom: 4px; }
.converter-result-line span { color: var(--gold-light); font-weight: 600; }

/* OVERLAY */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.overlay.active { display: flex; }
.dialog { background: var(--bg-card); border-radius: var(--radius); width: 100%; max-width: 360px; max-height: 85vh; overflow-y: auto; animation: slideUp 0.3s; position: relative; }
.dialog-close-btn { position: fixed; top: 20px; left: 20px; width: 36px; height: 36px; border: none; background: rgba(255,255,255,0.15); color: #fff; border-radius: 50%; font-size: 18px; cursor: pointer; z-index: 101; display: none; align-items: center; justify-content: center; }
.overlay.active .dialog-close-btn { display: flex; }
.dialog-header { background: linear-gradient(var(--bg-dark), var(--bg-card-light)); padding: 24px; text-align: center; border-radius: var(--radius) var(--radius) 0 0; }
.dialog-weekday { font-size: 18px; color: var(--gold-light); font-weight: 600; display: block; margin-bottom: 8px; }
.dialog-jalali { font-size: 24px; font-weight: 800; color: #fff; }
.dialog-gregorian { font-size: 13px; color: var(--gray-400); display: block; margin-top: 4px; }
.dialog-islamic { font-size: 13px; color: var(--teal-light); display: block; margin-top: 2px; }
.dialog-prayer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 20px; }
.dialog-prayer { background: var(--bg-card-light); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.dialog-prayer-icon { font-size: 24px; margin-bottom: 6px; }
.dialog-prayer-label { font-size: 11px; color: var(--gray-400); display: block; margin-bottom: 4px; }
.dialog-prayer-time { font-size: 16px; font-weight: 700; color: var(--gold-light); }
.dialog-events { padding: 0 20px 20px; }
.dialog-event { padding: 10px; border-radius: var(--radius-xs); margin-bottom: 6px; font-size: 13px; }
.dialog-event.type-birthday { background: rgba(233,30,99,0.2); color: var(--pink); }
.dialog-event.type-holiday { background: rgba(229,57,53,0.2); color: var(--red); }
.dialog-event.type-event { background: rgba(30,136,229,0.2); color: var(--blue-light); }

.city-dialog { background: var(--bg-card); border-radius: var(--radius); width: 100%; max-width: 340px; max-height: 75vh; padding: 20px; }
.city-dialog h3 { font-size: 16px; color: var(--gold-light); margin-bottom: 16px; text-align: center; }
.city-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 55vh; overflow-y: auto; margin-bottom: 16px; }
.city-item { padding: 12px; background: var(--bg-card-light); border-radius: var(--radius-xs); text-align: center; cursor: pointer; font-size: 13px; border: 1px solid rgba(255,255,255,0.05); }
.city-item.selected { background: rgba(212,168,67,0.2); border-color: var(--gold-dark); color: var(--gold-light); }

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