:root {
  --accent: #dc2626;
  --accent-dark: #b91c1c;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

html, body {
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  height: 54px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -0.02em;
}

.brand-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #ffffff;
  background: #dc2626;
  border-radius: 4px;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.35rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 0.775rem;
  font-weight: 700;
  color: #334155;
}

@media (max-width: 640px) {
  .header-date-badge {
    display: none;
  }
}

.btn-locate {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.775rem;
  font-weight: 700;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-locate:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-locate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   MAIN CONTENT: SOLDA HARİTA, SAĞDA LİSTE
   ========================================================================== */
.main-content {
  display: grid;
  grid-template-columns: 1fr 440px;
  height: calc(100vh - 54px);
  overflow: hidden;
  flex: 1;
}

/* SOL: HARİTA */
.map-section {
  background: #f1f5f9;
  position: relative;
  height: 100%;
  min-height: 0;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

/* ==========================================================================
   SVG INTERAKTIF HARITA STILLERI
   ========================================================================== */
.svg-map-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  position: relative;
  user-select: none;
}

.svg-map-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
}

.tabs-group {
  display: flex;
  gap: 6px;
}

.svg-tab-btn {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.svg-tab-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.svg-tab-btn.active {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}

.svg-map-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
}

.legend-pin {
  width: 10px;
  height: 10px;
  background: #dc2626;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #dc2626;
  display: inline-block;
}

.svg-map-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  min-height: 0;
  overflow: hidden;
}

.svg-map-canvas {
  width: 100%;
  height: 100%;
  max-height: 100%;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
  transition: transform 0.2s ease;
}

/* İllerin Vektör Çizgileri */
.province-path {
  fill: #cbd5e1;
  stroke: #ffffff;
  stroke-width: 0.8px;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill 0.15s ease, stroke 0.15s ease, filter 0.15s ease;
}

.province-path:hover {
  fill: #94a3b8;
  stroke: #0f172a;
  stroke-width: 1.2px;
}

.province-path.selected {
  fill: #ef4444 !important;
  stroke: #991b1b !important;
  stroke-width: 1.5px;
  filter: drop-shadow(0 2px 4px rgba(220, 38, 38, 0.4));
}

/* Nöbetçi Eczane Pinleri (İşaretçiler) */
.pharmacy-svg-pin {
  pointer-events: none;
  cursor: pointer;
}

.pin-core {
  fill: #dc2626;
  stroke: #ffffff;
  stroke-width: 1.2px;
}

.pin-pulse {
  fill: rgba(220, 38, 38, 0.35);
  animation: svgPulse 2s infinite ease-in-out;
}

@keyframes svgPulse {
  0% {
    r: 3px;
    opacity: 0.9;
  }
  50% {
    r: 7px;
    opacity: 0.2;
  }
  100% {
    r: 3px;
    opacity: 0.9;
  }
}

/* Tooltip Bilgi Baloncuğu */
.svg-map-tooltip {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
}

.tooltip-action {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Alt Durum Çubuğu */
.svg-map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #ffffff;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: #475569;
}

.footer-city-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.active-city-label {
  color: #64748b;
  font-weight: 600;
}

.active-city-name {
  color: #dc2626;
  font-weight: 800;
}

.footer-count-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #166534;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

/* SAĞ: LİSTE VE FİLTRELER */
.list-section {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.list-header-panel {
  padding: 0.75rem 1rem 0.6rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.filter-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.custom-select,
.custom-input {
  width: 100%;
  height: 34px;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  outline: none;
}

.custom-select:focus,
.custom-input:focus {
  border-color: var(--accent);
  background-color: #ffffff;
}

.custom-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 1.8rem;
}

.search-input-wrapper {
  position: relative;
  margin-bottom: 0.5rem;
}

.search-icon-inside {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input-wrapper .custom-input {
  padding-left: 2rem;
}

.list-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.pharmacy-count-badge {
  font-size: 0.775rem;
  font-weight: 800;
  color: var(--text);
}

.pharmacy-count-badge span {
  color: var(--accent);
}

.current-duty-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1e293b;
  background: #f1f5f9;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}

.current-duty-date svg {
  color: #475569;
}

/* Kaydırılabilir Liste Alanı */
.list-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 0.65rem 0.85rem 1.5rem;
  background-color: var(--bg);
}

/* ==========================================================================
   ECZANE KARTLARI (TEMİZ, PROFESYONEL VE DÜZENLİ)
   ========================================================================== */
.pharmacy-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pharmacy-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.card-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.pharmacy-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.01em;
}

.pharmacy-card:hover .pharmacy-title {
  color: var(--accent);
}

