/* ============================================
   SINIFPro - Ana Stil Dosyası
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --primary:       #2563EB;
  --primary-dark:  #1d4ed8;
  --primary-light: #dbeafe;
  --secondary:     #7c3aed;
  --success:       #059669;
  --warning:       #d97706;
  --danger:        #dc2626;
  --bg:            #f8fafc;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --radius:        12px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
  --transition:    all .2s cubic-bezier(.4,0,.2,1);
  --sidebar-w:     260px;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ---- AUTH PAGES ---- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #7c3aed 100%);
  padding: 24px;
}
.auth-box {
  background: var(--surface);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo .logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
}
.auth-logo h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  color: var(--text);
}
.auth-logo p { color: var(--text-muted); font-size: 13px; }

/* ---- LAYOUT ---- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
}
.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo .logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; flex-shrink: 0;
}
.sidebar-logo span {
  font-family: 'Instrument Serif', serif;
  font-size: 20px;
  font-weight: 400;
}
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section { margin-bottom: 24px; }
.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 0 8px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-size: 14px;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}
.nav-item .icon { font-size: 18px; flex-shrink: 0; }
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
}
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.user-info .name { font-weight: 600; font-size: 13px; }
.user-info .badge-free {
  font-size: 10px; font-weight: 700;
  background: #fee2e2; color: var(--danger);
  padding: 1px 6px; border-radius: 20px;
}
.user-info .badge-premium {
  font-size: 10px; font-weight: 700;
  background: #fef3c7; color: var(--warning);
  padding: 1px 6px; border-radius: 20px;
}

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h2 {
  font-size: 18px;
  font-weight: 700;
}
.content-area { padding: 32px; flex: 1; }

/* ---- CARDS ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 24px; }
.card-title { font-size: 16px; font-weight: 700; }

/* ---- GRID ---- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media(max-width:1100px) { .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media(max-width:760px)  { .grid-3,.grid-2 { grid-template-columns: 1fr; } }

/* ---- STAT CARDS ---- */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ---- ITEM CARDS (class/unit/question) ---- */
.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}
.item-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1), var(--shadow);
  transform: translateY(-1px);
}
.item-card .item-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.item-card .item-meta { color: var(--text-muted); font-size: 12px; }
.item-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: #d1fae5; color: var(--success); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-warning { background: #fef3c7; color: var(--warning); }
.btn-warning:hover { background: var(--warning); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.form-control.is-invalid { border-color: var(--danger); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-blue    { background: #dbeafe; color: #1d4ed8; }
.badge-purple  { background: #ede9fe; color: #7c3aed; }
.badge-green   { background: #d1fae5; color: #059669; }
.badge-yellow  { background: #fef3c7; color: #b45309; }
.badge-red     { background: #fee2e2; color: #dc2626; }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.95) translateY(10px);
  transition: var(--transition);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border: none; background: var(--bg);
  border-radius: 8px; cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---- ALERTS ---- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error   { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info    { background: #dbeafe; color: #1e40af; }

/* ---- QUESTION ITEMS ---- */
.question-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: var(--transition);
}
.question-item:hover { border-color: var(--primary); }
.question-num {
  width: 28px; height: 28px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}
.question-content { flex: 1; }
.question-title { font-weight: 600; margin-bottom: 6px; }
.question-options { margin-top: 8px; display: grid; gap: 4px; }
.question-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.question-option.correct { color: var(--success); font-weight: 600; }
.opt-label {
  width: 22px; height: 22px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.question-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---- LIMIT BAR ---- */
.limit-bar-wrap { margin-bottom: 6px; }
.limit-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--text-muted);
}
.limit-bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.limit-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--primary);
  transition: width .5s ease;
}
.limit-bar-fill.warn  { background: var(--warning); }
.limit-bar-fill.full  { background: var(--danger); }
.limit-bar-fill.unlim { background: var(--success); width: 100% !important; }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 13px; }

/* ---- BREADCRUMB ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { opacity: .4; }

/* ---- TABS ---- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 20px;
  border: none; background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ---- TOAST ---- */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes toastIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }

/* ---- RADIO OPTIONS (test sorusu) ---- */
.radio-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.radio-opt:hover { border-color: var(--primary); }
.radio-opt input[type=radio] { accent-color: var(--primary); }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---- PREMIUM BANNER ---- */
.premium-banner {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  border-radius: 14px;
  padding: 20px 24px;
  color: #fff;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.premium-banner h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.premium-banner p  { font-size: 13px; opacity: .85; }
.btn-premium {
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.4);
  border-radius: 8px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-premium:hover { background: rgba(255,255,255,.35); }

/* ---- PRINT ---- */
@media print {
  .sidebar, .topbar, .modal-overlay { display: none !important; }
  .main-content { margin-left: 0 !important; }
}

/* ============================================
   MOBİL UYUM
   ============================================ */

/* Hamburger butonu — sadece mobilde görünür */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger span,
.hamburger span::before,
.hamburger span::after {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  position: relative;
  transition: var(--transition);
}
.hamburger span::before,
.hamburger span::after {
  content: '';
  position: absolute;
  left: 0;
}
.hamburger span::before { top: -5px; }
.hamburger span::after  { top:  5px; }

/* Sidebar overlay — mobilde sidebar açıkken arka planı karart */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {

  /* Sidebar mobilde ekranın dışında başlar, açılınca geri gelir */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 200;
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); }

  /* Ana içerik tam genişlik */
  .main-content { margin-left: 0; }

  /* Topbar'a hamburger sığacak yer aç */
  .topbar {
    padding: 12px 16px;
    gap: 12px;
  }
  .topbar h2 { font-size: 15px; }

  /* İçerik alanı */
  .content-area { padding: 16px; }

  /* Hamburger göster */
  .hamburger { display: flex; }

  /* Grid'ler mobilde tek sütun */
  .grid-3,
  .grid-2 { grid-template-columns: 1fr !important; }

  /* Stat kartları daha küçük */
  .stat-card { padding: 14px 16px; }
  .stat-value { font-size: 22px; }

  /* Modal tam ekran alttan açılır */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    transform: translateY(100%);
  }
  .modal-overlay.active .modal { transform: translateY(0); }

  /* Auth kutusu küçük ekranda taşmasın */
  .auth-box { padding: 32px 24px; }

  /* Buton grupları mobilde wrap yapsın */
  .item-actions { flex-wrap: wrap; }

  /* Toast alttan biraz daha yukarıda */
  #toast-container { bottom: 16px; right: 12px; left: 12px; }
  .toast { min-width: unset; width: 100%; }

  /* Tablo kaydırmalı */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Soru listesi */
  .question-item { flex-wrap: wrap; }
  .question-actions { width: 100%; justify-content: flex-end; }

  /* Premium banner dikey */
  .premium-banner { flex-direction: column; align-items: flex-start; }

  /* Tab butonları küçük */
  .tab-btn { padding: 8px 12px; font-size: 13px; }

  /* Card padding */
  .card-body   { padding: 16px; }
  .card-header { padding: 14px 16px; }
}
