@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  --bg-dark: #060b14;
  --bg-grad: #0d172a;
  --card-bg: #0f172a;
  --card-border: rgba(56, 189, 248, 0.16);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-glow: rgba(56, 189, 248, 0.35);
  --gold: #fbbf24;
  --holiday-orange: #f97316;
  --holiday-bg: rgba(249, 115, 22, 0.16);
  --holiday-border: rgba(249, 115, 22, 0.55);
  --emerald: #10b981;
  --crimson: #f43f5e;
}

/* تم ویژه ماه محرم برای صفحه قمری */
body.muharram-theme {
  --bg-dark: #090305;
  --bg-grad: #1c070d;
  --card-bg: #18090e;
  --card-border: rgba(225, 29, 72, 0.3);
  --accent: #e11d48;
  --accent-soft: rgba(225, 29, 72, 0.15);
  --accent-glow: rgba(225, 29, 72, 0.45);
}

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

body {
  font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 50% 0%, var(--bg-grad) 0%, var(--bg-dark) 75%);
  color: var(--text-main);
  min-height: 100vh;
  direction: rtl;
  line-height: 1.65;
}

.container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 18px;
}

/* هدر */
header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  margin-bottom: 20px;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.nav-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-tabs a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.nav-tabs a:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tabs a.active {
  color: #040914;
  background: var(--accent);
  font-weight: 800;
  box-shadow: 0 0 18px var(--accent-glow);
}

.muharram-banner {
  display: none;
  background: linear-gradient(90deg, #4c0519, #881337, #4c0519);
  border: 1px solid #be123c;
  color: #ffe4e6;
  padding: 12px 18px;
  border-radius: 14px;
  text-align: center;
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 0 24px rgba(225, 29, 72, 0.3);
}

/* داشبورد سه‌ستونه اصلی */
.hero-dashboard {
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .hero-dashboard {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 10px;
  gap: 8px;
}

/* کارت تقویم ماهانه */
.today-summary {
  text-align: center;
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 11px;
  margin-bottom: 12px;
}

.today-main-date {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.today-sub-dates {
  font-size: 0.81rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cal-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 10px;
  border-radius: 10px;
}

.cal-nav-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.cal-nav-btn:hover {
  background: var(--accent);
  color: #050a15;
}

.cal-month-label {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent);
}

.cal-today-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
}

.cal-today-btn:hover {
  background: var(--accent);
  color: #050a15;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  text-align: center;
}

.cal-weekday {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 700;
  padding: 3px 0;
}

.cal-weekday.fri {
  color: var(--holiday-orange);
}

.cal-day {
  position: relative;
  aspect-ratio: 1 / 0.9;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cal-day:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.cal-day.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
  pointer-events: none;
}

/* رنگ نارنجی اختصاصی برای تمام تعطیلات رسمی و جمعه‌ها */
.cal-day.holiday {
  color: #fdba74;
  background: var(--holiday-bg);
  border-color: var(--holiday-border);
  font-weight: 800;
}

.cal-day.today {
  background: var(--accent);
  color: #040914;
  font-weight: 900;
  box-shadow: 0 0 14px var(--accent-glow);
}

.cal-day.today.holiday {
  box-shadow: 0 0 0 2px var(--holiday-orange), 0 0 14px var(--accent-glow);
}

.cal-day.selected:not(.today) {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1.5px var(--gold);
}

.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 2px;
}

.cal-day.holiday .cal-dot {
  background: var(--holiday-orange);
}

.cal-day.today .cal-dot {
  background: #040914;
}

.cal-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.cal-day-footer {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 11px;
  font-size: 0.81rem;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.cal-day-footer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 6px;
}

.cal-day-footer strong {
  color: var(--gold);
}

.holiday-pill-badge {
  background: var(--holiday-orange);
  color: #090400;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 20px;
}

.ev-line {
  color: var(--text-main);
  margin-top: 3px;
}

.ev-line.is-hol {
  color: #fdba74;
  font-weight: 700;
}

/* ستون وسط: ساعت دایره‌ای بدون لرزش */
.clock-center-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.08) 0%, var(--card-bg) 70%);
}

.dial-wrapper {
  position: relative;
  width: 276px;
  height: 276px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px auto 14px;
}

.dial-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.dial-bg-ring {
  fill: rgba(6, 11, 20, 0.65);
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 7;
}

.dial-sec-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 792;
  stroke-dashoffset: 792;
}

.dial-inner-ring {
  fill: none;
  stroke: rgba(251, 191, 36, 0.22);
  stroke-width: 2;
  stroke-dasharray: 4 6;
}

