:root {
  --kagit: #fef6e4;
  --metin: #2d1810;
  --gri: #999;
  --kirmizi: #ff6b6b;
  --turkuaz: #4ecdc4;
  --mor: #6c5ce7;
  --pembe: #fd79a8;
  --yesil: #06d6a0;
  --sari: #ffd166;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--kagit);
  color: var(--metin);
  min-height: 100vh;
  -webkit-user-select: none;
  user-select: none;
  overflow-x: hidden;
}

/* ===== ÜST BAR ===== */
.ust-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: white;
  border-bottom: 2px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.ust-bar .geri {
  width: 36px;
  height: 36px;
  background: var(--kirmizi);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ust-bar .geri:active { opacity: 0.8; }

/* ===== SINIF GRID ===== */
.sinif-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px;
  max-width: 500px;
  margin: 0 auto;
}

/* ===== SINIF KARTI ===== */
.sinif-kart {
  border-radius: 20px;
  padding: 24px 16px;
  color: white;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.sinif-kart:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.sinif-kart .numara {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 8px;
}
.sinif-kart .adi {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}
.sinif-kart .meta {
  font-size: 12px;
  opacity: 0.85;
}

/* ===== DERS KARTI ===== */
.ders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ders-kart {
  border-radius: 20px;
  padding: 20px 16px;
  color: white;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ders-kart:active { transform: scale(0.97); }
.ders-kart .ikon { font-size: 32px; margin-bottom: 8px; }
.ders-kart .adi { font-weight: bold; font-size: 16px; margin-bottom: 4px; }
.ders-kart .meta { font-size: 12px; opacity: 0.85; margin-bottom: 12px; }
.ders-kart .cubuk {
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  height: 6px;
  overflow: hidden;
}
.ders-kart .cubuk-dolu {
  background: white;
  height: 100%;
  border-radius: 8px;
}

/* ===== İLERLEME ÇUBUĞU ===== */
.ilerleme-cubuk {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  border: 2px solid #f0f0f0;
}
.ilerleme-cubuk .cubuk {
  background: #f0f0f0;
  border-radius: 10px;
  height: 12px;
  overflow: hidden;
}
.ilerleme-cubuk .cubuk-dolu {
  background: linear-gradient(90deg, var(--mor), #a29bfe);
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
}

/* ===== KONU KARTI ===== */
.konu-listesi {
  padding: 0 16px 80px;
}
.konu-kart {
  background: white;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 10px;
}
.konu-kart:active { transform: scale(0.98); }
.konu-kart.tamamlanmis { border: 2px solid var(--yesil); }
.konu-kart.devam { border: 2px solid var(--mor); box-shadow: 0 4px 16px rgba(108,92,231,0.2); }
.konu-kart.kilitli { border: 2px solid #f0f0f0; opacity: 0.6; background: #f8f8f8; }
.konu-kart .sure { font-size: 11px; color: #bbb; margin-top: 2px; }
.konu-kart .sure::before { content: ''; }
.konu-kart .durum {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.konu-kart.tamamlanmis .durum { background: linear-gradient(135deg, var(--yesil), #00b894); color: white; }
.konu-kart.devam .durum { background: linear-gradient(135deg, var(--mor), #a29bfe); color: white; }
.konu-kart.kilitli .durum { background: #e0e0e0; color: #999; }
.konu-kart .bilgi { flex: 1; }
.konu-kart .baslik { font-weight: bold; font-size: 14px; }
.konu-kart .alt-bilgi { font-size: 11px; color: var(--gri); margin-top: 2px; }
.konu-kart .ilerleme-kucuk {
  background: #f0f0f0;
  border-radius: 6px;
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
}
.konu-kart .ilerleme-kucuk .dolu {
  background: var(--mor);
  height: 100%;
  border-radius: 6px;
}
.konu-kart .yuzde { font-size: 11px; font-weight: bold; }
.konu-kart.tamamlanmis .yuzde { color: var(--yesil); }
.konu-kart.devam .yuzde { color: var(--mor); }

/* ===== FİLTRE ÇUBUĞU ===== */
.filtre-cubuk {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
  -webkit-overflow-scrolling: touch;
}
.filtre-cubuk::-webkit-scrollbar { display: none; }
.filtre-cubuk .sekme {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  background: #f0f0f0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}
.filtre-cubuk .sekme.aktif {
  background: var(--mor);
  color: white;
  font-weight: bold;
}

/* ===== SES BUTONU (KALP ATIŞI) ===== */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108,92,231,0.4); }
  50% { box-shadow: 0 0 0 10px rgba(108,92,231,0); }
}
.ses-buton {
  background: linear-gradient(135deg, var(--mor), #a29bfe);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  color: white;
  cursor: pointer;
  animation: pulse 2s infinite;
  -webkit-tap-highlight-color: transparent;
}
.ses-buton:active { animation: none; transform: scale(0.98); }

/* ===== MODAL (TEST SONUCU) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.acik {
  opacity: 1;
  pointer-events: auto;
}
.modal-icerik {
  background: white;
  border-radius: 24px;
  padding: 28px;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s;
}
.modal-overlay.acik .modal-icerik {
  transform: scale(1);
}

/* ===== ROZET ===== */
.rozet-kutu {
  background: linear-gradient(135deg, var(--sari), #f4a261);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: white;
}
.rozet-kutu .ikon {
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

/* ===== YILDIZ ===== */
.yildizlar { text-align: center; font-size: 36px; }

/* ===== DÜĞMELER ===== */
.buton-kutu {
  background: var(--mor);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  color: white;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.buton-kutu:active { opacity: 0.85; }
.buton-ikincil {
  background: #f0f0f0;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
}
.buton-satir {
  display: flex;
  gap: 10px;
}

/* ===== İSTATİSTİK ===== */
.istatistik-kutu {
  text-align: center;
  border-radius: 12px;
  padding: 12px;
}
.istatistik-kutu .deger {
  font-size: 24px;
  font-weight: bold;
}
.istatistik-kutu .etiket {
  font-size: 11px;
  color: var(--gri);
}

/* ===== ALT NAVİGASYON ===== */
.alt-nav {
  display: flex;
  justify-content: space-between;
  padding: 16px;
}
.alt-nav .buton {
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}
.alt-nav .buton.onceki { background: #f0f0f0; color: var(--gri); }
.alt-nav .buton.sonraki { background: var(--mor); color: white; }

/* ===== SAYFA İÇİ ELEMANLAR (konu detay için) ===== */
.sayfa-icerik {
  padding: 16px;
  padding-bottom: 80px;
}

/* ===== KULLANICI BİLGİ ===== */
.kullanici-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: white;
  border-bottom: 1px solid #f0f0f0;
}
.kullanici-bar .kadi { font-size: 13px; font-weight: bold; color: #6c5ce7; }
.kullanici-bar .rol { font-size: 11px; color: #999; background: #f5f5f5; padding: 2px 8px; border-radius: 8px; }
.kullanici-bar .cikis { font-size: 12px; color: var(--kirmizi); cursor: pointer; font-weight: bold; }
.kullanici-mini { text-align: right; }
