/**
 * Vakitlerin Namaz - Diyanet style (namazvakitleri.diyanet.gov.tr)
 * Dark blue header, light blue bar, teal main, yellow countdown
 */

:root {
  --header-bg: #1a365d;
  --header-dark: #0f2744;
  --location-bg: #3182ce;
  --location-light: #4299e1;
  --main-teal: #2c7a7b;
  --main-teal-dark: #234e52;
  --countdown-yellow: #ecc94b;
  --countdown-dark: #d69e2e;
  --bg: #edf2f7;
  --bg-card: #ffffff;
  --text: #2d3748;
  --text-muted: #4a5568;
  --border: #e2e8f0;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--location-light); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Header - Diyanet dark blue */
.site-header {
  background: linear-gradient(180deg, var(--header-bg) 0%, var(--header-dark) 100%);
  color: white;
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.site-header .container { position: relative; }
.site-header .header-inner { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.site-header .header-inner .logo { flex-shrink: 0; }
.logo { font-size: 1.2rem; font-weight: 700; color: white; display: flex; align-items: center; gap: 0.5rem; }
.logo:hover { color: white; opacity: 0.95; }
.nav-toggle { display: none; background: transparent; border: none; color: white; cursor: pointer; padding: 0.5rem; width: 40px; height: 40px; flex-direction: column; justify-content: center; gap: 5px; border-radius: 6px; }
.nav-toggle span { display: block; width: 22px; height: 2.5px; background: white; border-radius: 1px; transition: all 0.3s; }
.nav-toggle-active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle-active span:nth-child(2) { opacity: 0; }
.nav-toggle-active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
.nav-links { display: flex; gap: 1.5rem; list-style: none; flex-wrap: wrap; align-items: center; }
.nav-links a { color: rgba(255,255,255,0.95); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--countdown-yellow); text-decoration: none; }
/* Footer - links row, then subscribe row (left text + right form), copyright */
.footer-top { padding-bottom: 0.65rem; border-bottom: 1px solid rgba(255,255,255,0.15); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.85rem 1.25rem; list-style: none; margin: 0; align-items: center; }
.footer-links a { font-size: 0.95rem; }
.footer-subscribe-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; margin-top: 0.6rem; padding-bottom: 0.65rem; border-bottom: 1px solid rgba(255,255,255,0.15); }
.footer-subscribe-block { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.footer-subscribe-heading { font-size: 0.9rem; color: rgba(255,255,255,0.95); font-weight: 500; white-space: nowrap; }
.footer-subscribe-desk { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.subscribe-compact { display: flex; gap: 0.4rem; align-items: center; }
.subscribe-compact input[type="email"] { width: 200px; padding: 0.5rem 0.65rem; font-size: 0.9rem; border: 1px solid rgba(255,255,255,0.25); border-radius: 6px; background: rgba(255,255,255,0.08); color: white; }
.subscribe-compact input[type="email"]::placeholder { color: rgba(255,255,255,0.6); }
.subscribe-compact button { padding: 0.5rem 1rem; font-size: 0.9rem; background: var(--countdown-yellow); color: var(--header-dark); font-weight: 600; border: none; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.subscribe-compact button:hover { background: #f6e05e; }
.footer-copyright { margin-top: 0.75rem; font-size: 0.9rem; color: rgba(255,255,255,0.9); }
.footer-subscribe { display: none; }
.subscribe-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.subscribe-form input[type="email"] { flex: 1; min-width: 120px; padding: 0.5rem 0.6rem; border: 1px solid rgba(255,255,255,0.3); border-radius: 4px; background: rgba(255,255,255,0.1); color: white; font-size: 0.9rem; }
.subscribe-form input[type="email"]::placeholder { color: rgba(255,255,255,0.7); }
.subscribe-form button { padding: 0.5rem 0.85rem; background: var(--countdown-yellow); color: var(--header-dark); font-weight: 600; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
.subscribe-form button:hover { background: #f6e05e; }
/* Mobile menu */
.nav-back { display: none; background: none; border: none; color: white; font-size: 1rem; font-weight: 500; cursor: pointer; padding: 0.75rem 0; margin-bottom: 0.5rem; align-self: flex-start; }
.nav-back:hover { color: var(--countdown-yellow); }
.menu-subscribe { display: none; padding: 1rem 0; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 0.5rem; }
.menu-subscribe-label { display: block; font-size: 0.85rem; margin-bottom: 0.5rem; color: rgba(255,255,255,0.9); }
@media (max-width: 767px) {
  /* Mobile header - better touch & safe area */
  .site-header {
    padding: 0.75rem 0;
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  .site-header .header-inner { justify-content: space-between; width: 100%; }
  .site-header .container { padding-left: 0.5rem; padding-right: 0.5rem; }
  .logo { font-size: 1.25rem; font-weight: 700; line-height: 1.3; max-width: calc(100vw - 4rem); }
  .nav-toggle {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    flex-shrink: 0;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle:active { background: rgba(255,255,255,0.1); }
  /* Mobile menu panel - UX */
  .nav-wrap {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(300px, 88vw);
    max-width: 88vw;
    height: 100vh;
    height: 100dvh;
    padding: max(1rem, env(safe-area-inset-top)) 1.25rem 1.5rem max(1.25rem, env(safe-area-inset-right));
    background: var(--header-dark);
    z-index: 99;
    transition: right 0.25s ease-out;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: -6px 0 24px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    -webkit-overflow-scrolling: touch;
  }
  .nav-wrap.nav-open { right: 0; }
  .nav-back {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.6rem 0;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    -webkit-tap-highlight-color: transparent;
    border-radius: 8px;
  }
  .nav-back:active { background: rgba(255,255,255,0.08); }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-links li { border-bottom: 1px solid rgba(255,255,255,0.12); }
  .nav-links a {
    display: block;
    padding: 1rem 0;
    font-size: 1.05rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-links a:active { background: rgba(255,255,255,0.06); }
  .menu-subscribe {
    display: block;
    padding: 1.25rem 0 0;
    margin-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.12);
  }
  .menu-subscribe-label { font-size: 0.9rem; margin-bottom: 0.6rem; font-weight: 500; }
  .menu-subscribe .subscribe-form { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .menu-subscribe .subscribe-form input[type="email"] {
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
    border-radius: 8px;
  }
  .menu-subscribe .subscribe-form button {
    min-height: 44px;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    border-radius: 8px;
  }
  .footer-subscribe-desk { display: none !important; }
  .footer-subscribe-row { display: none !important; }
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 98;
    transition: opacity 0.25s ease;
  }
  .nav-body-open .nav-overlay { display: block; }
  /* Prevent body scroll when menu open */
  .nav-body-open { overflow: hidden; }
  body { overflow-x: hidden; }
  .location-bar .container { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
  .location-bar .city-name { font-size: 1.05rem; }
}
@media (min-width: 768px) {
  .nav-wrap { display: flex; align-items: center; justify-content: center; flex: 1; }
  .nav-links { gap: 2rem; justify-content: center; }
  .menu-subscribe { display: none; }
}

/* Location bar - Light blue (Diyanet style) - full width */
.location-bar {
  background: linear-gradient(180deg, var(--location-light) 0%, var(--location-bg) 100%);
  color: white;
  padding: 0.9rem 0;
  margin-bottom: 1.5rem;
  width: 100%;
}
.location-bar > .container { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.location-bar .city-name { font-weight: 700; font-size: 1.15rem; }
.location-bar .country { font-size: 0.9rem; opacity: 0.95; }
.location-bar a { color: white; font-weight: 500; padding: 0.35rem 0.75rem; background: rgba(255,255,255,0.2); border-radius: 6px; }
.location-bar a:hover { background: rgba(255,255,255,0.3); text-decoration: none; }
.breadcrumb { padding: 0.6rem 0; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--location-bg); }
.breadcrumb span { margin: 0 0.3rem; opacity: 0.6; }

/* Main prayer card - Teal (Diyanet style) */
.main-prayer-card {
  background: linear-gradient(180deg, var(--main-teal) 0%, var(--main-teal-dark) 100%);
  color: white;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(44,122,123,0.3);
}

/* Date row */
.date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.25);
}
.date-row .gregorian { font-size: 1.2rem; font-weight: 600; }
.date-row .hijri { font-size: 1rem; opacity: 0.95; }
.date-row .hijri.ramadan { color: var(--countdown-yellow); font-weight: 600; }

/* Countdown + Local time row - Yellow large display */
.countdown-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.countdown-item { text-align: left; }
.countdown-item .label { font-size: 0.9rem; opacity: 0.9; margin-bottom: 0.25rem; }
.countdown-item .value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--countdown-yellow);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}
@media (max-width: 600px) {
  .countdown-row { grid-template-columns: 1fr; }
  .countdown-item .value { font-size: 1.8rem; }
}

/* Horizontal prayer times - Diyanet style */
.prayer-times-horizontal {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 768px) {
  .prayer-times-horizontal { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .prayer-times-horizontal { grid-template-columns: repeat(2, 1fr); }
}
.prayer-box {
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.15);
}
.prayer-box .name { font-size: 0.85rem; display: block; margin-bottom: 0.25rem; opacity: 0.9; }
.prayer-box .time { font-size: 1.15rem; font-weight: 700; }
.prayer-box.current { background: rgba(236,201,75,0.25); border-color: var(--countdown-yellow); }

/* Qibla/astronomical bar - Darker teal */
.info-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255,255,255,0.2);
  font-size: 0.9rem;
}
.info-bar .item .label { opacity: 0.85; font-size: 0.8rem; }
.info-bar .item .val { font-weight: 600; }

/* Tabs - Haftalık, Aylık */
.time-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.time-tabs a {
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.time-tabs a:hover { color: var(--main-teal); background: white; }
.time-tabs a.active { color: var(--main-teal); background: white; border-color: var(--main-teal); box-shadow: 0 2px 4px rgba(0,0,0,0.06); }

/* Cards (white section) */
.card {
  background: var(--bg-card);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}
.card.standalone { border-radius: 10px; }
.card h2 { font-size: 1.1rem; margin-bottom: 1rem; color: var(--text); border-bottom: 2px solid var(--main-teal); padding-bottom: 0.5rem; font-weight: 600; }

/* Legacy vertical prayer grid (fallback) */
.prayer-times-grid { display: grid; gap: 0.5rem; }
.prayer-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.75rem; background: var(--bg); border-radius: 6px; font-size: 0.95rem;
}
.prayer-row.current { background: rgba(44,122,123,0.1); border-left: 4px solid var(--main-teal); }
.prayer-name { font-weight: 500; color: var(--text); }
.prayer-time { font-weight: 700; color: var(--main-teal); }

/* Date block (compact) */
.date-block { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.date-block .hijri { font-size: 1rem; font-weight: 600; color: var(--main-teal); }
.date-block .gregorian { font-size: 0.9rem; color: var(--text-muted); }
.date-block .local-time { font-size: 0.95rem; font-weight: 600; }

/* Progress bar */
.countdown-progress { height: 6px; background: rgba(255,255,255,0.2); border-radius: 3px; margin-top: 0.5rem; overflow: hidden; }
.countdown-progress-bar { height: 100%; background: var(--countdown-yellow); border-radius: 3px; transition: width 1s linear; }

/* Current prayer highlight (in countdown box) */
.current-prayer-highlight .next-name { font-size: 1.1rem; font-weight: 700; }
.current-prayer-highlight .countdown-text { font-size: 1.5rem; font-weight: 700; }
.current-prayer-highlight .countdown-text strong { color: var(--countdown-yellow); }

/* Qibla compass (compact) */
.qibla-card { text-align: center; }
.qibla-compass { width: 160px; height: 160px; margin: 1rem auto; position: relative; background: var(--header-dark); border-radius: 50%; }
.qibla-compass-inner { position: absolute; inset: 6px; border-radius: 50%; border: 2px solid #4a5568; background: white; }
.qibla-needle { position: absolute; left: 50%; top: 50%; width: 3px; height: 32%; background: #dc2626; transform-origin: bottom center; margin-left: -1.5px; border-radius: 2px; }
.qibla-arrow { position: absolute; left: 50%; top: 50%; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 40px solid var(--main-teal); transform-origin: 50% 100%; margin-left: -6px; margin-top: -40px; }
.qibla-directions { position: absolute; inset: 0; font-size: 10px; font-weight: 700; color: #2d3748; }
.qibla-directions span { position: absolute; }
.qibla-directions .n { top: 3px; left: 50%; transform: translateX(-50%); }
.qibla-directions .e { right: 5px; top: 50%; transform: translateY(-50%); }
.qibla-directions .s { bottom: 3px; left: 50%; transform: translateX(-50%); }
.qibla-directions .w { left: 5px; top: 50%; transform: translateY(-50%); }
.qibla-angles { margin-top: 0.75rem; font-size: 0.85rem; text-align: left; }
.qibla-angles div { margin: 0.2rem 0; }
.qibla-angles strong { color: var(--main-teal); }

/* Map */
.map-container { height: 200px; background: var(--bg); border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.map-container iframe { width: 100%; height: 100%; border: none; }
.coords { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.35rem; }
.map-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; font-style: italic; }

/* 3-column layout */
.main-cards { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .main-cards { grid-template-columns: 1fr; } }

/* Main content area */
main.container { padding-top: 0.5rem; padding-bottom: 2rem; }

/* Time nav */
.time-nav { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.time-nav a { padding: 0.5rem 1rem; background: var(--main-teal); color: white !important; border-radius: 6px; font-size: 0.9rem; font-weight: 500; }
.time-nav a:hover { background: var(--main-teal-dark); text-decoration: none; }

/* Next prayer bar */
.next-prayer-bar {
  background: var(--main-teal);
  color: white;
  padding: 0.5rem 1rem;
  position: sticky;
  top: 48px;
  z-index: 99;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.next-prayer-bar .container { display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.next-label { opacity: 0.9; font-size: 0.9rem; }
.next-name { font-weight: 700; }
.next-time { font-weight: 600; }

/* Ramadan */
#ramadan-block { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); border: 2px solid #f59e0b; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.ramadan-highlight h3 { color: #92400e; margin-bottom: 0.75rem; font-size: 1.1rem; }
.ramadan-times { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.ramadan-item span { font-size: 0.85rem; color: #78350f; }
.ramadan-item strong { font-size: 1.1rem; color: #b45309; }

/* Internal links */
.seo-intro { font-size: 0.95rem; color: var(--text); line-height: 1.75; margin-bottom: 1rem; }
.internal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 1rem;
}
.internal-links a {
  padding: 0.5rem 1rem;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.88rem;
  transition: all 0.2s;
  text-align: center;
}
.internal-links a:hover { background: var(--main-teal); color: white !important; text-decoration: none; }

/* FAQ */
.faq-list { list-style: none; }
.faq-list li { margin-bottom: 0.75rem; padding: 0.75rem; background: var(--bg); border-radius: 6px; border-left: 4px solid var(--main-teal); }
.faq-list h4 { font-size: 0.95rem; margin-bottom: 0.35rem; }
.faq-list p { font-size: 0.88rem; color: var(--text-muted); }

/* Table */
.table-responsive { overflow-x: auto; margin: 0.75rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg); font-weight: 600; }
tr:hover td { background: rgba(44,122,123,0.04); }

/* Footer */
.site-footer { background: var(--header-dark); color: rgba(255,255,255,0.9); padding: 1.5rem 0; margin-top: 2rem; }
.site-footer a { color: #90cdf4; }
.site-footer a:hover { color: white; text-decoration: none; }
.page-hero { padding: 1rem 0; text-align: center; }
.page-hero h1 { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 700; color: var(--text); }
.home-hero { padding: 1.5rem 0; }
.home-hero h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
.card-search { border-left: 4px solid var(--main-teal); }
.card-desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; }
.search-input { width: 100%; max-width: 420px; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; }
.search-input:focus { outline: none; border-color: var(--main-teal); box-shadow: 0 0 0 2px rgba(44,122,123,0.2); }
.search-results { margin-top: 0.5rem; }
.search-result-item { display: block; padding: 0.5rem 0.75rem; border-radius: 6px; transition: background 0.2s; }
.search-result-item:hover { background: var(--bg); }
.countdown-box { margin-bottom: 1rem; }
@media (max-width: 768px) { .next-prayer-bar { top: auto; } }
/* Contact form - Formspree */
.contact-form { max-width: 520px; margin-top: 1rem; }
.contact-form label { display: block; font-weight: 500; margin-bottom: 0.35rem; font-size: 0.9rem; }
.contact-form input, .contact-form textarea { width: 100%; padding: 0.65rem 0.85rem; border: 1px solid var(--border); border-radius: 6px; font-size: 1rem; margin-bottom: 1rem; font-family: inherit; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--main-teal); box-shadow: 0 0 0 2px rgba(44,122,123,0.2); }
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form button[type="submit"] { padding: 0.65rem 1.5rem; background: var(--main-teal); color: white; font-weight: 600; border: none; border-radius: 6px; cursor: pointer; font-size: 1rem; }
.contact-form button[type="submit"]:hover { background: var(--main-teal-dark); }
.contact-form .form-success { color: #276749; background: #c6f6d5; padding: 0.75rem; border-radius: 6px; margin-top: 1rem; }