.duty-hours-text {
  font-size: 0.825rem;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

.card-address-section {
  margin-bottom: 0.55rem;
}

.location-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.15rem;
}

.distance-text {
  color: #059669;
  font-weight: 700;
  font-size: 0.75rem;
}

.address-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0 0 0.25rem 0;
}

.directions-text {
  font-size: 0.725rem;
  color: #b45309;
  line-height: 1.3;
  margin: 0;
}

.directions-text span {
  font-weight: 700;
}

.card-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.45rem;
  border-top: 1px solid #f1f5f9;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 28px;
  padding: 0 0.6rem;
  font-size: 0.725rem;
  font-weight: 700;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-action-call {
  background: #f8fafc;
  color: #1e293b;
  border-color: var(--border);
  flex: 1.2;
}
.btn-action-call:hover {
  background: #e2e8f0;
}

.btn-action-route {
  background: #dc2626;
  color: #ffffff;
  flex: 1;
}
.btn-action-route:hover {
  background: #b91c1c;
}

.btn-action-focus {
  background: #0f172a;
  color: #ffffff;
  flex: 1;
}
.btn-action-focus:hover {
  background: #1e293b;
}

/* ==========================================================================
   HARİTA İĞNELERİ VE POPUP
   ========================================================================== */
.custom-pharmacy-pin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dc2626;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
}

.custom-pharmacy-pin:hover {
  transform: scale(1.15);
}

@keyframes pulse-beacon {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.user-beacon-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #2563eb;
  border: 2px solid #ffffff;
  animation: pulse-beacon 2s infinite;
}

.maplibregl-popup-content {
  border-radius: 6px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1) !important;
  padding: 0 !important;
  border: 1px solid var(--border) !important;
  overflow: hidden;
}

.popup-inner-card {
  padding: 0.75rem 0.85rem;
  min-width: 200px;
}

.popup-title {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.popup-duty-tag {
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.popup-address {
  font-size: 0.725rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.popup-actions-row {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.btn-popup {
  flex: 1;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  text-decoration: none;
}

.empty-state-box {
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.toast-success {
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0.75rem 0;
  border-radius: 4px;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.toast-alert {
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0.75rem 0;
  border-radius: 4px;
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   MOBİL (MAX-WIDTH: 900PX)
   ========================================================================== */
@media (max-width: 900px) {
  .app-container {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .header {
    padding: 0 0.85rem;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .brand-tag {
    display: none;
  }

  .main-content {
    display: block;
    height: auto;
  }

  .map-section {
    border-right: none;
    border-bottom: 1px solid var(--border);
    height: 42vh;
    min-height: 260px;
  }

  .list-section {
    height: auto;
    overflow: visible;
  }

  .list-scrollable {
    overflow: visible;
    height: auto;
  }
}

/* ==========================================================================
   HEADER NAV & BREADCRUMBS (ROUTEBAN STİLİ)
   ========================================================================== */
.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 0.5rem;
}

.header-nav-link {
  font-size: 0.74rem;
  font-weight: 800;
  color: #475569;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.header-nav-link:hover,
.header-nav-link.active {
  color: #dc2626;
  background-color: #fef2f2;
}

.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.45rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  flex-shrink: 0;
}

.breadcrumb-bar a {
  color: #dc2626;
  text-decoration: none;
}

.breadcrumb-bar a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  color: #cbd5e1;
}

.breadcrumb-current {
  color: #0f172a;
  font-weight: 700;
}

/* ==========================================================================
   İL İL ECZANELER DİZİN SAYFASI (ROUTEBAN /tr/ban STİLİ)
   ========================================================================== */
.city-index-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  width: 100%;
}

.city-index-hero {
  margin-bottom: 1.5rem;
}

.city-index-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.city-index-hero h1 {
  font-size: 1.65rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.city-total-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: #dc2626;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.city-index-hero p {
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.5;
}

.city-search-box {
  margin-bottom: 1.5rem;
}

.city-search-input {
  width: 100%;
  max-width: 500px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.city-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.city-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.city-card:hover {
  border-color: #dc2626;
  background: #fef2f2;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.08);
}

.city-card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.city-card-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.city-card:hover .city-card-name {
  color: #dc2626;
}

.city-card-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  align-self: flex-start;
}

.city-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.city-card-link {
  font-size: 0.75rem;
  font-weight: 800;
  color: #dc2626;
}

@media (max-width: 640px) {
  .header-nav {
    display: none;
  }
  .city-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .city-card {
    padding: 0.75rem;
  }
  .city-card-name {
    font-size: 0.95rem;
  }
}
