/* ================================================
   İ-ZTS Ana CSS Tasarım Sistemi
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/npm/remixicon@4.9.0/fonts/remixicon.css');


:root {
  /* Renk Paleti */
  --izts-green-dk:   #0d5c1e;
  --izts-green:      #1a7a1a;
  --izts-green-lt:   #4caf50;
  --izts-yellow:     #f5c518;
  --izts-orange:     #e67e22;
  --izts-red:        #c0392b;
  --izts-red-dk:     #922b21;

  /* Dark UI */
  --izts-dark:       #0d1117;
  --izts-dark-2:     #161b22;
  --izts-dark-3:     #21262d;
  --izts-card:       #1c2128;
  --izts-border:     #30363d;
  --izts-border-lt:  #3d444d;

  /* Text */
  --text-primary:    #e6edf3;
  --text-secondary:  #8b949e;
  --text-muted:      #6e7681;

  /* Gradients */
  --grad-green:   linear-gradient(135deg, #0d5c1e 0%, #1a7a1a 50%, #2d9e2d 100%);
  --grad-danger:  linear-gradient(135deg, #922b21 0%, #c0392b 100%);
  --grad-dark:    linear-gradient(135deg, #0d1117 0%, #161b22 100%);

  --font-main:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:       10px;
  --radius-lg:    16px;
  --shadow:       0 4px 24px rgba(0,0,0,0.35);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.20);
  --transition:   all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-main);
  background: var(--izts-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--izts-green-lt); text-decoration: none; transition: var(--transition); }
