/* Reset & Core Styling */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-app: #f1f5f9;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
  --bg-card: rgba(255, 255, 255, 0.9);
  --primary: #0E4F8D; /* Brand Blue */
  --primary-rgb: 14, 79, 141;
  --primary-light: #1d76ce; /* Accent Blue */
  --primary-light-rgb: 29, 118, 206;
  --primary-glow: rgba(14, 79, 141, 0.1);
  --secondary: #0ea5e9; /* Light Blue */
  --secondary-rgb: 14, 165, 233;
  --accent: #f59e0b; /* Attention Amber */
  --text-main: #1e293b; /* Dark Slate */
  --text-muted: #64748b; /* Cool Slate */
  --border-color: #cbd5e1;
  --border-light: rgba(203, 213, 225, 0.5);
  --white: #ffffff;
  --card-shadow: 0 10px 30px -10px rgba(14, 79, 141, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
  --glass-shadow: 0 8px 32px 0 rgba(14, 79, 141, 0.06);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition-smooth: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-spring: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-main);
  background: var(--bg-gradient);
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Header & Navigation Bar Styling */
.app-header {
  padding: 0;
  position: relative;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  width: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo {
  font-size: 1.75rem;
}

.nav-brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.logo-area-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.vakif-name {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.vakif-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-light);
  border: none;
  padding: 0;
}

.hero-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2.5rem 1.5rem;
  text-align: center;
}

.main-title {
  font-size: 2.25rem;
  color: var(--text-main);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.intro-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 750px;
  margin: 0 auto 1.5rem auto;
}

.info-banner {
  display: inline-flex;
  align-items: center;
  background: rgba(14, 79, 141, 0.06);
  border: 1px solid rgba(14, 79, 141, 0.15);
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  font-size: 0.9rem;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(14, 79, 141, 0.02);
}

.banner-icon {
  margin-right: 0.5rem;
  font-size: 1rem;
}

/* Main Content Area */
.app-main {
  flex: 1;
  padding: 0 1.5rem 3rem 1.5rem;
}

.main-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Selection & Filter Bar */
.selection-bar {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 0;
  box-shadow: var(--glass-shadow);
}

.selector-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.custom-select-wrapper {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.custom-select-wrapper::after {
  content: '▼';
  font-size: 0.65rem;
  color: var(--primary);
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  transition: var(--transition-smooth);
}

select {
  width: 100%;
  padding: 0.85rem 2.5rem 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-main);
  background: var(--white);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

select:disabled {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(14, 79, 141, 0.06);
  border: 2px solid rgba(14, 79, 141, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* Workspace Layout Grid */
.workspace-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Map Panel */
.map-panel {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  position: relative;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.map-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1.91;
  overflow: hidden;
}

/* Interactive SVG Styling */
#svg-turkiye-haritasi {
  width: 100%;
  height: 100%;
  display: block;
}

#turkiye {
  transition: var(--transition-spring);
  transform-origin: center;
}

/* Base cities (inactive) */
#turkiye g {
  fill: #e2e8f0;
  stroke: #ffffff;
  stroke-width: 0.5px;
  transition: var(--transition-smooth);
  cursor: default;
}

#turkiye g path {
  fill: inherit;
  transition: var(--transition-smooth);
}

/* Active cities styling */
#turkiye g.active-province {
  fill: var(--primary-light);
  cursor: pointer;
}

#turkiye g.active-province:hover {
  fill: var(--primary);
  filter: drop-shadow(0 4px 12px rgba(14, 79, 141, 0.25));
}

/* Highlight city when zoomed in/focused */
#turkiye.focused g:not(.focused-province) {
  opacity: 0.3;
}

#turkiye g.focused-province {
  fill: var(--accent) !important;
  stroke: #ffffff;
  stroke-width: 1.5px;
}