.dial-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dial-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.digital-readout {
  direction: ltr;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.d-box {
  display: inline-block;
  width: 1.15ch;
  text-align: center;
}

.d-colon {
  display: inline-block;
  width: 0.55ch;
  text-align: center;
  color: var(--accent);
}

.cs-pill {
  margin-top: 6px;
  direction: ltr;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--gold);
  padding: 2px 14px;
  border-radius: 20px;
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cs-box {
  display: inline-block;
  width: 1.15ch;
  text-align: center;
}

.tz-caption {
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (max-width: 400px) {
  .container { padding: 10px; }
  .card { padding: 14px; }
  .dial-wrapper { width: 230px; height: 230px; }
  .digital-readout { font-size: 1.9rem; }
}

/* ستون سوم: اوقات شرعی */
.city-select {
  background: rgba(6, 11, 20, 0.85);
  color: var(--text-main);
  border: 1px solid var(--card-border);
  padding: 5px 10px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  outline: none;
}

.next-adhan-card {
  background: linear-gradient(135deg, var(--accent-soft), rgba(251, 191, 36, 0.08));
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.next-adhan-title {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.next-adhan-title strong {
  color: var(--text-main);
  display: block;
  font-size: 0.95rem;
}

.next-adhan-countdown {
  direction: ltr;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.prayer-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.prayer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
}

.prayer-row.is-next {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.4);
}

.prayer-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prayer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.prayer-row.is-next .prayer-dot {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.prayer-clock {
  font-weight: 800;
  color: var(--accent);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

/* بخش پایین */
.lower-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 960px) {
  .lower-grid {
    grid-template-columns: 1fr;
  }
}

.left-col-stack, .right-col-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* تایم‌لپس */
.year-axis-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  padding: 5px 12px;
  background: var(--accent-soft);
  border-radius: 8px;
}

.year-line-container {
  position: relative;
  border-right: 3px solid var(--accent);
  margin: 14px 18px 14px 4px;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.event-track-item {
  position: relative;
  padding-right: 14px;
}

.event-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.event-name {
  font-weight: 700;
  color: var(--text-main);
}

.event-date-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-right: 5px;
}

.event-countdown {
  font-size: 0.78rem;
  color: var(--gold);
  background: rgba(251, 191, 36, 0.1);
  padding: 2px 9px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.track-rail {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  width: 100%;
  margin-top: 7px;
}

.moving-orb {
  position: absolute;
  top: 50%;
  transform: translate(50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transition: right 0.6s ease;
}

.moving-orb.arrived {
  animation: pulseOrb 1.2s infinite;
}

@keyframes pulseOrb {
  0% { transform: translate(50%, -50%) scale(1); }
  50% { transform: translate(50%, -50%) scale(1.35); }
  100% { transform: translate(50%, -50%) scale(1); }
}

.toggle-events-btn {
  width: 100%;
  margin-top: 10px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--card-border);
  color: var(--accent);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
}

.toggle-events-btn:hover {
  background: var(--accent-soft);
}

/* مبدل جامع تاریخ */
.conv-controls {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr 0.9fr;
  gap: 8px;
  margin-bottom: 14px;
}

@media (max-width: 600px) {
  .conv-controls {
    grid-template-columns: 1fr 1fr;
  }
}

.conv-select, .conv-input {
  background: rgba(6, 11, 20, 0.85);
  color: var(--text-main);
  border: 1px solid var(--card-border);
  padding: 8px 10px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.86rem;
  width: 100%;
  outline: none;
}

.conv-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 600px) {
  .conv-results-grid {
    grid-template-columns: 1fr;
  }
}

.conv-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.conv-box-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.conv-box-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.copy-mini-btn {
  background: rgba(255, 255, 255, 0.07);
  border: none;
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.copy-mini-btn:hover {
  background: var(--accent);
  color: #040914;
}

/* کارت ایده روز هوش مصنوعی */
.ai-idea-card {
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.12), rgba(56, 189, 248, 0.06));
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 14px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-idea-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ai-badge {
  background: #a855f7;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 20px;
}

.ai-idea-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.ai-idea-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ai-prompt-box {
  background: rgba(6, 11, 20, 0.7);
  border: 1px dashed rgba(168, 85, 247, 0.45);
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  color: #e9d5ff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* سخن روز و کتاب ماه */
.quote-box {
  background: linear-gradient(145deg, var(--accent-soft), transparent);
  border-right: 4px solid var(--gold);
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.93rem;
}

.quote-author {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 700;
}

.book-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 15px;
  border-radius: 14px;
}

.book-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  background: var(--emerald);
  color: #022c22;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 800;
}

.book-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.book-author {
  font-size: 0.82rem;
  color: var(--emerald);
}

.book-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}
