/* style.css */
:root {
    --blue:   #1e40af;
    --blue2:  #eff6ff;
    --red:    #dc2626;
    --red2:   #fef2f2;
    --bg:     #f3f4f6;
    --card:   #ffffff;
    --border: #e5e7eb;
    --text:   #111827;
    --muted:  #6b7280;
    --r:      8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
.content { flex: 1; }
.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* ── Header ── */
header { background: var(--blue); color: #fff; padding: 0; }
.header-inner {
    max-width: 1000px; margin: 0 auto; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: stretch;
    min-height: 56px;
}
.logo {
    font-size: 1.3rem; font-weight: 800; text-decoration: none; color: #fff;
    display: flex; align-items: center; gap: 8px; padding: 14px 0;
}
.header-tagline {
    font-size: 0.82rem; opacity: .75;
    display: flex; align-items: center;
}

/* ── Breadcrumbs ── */
.breadcrumbs { padding: 10px 20px; font-size: 0.82rem; color: var(--muted); background: #eef2ff; border-bottom: 1px solid #c7d2fe; text-align: right; }
.breadcrumbs a { color: var(--blue); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs span { margin: 0 5px; color: #d1d5db; }

/* ── Footer ── */
footer { background: #fff; border-top: 1px solid var(--border); padding: 18px 0; text-align: center; margin-top: auto; }
.footer-links { margin-bottom: 5px; }
.footer-links a { color: var(--blue); text-decoration: none; margin: 0 10px; font-size: 0.85rem; }
.footer-copy { font-size: 0.76rem; color: var(--muted); }

/* ── Loader ── */
.loader-overlay { position: fixed; inset: 0; background: rgba(243,244,246,.92); display: flex; align-items: center; justify-content: center; z-index: 9999; flex-direction: column; gap: 12px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { color: var(--muted); font-size: 0.88rem; }

/* ── Section Title ── */
.section-title { font-size: 1rem; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); color: var(--text); }

/* ── INDEX ── */
.intro-section { text-align: center; padding: 36px 0 18px; }
.intro-section h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 10px; }
.intro-section p  { font-size: 0.98rem; color: var(--muted); max-width: 620px; margin: 0 auto; line-height: 1.7; }
.countries-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 20px; }
.country-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 22px 12px; text-align: center; text-decoration: none; color: var(--text); display: flex; flex-direction: column; align-items: center; }
.country-card:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(30,64,175,.08); }
.flag-img { width: 72px; border-radius: 5px; margin-bottom: 10px; }
.country-name  { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.country-badge { font-size: 0.76rem; color: var(--blue); background: var(--blue2); padding: 3px 9px; border-radius: 20px; }
.seo-box { margin: 36px 0; padding: 20px; background: var(--card); border-radius: var(--r); border: 1px solid var(--border); font-size: 0.88rem; color: var(--muted); line-height: 1.7; }
.seo-box h2 { color: var(--text); margin-bottom: 8px; font-size: 0.95rem; }

/* ── COUNTRY ── */
.country-hero { text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 28px 20px; margin: 16px 0 24px; }
.country-hero img { width: 72px; border-radius: 5px; margin-bottom: 10px; }
.country-hero h1  { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.country-hero p   { color: var(--muted); font-size: 0.92rem; }
.cities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.city-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; text-align: center; text-decoration: none; color: var(--text); font-weight: 600; font-size: 0.92rem; display: block; }
.city-card:hover { border-color: var(--blue); color: var(--blue); background: var(--blue2); }
.country-seo { margin: 32px 0; padding: 20px; background: var(--card); border-radius: var(--r); border: 1px solid var(--border); border-right: 3px solid var(--blue); font-size: 0.88rem; color: var(--muted); line-height: 1.7; }
.country-seo h2 { color: var(--text); margin-bottom: 8px; font-size: 0.95rem; }

/* ── CITY — Header ── */
.city-header {
    padding: 18px 0 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    display: flex; justify-content: space-between;
    align-items: flex-start; flex-wrap: wrap; gap: 10px;
}
.city-title { font-size: 1.45rem; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.city-icon { font-size: 1rem; }
.city-meta { font-size: 0.85rem; color: var(--muted); line-height: 2; text-align: left; }
.city-meta strong { color: var(--text); }

/* ── CITY — Next Prayer ── */
.next-box {
    background: #fff; border: 1px solid var(--border); border-radius: var(--r);
    padding: 13px 16px; margin-bottom: 14px;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.next-info { display: flex; align-items: center; gap: 8px; }
.next-label { font-size: 0.78rem; color: var(--muted); }
.next-name  { font-size: 1.1rem; font-weight: 800; color: var(--red); }
.next-countdown-wrap {
    background: var(--red); color: #fff; border-radius: 6px;
    padding: 7px 14px; font-size: 0.82rem;
    display: flex; align-items: center; gap: 5px;
}
.next-countdown-wrap strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; letter-spacing: 1px; }

/* ── CITY — Prayer Times Row ── */
.pt-row {
    display: grid; grid-template-columns: repeat(5, 1fr);
    border: 1px solid var(--border); border-radius: var(--r);
    overflow: hidden; margin-bottom: 22px;
    background: var(--border); gap: 1px;
}
.pt-cell { background: #fff; padding: 16px 8px; text-align: center; }
.pt-cell.active  { background: var(--red); }
.pt-cell.passed  { background: #fafafa; }
.pt-name {
    font-size: 0.85rem; font-weight: 600;
    color: var(--muted); margin-bottom: 5px;
}
.pt-cell.active .pt-name { color: rgba(255,255,255,.8); }
.pt-cell.passed .pt-name { color: #c4c9d4; }
.pt-time {
    font-size: 1.65rem; font-weight: 800;
    color: var(--blue);                    /* ← لون أزرق واضح */
    font-variant-numeric: tabular-nums; line-height: 1;
}
.pt-cell.active .pt-time { color: #fff; font-size: 1.8rem; }  /* ← أكبر للصلاة القادمة */
.pt-cell.passed .pt-time { color: #c4c9d4; }
.pt-ampm { font-size: 0.7rem; color: var(--muted); margin-top: 4px; font-weight: 700; letter-spacing: .5px; }
.pt-cell.active .pt-ampm { color: rgba(255,255,255,.7); }
.pt-cell.passed .pt-ampm { color: #d1d5db; }

/* ── CITY — Info Box ── */
.info-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 18px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 14px; }
.info-item { flex: 1; min-width: 110px; }
.info-label { font-size: 0.72rem; color: var(--muted); margin-bottom: 2px; }
.info-value { font-size: 0.88rem; font-weight: 700; }

/* ── CITY — Week Table ── */
.week-section { margin-bottom: 26px; }
.week-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--r); overflow: hidden; font-size: 0.83rem; border: 1px solid var(--border); }
.week-table thead { background: var(--blue); color: #fff; }
.week-table th, .week-table td { padding: 9px 6px; text-align: center; border-bottom: 1px solid var(--border); }
.week-table th { font-weight: 700; font-size: 0.77rem; }
.week-table tbody tr:hover { background: #f9fafb; }
.week-table tbody tr.today-row { background: var(--blue2); font-weight: 700; }
.week-table tbody tr.today-row td { color: var(--blue); }
.day-label { font-weight: 700; font-size: 0.82rem; }

/* ── CITY — SEO ── */
.seo-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px; margin-bottom: 26px; font-size: 0.87rem; color: var(--muted); line-height: 1.8; }
.seo-section h2 { color: var(--text); margin-bottom: 8px; font-size: 0.95rem; font-weight: 700; }
.seo-section p  { margin-bottom: 5px; }
.seo-section p:last-child { margin-bottom: 0; }

/* ── CITY — Related Cities ── */
.related-cities { margin-bottom: 24px; margin-top: 28px; }
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.related-link {
    display: flex; align-items: center; gap: 7px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 6px; padding: 9px 14px;
    font-size: 0.88rem; color: var(--blue);
    text-decoration: none; font-weight: 600;
}
.related-link:hover { background: var(--blue2); border-color: var(--blue); }


/* ── Static Pages (contact / privacy) ── */
.static-page { max-width: 700px; margin: 30px auto 40px; }
.static-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.static-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 20px 22px; margin-bottom: 18px; font-size: 0.92rem; color: var(--muted); line-height: 1.85; }
.static-box h2 { color: var(--text); font-size: 1rem; font-weight: 700; margin-bottom: 12px; }

.static-section { margin-bottom: 18px; }
.static-section h2 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 8px; padding-right: 10px; border-right: 3px solid var(--blue); }
.static-section p { font-size: 0.9rem; color: var(--muted); line-height: 1.85; }

.static-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.static-list li { font-size: 0.9rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.static-list li::before { content: '📍'; font-size: 0.8rem; flex-shrink: 0; }

.contact-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 20px 22px; margin-bottom: 18px; display: flex; align-items: center; gap: 16px; }
.contact-icon { font-size: 2rem; }
.contact-label { font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.contact-email { font-size: 1.05rem; font-weight: 700; color: var(--blue); text-decoration: none; }
.contact-email:hover { text-decoration: underline; }

.inline-link { color: var(--blue); text-decoration: none; font-weight: 600; }
.inline-link:hover { text-decoration: underline; }


/* ── 404 Page ── */
.not-found { text-align: center; padding: 60px 20px; max-width: 500px; margin: 0 auto; }
.not-found-code { font-size: 6rem; font-weight: 800; color: var(--border); line-height: 1; margin-bottom: 10px; }
.not-found-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 12px; }
.not-found-msg { font-size: 0.95rem; color: var(--muted); margin-bottom: 28px; line-height: 1.7; }
.not-found-btn { display: inline-block; background: var(--blue); color: #fff; padding: 12px 28px; border-radius: var(--r); text-decoration: none; font-weight: 700; font-size: 0.95rem; }
.not-found-btn:hover { opacity: .9; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .header-inner { min-height: 50px; }
    .logo { font-size: 1.1rem; }
    .city-title { font-size: 1.15rem; }
    .city-header { flex-direction: column; gap: 8px; }
    .city-meta { text-align: right; }
    .pt-time { font-size: 1.3rem; }
    .pt-cell.active .pt-time { font-size: 1.45rem; }
    .pt-name { font-size: 0.78rem; }
    .week-table { font-size: 0.76rem; }
    .week-table th, .week-table td { padding: 7px 3px; }
    .cities-grid { grid-template-columns: 1fr 1fr; }
    .next-box { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    .related-grid { grid-template-columns: 1fr; }
    .pt-row { grid-template-columns: repeat(5, 1fr); }
    .pt-cell { padding: 12px 4px; }
    .pt-time { font-size: 1.05rem; }
    .pt-cell.active .pt-time { font-size: 1.15rem; }
    .pt-name { font-size: 0.7rem; }
    .pt-ampm { font-size: 0.6rem; }
    .countries-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .cities-grid { grid-template-columns: 1fr; }
    .intro-section h1 { font-size: 1.4rem; }
    .next-countdown-wrap { font-size: 0.76rem; }
    .next-countdown-wrap strong { font-size: 0.95rem; }
}

/* ── CITY — Info Section (SEO unique content) ── */
.city-info-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    border-right: 3px solid var(--blue);
    padding: 18px 20px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.85;
}
.city-info-section h2 {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.city-info-section p { margin-bottom: 8px; }
.city-info-section p:last-child { margin-bottom: 0; }

/* ── Related link active ── */
.related-link-active {
    background: var(--blue2);
    border-color: var(--blue);
    color: var(--blue);
    font-weight: 700;
    pointer-events: none;
    cursor: default;
}