/* Breathing animation for active cities to grab attention */
@keyframes activePulse {
  0% { fill: #1d76ce; }
  50% { fill: #3b82f6; }
  100% { fill: #1d76ce; }
}

#turkiye g.active-province:not(.focused-province) {
  animation: activePulse 3s infinite ease-in-out;
}

/* Map Legend */
.map-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid #f1f5f9;
  padding-top: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.active {
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(29, 118, 206, 0.2);
}

.legend-dot.inactive {
  background: #e2e8f0;
}

/* Details Panel & Cards */
.details-panel {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--glass-shadow);
  min-height: 480px;
  scroll-margin-top: 2rem;
}

.details-card-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Default state placeholder */
.default-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
  height: 100%;
}

.pulse-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.default-state h3 {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.default-state p {
  font-size: 0.9rem;
  max-width: 320px;
}

/* Dynamic details header */
.province-header {
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.province-header h2 {
  font-size: 1.5rem;
  color: var(--primary);
}

.center-count-badge {
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--white);
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
}

/* Center Details Card (rendered via JS) */
.gdtm-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.gdtm-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary-light);
  transition: var(--transition-smooth);
}

.gdtm-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -10px rgba(14, 79, 141, 0.12);
  border-color: rgba(29, 118, 206, 0.3);
}

.gdtm-card:hover::before {
  width: 6px;
}

.card-title {
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.info-item {
  display: flex;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}

.info-item .icon {
  margin-right: 0.75rem;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.info-item .label {
  font-weight: 600;
  color: var(--text-main);
  margin-right: 0.25rem;
  display: block;
}

.info-item .val {
  color: var(--text-muted);
}

/* Card CTA Action Buttons */
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.btn-action {
  flex: 1;
  min-width: 120px;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-action.btn-tel {
  background: rgba(14, 79, 141, 0.06);
  color: var(--primary);
  border: 1px solid rgba(14, 79, 141, 0.15);
}

.btn-action.btn-tel:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-action.btn-mail {
  background: rgba(14, 165, 233, 0.08);
  color: var(--secondary);
  border: 1px solid rgba(14, 165, 233, 0.15);
}

.btn-action.btn-mail:hover {
  background: var(--secondary);
  color: var(--white);
  border-color: var(--secondary);
}

.btn-action.btn-whatsapp {
  background: rgba(34, 197, 94, 0.08);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.15);
}

.btn-action.btn-whatsapp:hover {
  background: #22c55e;
  color: var(--white);
  border-color: #22c55e;
}

.btn-action.btn-map {
  background: rgba(245, 158, 11, 0.08);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.btn-action.btn-map:hover {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

/* Tooltip Styling */
.map-tooltip {
  position: fixed;
  background: rgba(30, 41, 59, 0.95);
  color: var(--white);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity 0.15s ease;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.map-tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: rgba(30, 41, 59, 0.95) transparent transparent;
}

.map-tooltip.visible {
  opacity: 1;
}

/* Footer Section */
.app-footer {
  padding: 3rem 1.5rem;
  text-align: center;
  background: rgba(14, 79, 141, 0.02);
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.footer-container {
  max-width: 600px;
  margin: 0 auto;
}

.app-footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.footer-note {
  font-size: 0.75rem !important;
  opacity: 0.8;
}

/* Screen Readers Only helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .workspace-grid {
    gap: 1.5rem;
  }
  
  .details-panel {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
  }

  .logo-area-right {
    align-items: center;
    text-align: center;
  }

  .hero-container {
    padding: 2rem 1rem 1.5rem 1rem;
  }

  .main-title {
    font-size: 1.75rem;
  }

  .intro-text {
    font-size: 0.95rem;
  }

  .info-banner {
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    border-radius: var(--radius-md);
    display: flex;
    text-align: left;
  }

  .selection-bar {
    padding: 1rem;
  }

  .selector-group {
    flex-direction: column;
    align-items: stretch;
  }

  .custom-select-wrapper {
    width: 100%;
  }

  .btn-secondary {
    width: 100%;
  }

  .map-panel {
    padding: 1rem;
    min-height: auto;
  }
  
  .card-actions {
    flex-direction: column;
  }
  
  .btn-action {
    width: 100%;
  }
}
