/* Quizlet özellikleri, nötr renkler */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --accent: #2d7d6e;
  --accent-hover: #246b5e;
  --accent-soft: rgba(45, 125, 110, 0.12);
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --radius-sm: 10px;
  --radius-btn: 10px;
  --danger: #dc2626;
  --warning: #d97706;
  --success: #059669;
  --safe-area: env(safe-area-inset-bottom, 0);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(24px + var(--safe-area));
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout - Quizlet: centered, max-width for cards */
.container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* Progress bar - compact top */
.progress-wrap {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 10px 0 14px;
  margin: -20px -16px 12px -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Flashcard - Quizlet style: one big card, clear shadow */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  border: 1px solid var(--border);
}

.card:active {
  transform: scale(0.99);
}

.card-lg {
  padding: 32px 24px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow-card);
  border-radius: 14px;
}

/* Quizlet tarzı: tıkla çevir kart */
.flashcard-wrap {
  perspective: 1000px;
  margin-bottom: 20px;
}

.flashcard {
  cursor: pointer;
  height: 280px;
  position: relative;
  outline: none;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  top: 0;
  left: 0;
  margin: 0;
}

.flashcard-back {
  transform: rotateY(180deg);
}

.flashcard-prompt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.flashcard-term {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.flashcard-cloze {
  margin-top: 14px;
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
}

.flashcard-tap-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 16px;
}

.flashcard-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.flashcard-counter {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-weight: 500;
}

.flashcard-actions .rate-label {
  font-size: 0.9375rem;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.05s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-block {
  width: 100%;
  margin-bottom: 10px;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: #f0f1f5;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.result-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.result-buttons .btn {
  flex: 1;
  min-width: 90px;
}

/* Form */
input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  min-height: 80px;
  resize: vertical;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group {
  margin-bottom: 16px;
}

/* Typography */
h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 20px;
}

/* Kart içi: Türkçe önce, büyük ve okunaklı */
.vocab-turkish {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 500;
}

.vocab-german {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.vocab-example {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-style: italic;
}

.answer-reveal {
  margin-top: 16px;
  padding: 16px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent);
}

.answer-reveal .vocab-german {
  font-size: 1.25rem;
}

.answer-correct {
  background: rgba(26, 115, 232, 0.12) !important;
  border-left: 4px solid var(--success) !important;
  color: #1557b0;
  font-weight: 600;
}

.answer-wrong {
  background: #fef2f2 !important;
  border-left: 4px solid var(--danger) !important;
  color: var(--text);
}

.cloze-sentence {
  font-style: normal;
  letter-spacing: 0.02em;
}

/* Admin mesajları */
.success-msg {
  background: rgba(26, 115, 232, 0.1) !important;
  border-left: 4px solid var(--success) !important;
}

.error-msg {
  background: #fef2f2 !important;
  border-left: 4px solid var(--danger) !important;
  color: var(--text);
}

/* Header / nav */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0;
}

/* Ana sayfa: hedef kutusu */
.goal-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.goal-card .number {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.goal-card .label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Admin table */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th, td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--text-muted);
}

tr:hover td {
  background: #fafbfc;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.actions .btn {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.875rem;
}

.import-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  background: #fafbfc;
  margin-bottom: 16px;
}

.import-box textarea {
  min-height: 160px;
  font-family: monospace;
  font-size: 0.875rem;
}

.import-format {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.empty-state {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
}

.empty-state .btn {
  margin-top: 16px;
}

.swipe-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* Kart geçişi - hafif flip hissi */
#result-card {
  animation: cardReveal 0.35s ease;
}
@keyframes cardReveal {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (min-width: 600px) {
  .container {
    padding: 24px;
  }
  .card {
    padding: 28px;
  }
  .card-lg {
    padding: 40px 32px;
    min-height: 260px;
  }
  .progress-wrap {
    margin: -24px -24px 16px -24px;
    padding-left: 24px;
    padding-right: 24px;
  }
}
