/* =========================================
   ANKARA DSİ SPOR KULÜBÜ - MERKEZİ TASARIM SİSTEMİ
   Modern SaaS / Pro Dashboard Stili (Compact & Zero Scroll Uyumu)
========================================= */

:root {
  /* Ankara DSİ Spor Resmi Renkleri: Koyu Yeşil, Zümrüt Yeşili ve Beyaz */
  --bg-primary: #061c14;       /* Çok koyu orman yeşili */
  
  /* Dengeli ve Opak Kart Zemin Rengi */
  --bg-surface: rgba(14, 46, 34, 0.90);       /* %90 Opak Kart & Panel yeşili */
  --bg-surface-hover: rgba(22, 66, 50, 0.95); /* %95 Opak Hover yeşili */
  --card-blur: blur(12px);                    /* Modern Glassmorphism bulanıklığı */
  
  --primary: #10b981;          /* DSİ Canlı Zümrüt Yeşili */
  --primary-hover: #059669;    /* Koyu zümrüt buton hover */
  --primary-light: rgba(16, 185, 129, 0.15);
  
  --secondary: #38bdf8;        /* Su mavisi / DSİ Su Vurgusu */
  --text-main: #ffffff;        /* Beyaz ana metin */
  --text-muted: #94a3b8;       /* Soluk gri ikincil metin */
  --border-color: rgba(26, 77, 59, 0.85);     /* DSİ Yeşil Çerçeve */
  
  --danger: #ef4444;           /* Tehlike kırmızısı */
  --warning: #f59e0b;          /* Sarı / Uyarı */
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  max-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* =========================================
   SOL MENÜ (SIDEBAR) - KOMPAKT & BOLD (TÜM SAYFALAR İÇİN STANDART & DEĞİŞMEZ)
========================================= */
.sidebar,
.sidebar * {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.sidebar {
  width: 230px !important;
  background-color: rgba(10, 32, 24, 0.94) !important;
  backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex !important;
  flex-direction: column !important;
  padding: 12px 10px !important;
  flex-shrink: 0 !important;
  z-index: 20;
  height: 100vh !important;
  justify-content: flex-start !important;
  overflow-y: auto !important;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
  padding: 6px 10px !important;
  background: rgba(16, 185, 129, 0.06) !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid rgba(16, 185, 129, 0.18) !important;
  flex-shrink: 0 !important;
}

.brand-logo-round {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  border-radius: 50% !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
  border: 1px solid rgba(16, 185, 129, 0.5) !important;
  background-color: #fff !important;
}

.brand-title {
  font-size: 0.86rem !important;
  font-weight: 800 !important;
  color: #fff !important;
  letter-spacing: 0.5px !important;
  line-height: 1.15 !important;
}

.brand-sub {
  font-size: 0.62rem !important;
  color: var(--primary) !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  margin-top: 1px !important;
}

.nav-links {
  list-style: none !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.nav-link {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  padding: 6px 8px !important;
  border-radius: 6px !important;
  color: #94a3b8 !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 0.80rem !important;
  transition: all 0.15s ease !important;
  border-left: 3px solid transparent !important;
  line-height: 1.2 !important;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: #fff !important;
}

.nav-link.active {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-left: 3px solid var(--primary) !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}

.nav-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
  color: inherit !important;
}

.nav-icon svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2.3 !important;
  stroke: currentColor !important;
  fill: none !important;
}

/* =========================================
   ANA İÇERİK ALANI
========================================= */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100vh;
  position: relative;
}

/* Kulüp Logosu Büyük Saydam Arka Plan Fligranı (Watermark) */
.main-content::before {
  content: "";
  position: fixed;
  top: 50%;
  left: calc(50% + 115px); /* 230px sidebar dengeli */
  transform: translate(-50%, -50%);
  width: 480px;
  height: 480px;
  background-image: url("/static/img/dsi_watermark.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  opacity: 0.04;
  filter: brightness(1.2);
  pointer-events: none;
  z-index: 0;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(6, 28, 20, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.page-title h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.page-title p {
  color: #94a3b8;
  font-size: 0.74rem;
  margin-top: 1px;
}

.content-container {
  padding: 14px 20px;
  flex: 1;
  position: relative;
  z-index: 1; /* Arka plan fligranının kesinlikle üstünde kalmasını sağlar */
}

/* =========================================
   BUTONLAR
========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #225c46;
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background-color: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* =========================================
   KARTLAR & GRID (TAKIMLAR, TEKNİK EKİP)
========================================= */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.team-card {
  background-color: var(--bg-surface);
  backdrop-filter: var(--card-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s, border-color 0.18s, background-color 0.18s;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.team-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.team-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.team-category-badge {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.team-year-badge {
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.team-name {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.team-staff {
  background-color: rgba(6, 28, 20, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.staff-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.staff-role {
  color: var(--text-muted);
}

.staff-name {
  font-weight: 600;
  color: #fff;
}

.team-card-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
}

/* =========================================
   MODAL PENCERE
========================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.modal-overlay.active {
  display: flex !important;
}

.modal {
  background-color: #0e2e22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background-color: rgba(6, 28, 20, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

/* =========================================
   EMPTY STATE (BOŞ VERİ DURUMU)
========================================= */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
  margin-top: 20px;
}

.empty-state-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}


/* ========================================================
   RESPONSIVE & MOBİL DOKUNMATİK UYUMLULUĞU (CSS MEDIA QUERIES)
   Telefondan veya tabletten dsispor.com.tr'ye girildiğinde
   doğal dikey kaydırma (scroll) ve tam ekran sığma kuralları.
   ======================================================== */

@media (max-width: 992px) {
  /* Masaüstündeki 'overflow: hidden' kilidini mobilde tamamen kaldır */
  html, body {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body {
    flex-direction: column !important;
    display: block !important;
  }

  /* Sol Menü (Sidebar) Mobilde Üst Şerit Haline Gelir veya Kaydırılabilir */
  .sidebar {
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 8px 12px !important;
    position: relative !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
  }

  .brand {
    margin-bottom: 8px !important;
  }

  .nav-links {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    overflow-x: auto !important;
    padding-bottom: 4px !important;
    white-space: nowrap !important;
  }

  .nav-links::-webkit-scrollbar {
    height: 3px !important;
  }
  .nav-links::-webkit-scrollbar-thumb {
    background: var(--primary) !important;
    border-radius: 3px !important;
  }

  .nav-link {
    padding: 6px 10px !important;
    font-size: 0.76rem !important;
    border-radius: 6px !important;
  }

  /* Ana İçerik Mobilde Serbestçe Aşağı Kayar */
  .main-content {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    display: block !important;
  }

  .dashboard-layout {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding: 10px 12px 30px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  /* 1. Üst Metrik Kartları: Mobilde 2'li Izgara */
  .stats-summary {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* 2. Hızlı Yönetim Modülleri: Mobilde 1 veya 2 Sütun */
  .quick-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .modules-section {
    overflow-y: visible !important;
    max-height: none !important;
  }

  .top-bar {
    padding: 10px 12px !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .top-bar .page-title h1 {
    font-size: 1.1rem !important;
  }
}

@media (max-width: 576px) {
  .stats-summary {
    grid-template-columns: 1fr 1fr !important;
  }

  .quick-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 992px) {
  .table-container, .matches-table-card {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
  }
  .fixture-table, .data-table, .custom-table {
    min-width: 750px !important;
  }
  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
}
