/* ==========================================================================
   KML KARELAJ PRO - MODERN GIS UYGULAMASI STİL DOSYASI
   ========================================================================== */

:root {
  --bg-main: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #283548;
  --bg-input: #192231;
  --border-color: #334155;
  --border-focus: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #60a5fa;
  --accent: #f59e0b;
  --success: #10b981;
  --success-hover: #059669;
  --danger: #ef4444;
  --grid-line-color: #f59e0b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
}

/* ANA DÜZEN */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* YAN PANEL */
.sidebar {
  width: 440px;
  min-width: 420px;
  max-width: 460px;
  height: 100vh;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.35);
}

.sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, #1e293b 0%, #172033 100%);
}

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

.logo-icon {
  width: 32px;
  height: 32px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.sidebar-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-content::-webkit-scrollbar {
  width: 6px;
}
.sidebar-content::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

/* KART TASARIMI */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.card:hover {
  border-color: #475569;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.card-title h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: #e2e8f0;
}

.step-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background-color: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
}

/* YÜKLEME ALANI */
.upload-area {
  position: relative;
  border: 2px dashed #475569;
  border-radius: var(--radius-md);
  padding: 22px 14px;
  text-align: center;
  background: rgba(15, 23, 42, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-area:hover, .upload-area.dragover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  width: 32px;
  height: 32px;
  color: #38bdf8;
  margin-bottom: 8px;
}

.upload-text {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.upload-text strong {
  color: #38bdf8;
}

.file-badge {
  display: inline-block;
  font-size: 0.72rem;
  background: #1e293b;
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  border: 1px solid #334155;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-actions {
  margin-top: 12px;
}

.quick-label {
  display: block;
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.btn-group-sm {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-outline-sm {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid var(--border-color);
  font-size: 0.73rem;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-outline-sm:hover {
  background: #334155;
  color: white;
  border-color: #475569;
}

/* METRİK VE ANALİZ */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.metric-box {
  background: var(--bg-input);
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-box.full-width {
  grid-column: span 2;
}

.metric-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.metric-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
}

.metric-val-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.metric-val-primary {
  font-size: 1.15rem;
  font-weight: 700;
  color: #38bdf8;
}

.metric-val-secondary {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* OTOMATİK ÖNERİ BANNERI */
.recommendation-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(56, 189, 248, 0.15) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rec-icon {
  font-size: 1.5rem;
}

.rec-text {
  flex: 1;
}

.rec-text h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: #38bdf8;
}

.rec-text p {
  font-size: 0.76rem;
  color: #cbd5e1;
  margin-top: 2px;
  line-height: 1.3;
}

.btn-primary-sm {
  background: var(--primary);
  color: white;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-primary-sm:hover {
  background: var(--primary-hover);
}

/* FORM ELEMANLARI */
.form-row {
  display: flex;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.flex-1 {
  flex: 1;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }

label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

input[type="text"],
input[type="number"],
.form-select {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: inherit;
  transition: border-color 0.15s;
  width: 100%;
}

input[type="text"]:focus,
input[type="number"]:focus,
.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit input {
  padding-right: 26px;
}

.input-with-unit .unit {
  position: absolute;
  right: 10px;
  font-size: 0.75rem;
  color: var(--text-dim);
  pointer-events: none;
}

.mode-tabs {
  display: flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.76rem;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

.checkbox-row {
  margin-top: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: #cbd5e1;
  cursor: pointer;
}

/* POLİGON SINIRLANDIRMA SEÇENEĞİ STİLLERİ */
.boundary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.badge-accent {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-select-highlight {
  border-color: #38bdf8 !important;
  background-color: #172338 !important;
  font-weight: 500;
}

.boundary-help-box {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  color: #bae6fd;
  line-height: 1.35;
}

/* İSİMLENDİRME BİLGİ ALERTI */
.info-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  color: #fde68a;
  line-height: 1.35;
}

.info-icon {
  width: 18px;
  height: 18px;
  color: #fbbf24;
  flex-shrink: 0;
  margin-top: 2px;
}

.preview-sequence-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-top: 12px;
}

.preview-title {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.preview-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  background: #334155;
  color: #38bdf8;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #475569;
}

.pill.pill-end {
  color: #34d399;
  border-color: #059669;
}

.dots {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* DIŞA AKTARMA BUTONLARI */
.export-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-export {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-kml {
  background: #0284c7;
  color: white;
}
.btn-kml:hover { background: #0369a1; }

.btn-geojson {
  background: #059669;
  color: white;
}
.btn-geojson:hover { background: #047857; }

.btn-dxf {
  background: #d97706;
  color: white;
}
.btn-dxf:hover { background: #b45309; }

.btn-csv {
  background: #475569;
  color: white;
}
.btn-csv:hover { background: #334155; }

/* SAĞ HARİTA ALANI */
.main-map-area {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #090d16;
}

.map-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  height: 48px;
  background: rgba(30, 41, 59, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: var(--shadow-lg);
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: #e2e8f0;
  font-weight: 500;
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* TOGGLE SWITCH */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  width: 32px;
  height: 18px;
  background: #475569;
  border-radius: 10px;
  position: relative;
  transition: 0.2s;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(14px);
}

.toggle-text {
  font-size: 0.78rem;
  color: #cbd5e1;
}

.opacity-slider-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.range-slider {
  width: 80px;
  height: 4px;
  cursor: pointer;
}

.btn-icon-only {
  background: #334155;
  border: 1px solid var(--border-color);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-icon-only:hover {
  background: #475569;
}

.btn-icon-only svg {
  width: 16px;
  height: 16px;
}

/* HARİTA KANVASI */
.map-canvas {
  flex: 1;
  width: 100%;
  height: 100%;
  z-index: 10;
}

/* ALT ÇEKMECE (DRAWER) */
.map-bottom-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(30, 41, 59, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border-color);
  z-index: 998;
  transition: max-height 0.3s ease;
  max-height: 42px;
  overflow: hidden;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.35);
}

.map-bottom-drawer.expanded {
  max-height: 280px;
}

.drawer-header {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  cursor: pointer;
  user-select: none;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
}

.drawer-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.map-bottom-drawer.expanded .drawer-arrow {
  transform: rotate(180deg);
}

.drawer-body {
  height: 238px;
  overflow-y: auto;
  padding: 0 16px 16px;
}

.table-container {
  overflow-x: auto;
}

.grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.grid-table th {
  background: #192231;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
}

.grid-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

.grid-table tr:hover td {
  background: rgba(56, 189, 248, 0.08);
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 24px !important;
}

/* LEAFLET ÖZEL ETİKET STİLİ */
.leaflet-cell-label {
  background: rgba(15, 23, 42, 0.88) !important;
  border: 1px solid rgba(245, 158, 11, 0.8) !important;
  color: #fef08a !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4) !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  transform: translate(-50%, -50%) !important;
}

/* LEAFLET POPUP STİLİ */
.leaflet-popup-content-wrapper {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-radius: 8px !important;
  border: 1px solid #475569 !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
}
.leaflet-popup-tip {
  background: #1e293b !important;
}
.popup-detail-table {
  width: 100%;
  margin-top: 6px;
  font-size: 0.75rem;
}
.popup-detail-table td {
  padding: 3px 0;
}
.popup-detail-table td:first-child {
  color: #94a3b8;
  width: 90px;
}

