/* ========================================================== */
/* 1. TEMEL AYARLAR VE RESET                                  */
/* ========================================================== */

/* Tüm elemanlar için kutu modelini düzelt (Sidebar taşmasını önler) */
*, *:before, *:after {
  box-sizing: border-box;
}

:root {
  --primary: #2980b9;
  --primary-dark: #2c3e50;
  --accent: #3498db;
  --bg: #f4f7f6;
  --card: #ffffff;
  --text: #333;
  --text-light: #777;
  --border-color: #e0e0e0;
  --success: #27ae60;
  --danger: #e74c3c;
  --radius: 8px;
  --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

body {
  font-family: 'Figtree', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
}

h1 { margin-top: 0; font-size: 24px; color: var(--primary-dark); }
h2 { color: var(--primary-dark); margin-bottom: 20px; }

/* ========================================================== */
/* 2. LAYOUT (PANEL DÜZENİ)                                   */
/* ========================================================== */
.wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background-color: var(--primary-dark);
  color: #fff;
  padding: 20px;
  flex-shrink: 0;
  transition: all 0.3s;
}

.sidebar .logo {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 30px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 15px;
}

.menu a {
  display: block;
  color: rgba(255,255,255,0.8);
  padding: 12px 15px;
  text-decoration: none;
  border-radius: var(--radius);
  margin-bottom: 5px;
  transition: 0.2s;
}

.menu a:hover, .menu a.active {
  background-color: var(--primary);
  color: #fff;
}

/* Ana İçerik Alanı */
main {
  flex-grow: 1;
  padding: 30px;
  overflow-y: auto;
}

/* Mobil Menü Butonu (Varsayılan Gizli) */
.toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  display: none; /* Mobilde flex olacak */
  align-items: center;
  justify-content: center;
  z-index: 10001;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* ========================================================== */
/* 3. BİLEŞENLER (KARTLAR, FORMLAR, BUTONLAR)                 */
/* ========================================================== */

/* Kart Grid Sistemi */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.card span {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

/* Form Elemanları */
.ajm-form-group {
  margin-bottom: 15px;
}

.ajm-form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
}

.ajm-form-group input, 
.ajm-form-group select, 
.ajm-form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-sizing: border-box;
}

/* Butonlar */
.btn {
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: 0.2s;
}

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #219150; }

/* ========================================================== */
/* 4. SAYFA ÖZEL STİLLERİ (LOGIN, REGISTER, CHOICE)           */
/* ========================================================== */

/* --- Ortak Kapsayıcı Stilleri --- */
/* Giriş ve Rol Seçimi sayfaları için body ayarı */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
}

/* Login Box & Choice Container (Benzer yapılar) */
.login-box, .choice-container {
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  background: var(--card);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
}

.choice-container { text-align: center; }

/* --- Kayıt (Register) Sayfası --- */
body.register-page {
  background-color: var(--bg);
  padding: 20px;
  min-height: 100vh;
  box-sizing: border-box;
}

.reg-container {
  width: 100%;
  max-width: 900px;
  margin: 50px auto;
  background: var(--card);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
}

.reg-container h2 {
  text-align: center;
  border-bottom: 2px solid var(--bg);
  padding-bottom: 15px;
  margin-bottom: 30px;
}

.reg-container a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.reg-container a:hover { text-decoration: underline; color: var(--primary-dark); }

/* Grid Form (Masaüstü: 2 Kolon) */
.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Checkbox Grupları */
.checkbox-group {
  grid-column: 1 / -1;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed #eee;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.4;
}
.checkbox-label input { margin-top: 3px; width: auto !important; }

/* --- Doğrulama (Verify) Input --- */
.verify-input {
  font-size: 32px;
  text-align: center;
  letter-spacing: 10px;
  width: 100%;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--primary-dark);
  font-family: monospace;
  box-sizing: border-box;
  transition: all 0.3s;
}
.verify-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1);
}

/* --- Rol Seçim Butonları --- */
.role-btn {
  display: block;
  width: 100%;
  padding: 15px;
  margin: 15px 0;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}
.role-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(44, 62, 80, 0.3);
  color: #fff;
}

.logout-link {
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: 4px;
  transition: 0.2s;
}
.logout-link:hover { background: #fff5f5; }

/* --- Modallar --- */
.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  background: #fff;
  padding: 30px;
  border-radius: var(--radius);
  z-index: 1001;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  max-height: 80vh;
  overflow-y: auto;
}

.overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}

/* ========================================================== */
/* 5. TEK VE MERKEZİ MOBİL UYUMLULUK BLOĞU (MAX-WIDTH: 768px) */
/* ========================================================== */
@media (max-width: 768px) {
  
  /* --- Layout Değişiklikleri --- */
  .sidebar {
    position: fixed;
    top: 0;
    left: -260px; /* Tamamen gizle */
    width: 260px;
    height: 100vh;
    z-index: 10000;
    margin-left: 0; /* Eski margin ayarını sıfırla */
    transition: left 0.3s ease; /* Performanslı animasyon */
    box-shadow: 2px 0 10px rgba(0,0,0,0.5);
  }

  .sidebar.active {
    left: 0; /* Ekrana getir */
  }

  main {
    width: 100%;
    padding: 15px;
  }

  .toggle-btn {
    display: flex; /* Mobilde göster */
  }

  /* --- Grid Sistemleri (Tek Kolona Düşür) --- */
  .grid-form, 
  .card-grid {
    grid-template-columns: 1fr !important;
    gap: 15px;
  }

  /* --- Kapsayıcılar (Padding Azaltma) --- */
  .login-box, 
  .reg-container, 
  .choice-container {
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  }

  .reg-container {
    margin-top: 0; /* Mobilde üst boşluğu al */
  }

  /* --- Yazı Boyutları --- */
  h1 { font-size: 20px !important; }
  h2 { font-size: 20px !important; }

  .verify-input {
    font-size: 24px;
    letter-spacing: 5px;
    padding: 8px;
  }

  /* --- Butonlar (Tam Genişlik) --- */
  .btn, .role-btn {
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
  }

  /* --- Tablo Taşma Koruması --- */
  table {
    display: block;
    width: 100%;
    overflow-x: auto; /* Sağa sola kaydırma */
    white-space: nowrap;
  }
  
  /* --- Modal --- */
  .modal {
    width: 95% !important;
    padding: 20px !important;
  }
}