a:hover { color: #76d97a; }

img { max-width: 100%; height: auto; }

/* === Navbar === */
.izts-navbar {
  background: var(--izts-dark-2);
  border-bottom: 1px solid var(--izts-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--izts-green-lt);
  letter-spacing: -0.02em;
}

.navbar-brand .brand-icon {
  width: 38px;
  height: 38px;
  background: var(--grad-green);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.navbar-nav .nav-link {
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--text-primary);
  background: var(--izts-dark-3);
}

/* === Kart Bileşeni === */
.izts-card {
  background: var(--izts-card);
  border: 1px solid var(--izts-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: var(--transition);
}

.izts-card:hover { border-color: var(--izts-border-lt); }

.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.card-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* === Risk Renk Sınıfları === */
.risk-0   { background: #1a7a1a; }
.risk-1   { background: #1e8a1e; }
.risk-2   { background: #2ea82e; }
.risk-3   { background: #7ab317; }
.risk-4   { background: #96c21a; }
.risk-5   { background: #f5c518; color: #333; }
.risk-6   { background: #f0ad4e; color: #333; }
.risk-7   { background: #e67e22; }
.risk-8   { background: #d35400; }
.risk-9   { background: #c0392b; }
.risk-10  { background: #922b21; }

/* Risk badge */
.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: white;
}

/* === Tür Seçim Kartları === */
.tur-kart {
  cursor: pointer;
  border: 2px solid var(--izts-border);
  border-radius: var(--radius);
  padding: 0.75rem 0.5rem;
  text-align: center;
  transition: var(--transition);
  background: var(--izts-dark-3);
  user-select: none;
}

.tur-kart:hover {
  border-color: var(--izts-green-lt);
  background: rgba(76, 175, 80, 0.1);
  transform: translateY(-2px);
}

.tur-kart.secili {
  border-color: var(--izts-green-lt);
  background: rgba(76, 175, 80, 0.18);
  box-shadow: 0 0 0 3px rgba(76,175,80,0.2);
}

.tur-kart img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: var(--izts-border);
}

.tur-kart .tur-ad {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.3;
}

.tur-kart.secili .tur-ad { color: var(--izts-green-lt); }

/* === Form Elemanları === */
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--izts-dark-3);
  border: 1px solid var(--izts-border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-main);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--izts-green-lt);
  box-shadow: 0 0 0 3px rgba(76,175,80,0.15);
}

.form-control::placeholder { color: var(--text-muted); }

/* === Düğmeler === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-main);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--izts-green);
  color: white;
}
.btn-primary:hover { background: #1e8f1e; transform: translateY(-1px); }

.btn-danger {
  background: var(--izts-red);
  color: white;
}
.btn-danger:hover { background: var(--izts-red-dk); }

.btn-secondary {
  background: var(--izts-dark-3);
  color: var(--text-secondary);
  border: 1px solid var(--izts-border);
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--izts-border-lt); }

.btn-warning {
  background: var(--izts-orange);
  color: white;
}
.btn-warning:hover { background: #d35400; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* === Bildirim Durum Badge'leri === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-beklemede  { background: rgba(243,156,18,0.15); color: #f39c12; border: 1px solid rgba(243,156,18,0.3); }
.badge-onaylandi  { background: rgba(76,175,80,0.15);  color: #4caf50; border: 1px solid rgba(76,175,80,0.3); }
.badge-reddedildi { background: rgba(192,57,43,0.15);  color: #e74c3c; border: 1px solid rgba(192,57,43,0.3); }
.badge-aktif      { background: rgba(76,175,80,0.15);  color: #4caf50; }
.badge-pasif      { background: rgba(110,118,129,0.15);color: #8b949e; }

/* === Tablo === */
.izts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.izts-table th {
  padding: 0.75rem 1rem;
  background: var(--izts-dark-3);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-align: left;
  border-bottom: 1px solid var(--izts-border);
}

.izts-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--izts-border);
  color: var(--text-primary);
  vertical-align: middle;
}

.izts-table tbody tr:hover { background: var(--izts-dark-3); }
.izts-table tbody tr:last-child td { border-bottom: none; }

/* === Drag & Drop Yükleme Alanı === */
.upload-area {
  border: 2px dashed var(--izts-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--izts-dark-3);
  position: relative;
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--izts-green-lt);
  background: rgba(76,175,80,0.05);
}

.upload-area .upload-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.upload-area .upload-text { color: var(--text-secondary); font-size: 0.9rem; }
.upload-area input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

.upload-preview {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-top: 0.75rem;
  display: none;
}

/* === Uyarı / Alert === */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border-left: 3px solid;
}
.alert-success { background: rgba(76,175,80,0.1);  border-color: #4caf50; color: #76d97a; }
.alert-danger  { background: rgba(192,57,43,0.1);  border-color: #e74c3c; color: #e77; }
.alert-warning { background: rgba(245,197,24,0.1); border-color: #f5c518; color: #f5c518; }
.alert-info    { background: rgba(52,152,219,0.1); border-color: #3498db; color: #7bc8f0; }

/* === Yükleme Spinner === */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === Risk Skala Göstergesi === */
.risk-legend {
  display: flex;
  gap: 2px;
  border-radius: 6px;
  overflow: hidden;
  height: 12px;
}

.risk-legend-item {
  flex: 1;
  height: 100%;
}

/* === Stat Kartları === */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-kart {
  background: var(--izts-card);
  border: 1px solid var(--izts-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.stat-kart::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-kart.green::before  { background: var(--izts-green-lt); }
.stat-kart.yellow::before { background: var(--izts-yellow); }
.stat-kart.red::before    { background: var(--izts-red); }
.stat-kart.blue::before   { background: #3498db; }

.stat-ikon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* === Harita Container === */
.map-container {
  height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--izts-border);
}

.map-fullscreen {
  height: calc(100vh - 60px);
  border-radius: 0;
  border: none;
}

/* === Bildirim Feed === */
.bildirim-feed {
  max-height: 350px;
  overflow-y: auto;
}

.bildirim-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--izts-border);
}

.bildirim-item:last-child { border-bottom: none; }

.bildirim-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.bildirim-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* === Modal === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.aktif { opacity: 1; visibility: visible; }

.modal-box {
  background: var(--izts-card);
  border: 1px solid var(--izts-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 480px;
  width: 100%;
  transform: scale(0.95);
  transition: var(--transition);
}

.modal-overlay.aktif .modal-box { transform: scale(1); }

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--izts-border);
}

/* === Foto Thumbnail === */
.foto-thumb {
  width: 60px; height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--izts-border);
  cursor: pointer;
  transition: var(--transition);
}
.foto-thumb:hover { transform: scale(1.05); }

/* === Responsive === */
@media (max-width: 1024px) {
  .tur-kart img { width: 56px; height: 56px; }
}

@media (max-width: 768px) {
  .izts-navbar { padding: 0.6rem 1rem; }
  .navbar-nav { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .map-container { height: 280px; }
  .izts-table { font-size: 0.8rem; }
  .izts-table th, .izts-table td { padding: 0.6rem 0.75rem; }
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--izts-dark-2); }
::-webkit-scrollbar-thumb { background: var(--izts-border-lt); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === Yükleme Animasyonu === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

/* === Tooltips === */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--izts-dark-3);
  border: 1px solid var(--izts-border);
  color: var(--text-primary);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; }

/* === Mapbox Global Popup Karanlık Mod Stilleri === */
.mapboxgl-popup-content {
  background: var(--izts-card) !important;
  border: 1px solid var(--izts-border) !important;
  border-radius: var(--radius) !important;
  padding: 0.75rem 1rem !important;
  color: var(--text-primary) !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5) !important;
  min-width: 180px;
}

.mapboxgl-popup-tip {
  border-top-color: var(--izts-card) !important;
}

.popup-il { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.35rem; color: var(--text-primary); }
.popup-skor { font-size: 1.4rem; font-weight: 800; }
.popup-tur { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.3rem; }
.popup-bildirim { font-size: 0.75rem; color: var(--text-muted); }

