/* ═══════════════════════════════════════════════════════════
   Učim Nemački – main.css
   Purple colour scheme + responsive layout
═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  --purple-50:   #F5F3FF;
  --purple-100:  #EDE9FE;
  --purple-200:  #DDD6FE;
  --purple-300:  #C4B5FD;
  --purple-400:  #A78BFA;
  --purple-500:  #8B5CF6;
  --purple-600:  #7C3AED;
  --purple-700:  #6D28D9;
  --purple-800:  #6B21A8;   /* PRIMARY */
  --purple-900:  #4C1D95;
  --accent:      #9333EA;
  --accent-light:#F3E8FF;
  --green:       #16A34A;
  --green-light: #DCFCE7;
  --red:         #DC2626;
  --red-light:   #FEE2E2;
  --blue:        #2563EB;
  --blue-light:  #DBEAFE;
  --yellow:      #CA8A04;
  --yellow-light:#FEF9C3;
  --gray-50:     #F9FAFB;
  --gray-100:    #F3F4F6;
  --gray-200:    #E5E7EB;
  --gray-300:    #D1D5DB;
  --gray-400:    #9CA3AF;
  --gray-500:    #6B7280;
  --gray-600:    #4B5563;
  --gray-700:    #374151;
  --gray-800:    #1F2937;
  --gray-900:    #111827;
  --white:       #FFFFFF;
  --bg:          #FAFAFA;
  --text:        var(--gray-800);
  --text-muted:  var(--gray-500);
  --border:      var(--gray-200);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 4px 16px rgba(107,33,168,.12);
  --shadow-lg:   0 12px 40px rgba(107,33,168,.18);
  --radius-sm:   6px;
  --radius:      12px;
  --radius-lg:   20px;
  --radius-xl:   30px;
  --nav-h:       68px;
  --transition:  .25s cubic-bezier(.4,0,.2,1);
  --font-body:   'Nunito', system-ui, sans-serif;
  --font-head:   'Poppins', system-ui, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  padding-top: var(--nav-h);
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--purple-800); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select, button { font-family: inherit; }

/* ── Skip link ─────────────────────────────────────────── */
.skip-link {
  position: fixed; top: -100%; left: 1rem;
  background: var(--purple-800); color: var(--white);
  padding: .5rem 1rem; border-radius: var(--radius-sm);
  z-index: 9999; transition: top .2s;
}
.skip-link:focus { top: 1rem; }

/* ── Typography ────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; color: var(--gray-900); }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.2rem; }
p  { margin-bottom: .8rem; }

/* ── Container ─────────────────────────────────────────── */
.container  { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.container-sm { max-width: 800px;  margin: 0 auto; padding: 0 1.25rem; }

/* ══════════════════════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════════════════════ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(107,33,168,.1);
  box-shadow: 0 2px 20px rgba(107,33,168,.08);
  transition: background var(--transition);
}
.navbar.scrolled { background: rgba(255,255,255,.97); }

.nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 1.25rem;
  height: 100%; display: flex; align-items: center; gap: 1rem;
}

.nav-logo {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--font-head); font-weight: 800; font-size: 1.25rem;
  color: var(--purple-800); text-decoration: none; flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; }
.parrot-logo { border-radius: 50%; }

.nav-links {
  display: flex; align-items: center; gap: .25rem;
  margin: 0 auto; /* center */
}
.nav-link {
  padding: .45rem .8rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .9rem;
  color: var(--gray-600); transition: color var(--transition), background var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--purple-800); background: var(--purple-50);
  text-decoration: none;
}

/* Auth area */
.nav-auth { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }

/* User dropdown */
.user-dropdown { position: relative; }
.user-avatar-btn {
  display: flex; align-items: center; gap: .5rem;
  background: var(--purple-50); border: 2px solid var(--purple-200);
  border-radius: var(--radius-xl); padding: .35rem .9rem .35rem .45rem;
  color: var(--purple-800); font-weight: 700; font-size: .88rem;
  transition: all var(--transition);
}
.user-avatar-btn:hover { background: var(--purple-100); border-color: var(--purple-400); }
.user-avatar-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.user-avatar-placeholder {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--purple-800); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800;
}
.dropdown-arrow { font-size: .7rem; transition: transform var(--transition); }
.user-dropdown.open .dropdown-arrow { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .5rem;
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: opacity var(--transition), transform var(--transition);
}
.user-dropdown.open .dropdown-menu {
  opacity: 1; pointer-events: all; transform: translateY(0);
}
.dropdown-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .9rem; border-radius: var(--radius-sm);
  color: var(--gray-700); font-weight: 600; font-size: .9rem;
  transition: background var(--transition), color var(--transition);
}
.dropdown-item:hover { background: var(--purple-50); color: var(--purple-800); text-decoration: none; }
.dropdown-admin:hover { background: var(--blue-light); color: var(--blue); }
.dropdown-logout:hover { background: var(--red-light); color: var(--red); }
.dropdown-divider { height: 1px; background: var(--border); margin: .35rem 0; }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: .5rem;
  border-radius: var(--radius-sm);
}
.hamburger-line {
  width: 24px; height: 2px;
  background: var(--purple-800); border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.hamburger.open .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger.open .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  display: none; flex-direction: column;
  background: var(--white); border-top: 1px solid var(--border);
  padding: .75rem 1.25rem 1.25rem;
  position: absolute; top: var(--nav-h); left: 0; right: 0;
  box-shadow: var(--shadow-lg); z-index: 999;
}
.mobile-menu.open { display: flex; }
.mobile-nav-link {
  display: block; padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--gray-700); font-weight: 600;
  transition: background var(--transition);
}
.mobile-nav-link:hover { background: var(--purple-50); color: var(--purple-800); text-decoration: none; }
.mobile-register { color: var(--purple-800); }
.mobile-logout   { color: var(--red); }

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.6rem; border-radius: var(--radius);
  font-weight: 700; font-size: 1rem; line-height: 1;
  border: 2px solid transparent;
  transition: all var(--transition); cursor: pointer;
  text-decoration: none !important; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--purple-800); color: var(--white);
  border-color: var(--purple-800);
}
.btn-primary:hover { background: var(--purple-900); border-color: var(--purple-900); box-shadow: 0 4px 20px rgba(107,33,168,.35); }
.btn-accent {
  background: var(--accent); color: var(--white);
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--purple-700); border-color: var(--purple-700); }
.btn-outline {
  background: transparent; color: var(--purple-800);
  border-color: var(--purple-800);
}
.btn-outline:hover { background: var(--purple-50); }
.btn-ghost {
  background: transparent; color: var(--gray-600);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }
.btn-success { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-danger  { background: var(--red);   color: var(--white); border-color: var(--red);   }
.btn-sm  { padding: .45rem 1rem; font-size: .875rem; border-radius: var(--radius-sm); }
.btn-lg  { padding: 1rem 2.2rem; font-size: 1.1rem; }
.btn-xl  { padding: 1.1rem 2.8rem; font-size: 1.2rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ══════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════ */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  overflow: hidden; transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-body  { padding: 1.5rem; }
.card-header{ padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); font-weight: 700; }
.card-footer{ padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: var(--gray-50); }

/* Category cards */
.category-card {
  border-radius: var(--radius-lg); padding: 2rem;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer; text-decoration: none !important; display: block;
  position: relative; overflow: hidden;
  color: var(--white);
}
.category-card::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,.12); transition: background var(--transition);
}
.category-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.category-card:hover::before { background: rgba(0,0,0,.06); }
.category-card-icon { font-size: 3rem; margin-bottom: 1rem; }
.category-card-name { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; margin-bottom: .5rem; }
.category-card-desc { font-size: .95rem; opacity: .9; line-height: 1.5; }
.category-card-count { font-size: .85rem; opacity: .8; margin-top: .75rem; font-weight: 600; }

/* Test cards */
.test-card { border-radius: var(--radius); padding: 1.5rem; background: var(--white); border: 1px solid var(--border); }
.test-card-title { font-weight: 700; font-size: 1.1rem; margin-bottom: .4rem; color: var(--gray-900); }
.test-card-meta  { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--text-muted); margin-bottom: .75rem; }
.test-card-meta span { display: flex; align-items: center; gap: .3rem; }

/* Difficulty badges */
.badge {
  display: inline-flex; align-items: center; padding: .25rem .75rem;
  border-radius: var(--radius-xl); font-size: .78rem; font-weight: 700;
}
.badge-beginner     { background: var(--green-light);  color: var(--green); }
.badge-intermediate { background: var(--yellow-light); color: var(--yellow); }
.badge-advanced     { background: var(--red-light);    color: var(--red); }
.badge-purple       { background: var(--purple-100);   color: var(--purple-800); }
.badge-blue         { background: var(--blue-light);   color: var(--blue); }

/* ══════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════ */
.form-group   { margin-bottom: 1.25rem; }
.form-label   { display: block; font-weight: 700; margin-bottom: .45rem; font-size: .92rem; color: var(--gray-700); }
.form-control {
  width: 100%; padding: .75rem 1rem;
  border: 2px solid var(--border); border-radius: var(--radius);
  font-size: 1rem; color: var(--text); background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--purple-500);
  box-shadow: 0 0 0 4px rgba(139,92,246,.15);
}
.form-control::placeholder { color: var(--gray-400); }
.form-control.is-invalid   { border-color: var(--red); }
.form-control.is-valid     { border-color: var(--green); }
textarea.form-control      { resize: vertical; min-height: 100px; }
.form-select {
  width: 100%; padding: .75rem 2.5rem .75rem 1rem;
  border: 2px solid var(--border); border-radius: var(--radius);
  font-size: 1rem; color: var(--text); background: var(--white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center;
  transition: border-color var(--transition);
}
.form-select:focus { outline: none; border-color: var(--purple-500); box-shadow: 0 0 0 4px rgba(139,92,246,.15); }
.form-text    { font-size: .82rem; color: var(--text-muted); margin-top: .3rem; }
.form-error   { font-size: .82rem; color: var(--red); margin-top: .3rem; font-weight: 600; }

.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius) 0 0 var(--radius); flex: 1; }
.input-group .btn           { border-radius: 0 var(--radius) var(--radius) 0; }

/* ── Auth forms ────────────────────────────────────────── */
.auth-wrapper {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--purple-50) 0%, var(--white) 60%, var(--purple-100) 100%);
}
.auth-card { width: 100%; max-width: 460px; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h1 { color: var(--purple-800); font-size: 2rem; }
.auth-header p  { color: var(--text-muted); }

/* ── Divider ───────────────────────────────────────────── */
.divider { display: flex; align-items: center; gap: 1rem; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.divider span { color: var(--text-muted); font-size: .85rem; }

/* ══════════════════════════════════════════════════════════
   HERO SECTION
══════════════════════════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, var(--purple-800) 0%, var(--purple-600) 50%, var(--accent) 100%);
  color: var(--white); padding: 5rem 1.25rem 4rem;
  text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; }
.hero-parrot  { width: 160px; height: 160px; margin: 0 auto 1.5rem; filter: drop-shadow(0 10px 30px rgba(0,0,0,.3)); }
.hero h1 { color: var(--white); margin-bottom: 1rem; }
.hero-sub { font-size: 1.2rem; opacity: .9; margin-bottom: 2rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; margin-top: 3rem; }
.hero-stat { text-align: center; }
.hero-stat-num  { font-size: 2.2rem; font-weight: 800; font-family: var(--font-head); }
.hero-stat-label{ font-size: .9rem; opacity: .85; }

/* ══════════════════════════════════════════════════════════
   SECTIONS
══════════════════════════════════════════════════════════ */
.section { padding: 4rem 1.25rem; }
.section-light { background: var(--white); }
.section-gray  { background: var(--gray-50); }
.section-purple{ background: var(--purple-50); }
.section-title { text-align: center; margin-bottom: .75rem; }
.section-sub   { text-align: center; color: var(--text-muted); margin-bottom: 2.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ── Grid ──────────────────────────────────────────────── */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ══════════════════════════════════════════════════════════
   PROGRESS BAR
══════════════════════════════════════════════════════════ */
.progress-bar {
  height: 10px; background: var(--gray-200);
  border-radius: var(--radius-xl); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: var(--radius-xl);
  background: linear-gradient(90deg, var(--purple-800), var(--accent));
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.progress-fill.green  { background: linear-gradient(90deg, #16A34A, #4ADE80); }
.progress-fill.yellow { background: linear-gradient(90deg, #CA8A04, #FCD34D); }
.progress-fill.red    { background: linear-gradient(90deg, #DC2626, #F87171); }

/* ══════════════════════════════════════════════════════════
   SCORE / RESULTS
══════════════════════════════════════════════════════════ */
.score-circle {
  width: 140px; height: 140px; border-radius: 50%;
  background: conic-gradient(var(--purple-800) calc(var(--pct, 0) * 1%), var(--gray-200) 0);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  box-shadow: 0 0 0 8px var(--purple-100);
}
.score-inner {
  width: 110px; height: 110px; border-radius: 50%;
  background: var(--white); display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-num   { font-size: 2rem; font-weight: 800; color: var(--purple-800); line-height: 1; }
.score-label { font-size: .75rem; color: var(--text-muted); font-weight: 600; }

/* ══════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  padding: 1rem; opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.95) translateY(20px);
  transition: transform var(--transition);
}
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 1.5rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { margin: 0; }
.modal-close {
  background: none; border: none; font-size: 1.5rem; color: var(--gray-400);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body   { padding: 1.5rem; }
.modal-footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: .75rem; justify-content: flex-end; }

/* ══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 3000; display: flex; flex-direction: column; gap: .75rem;
  max-width: 360px;
}
.toast {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 1rem 1.25rem;
  display: flex; align-items: flex-start; gap: .75rem;
  border-left: 4px solid var(--purple-800);
  animation: slideInRight .3s ease;
}
.toast.toast-success { border-left-color: var(--green); }
.toast.toast-error   { border-left-color: var(--red);   }
.toast.toast-warning { border-left-color: var(--yellow); }
.toast-icon  { font-size: 1.3rem; flex-shrink: 0; }
.toast-body  { flex: 1; }
.toast-title { font-weight: 700; font-size: .95rem; margin-bottom: .2rem; }
.toast-msg   { font-size: .87rem; color: var(--text-muted); }
.toast-close {
  background: none; border: none; color: var(--gray-400); font-size: 1.1rem;
  line-height: 1; padding: 0; transition: color var(--transition);
}
.toast-close:hover { color: var(--gray-700); }

/* ══════════════════════════════════════════════════════════
   ACHIEVEMENT BADGES
══════════════════════════════════════════════════════════ */
.achievement-badge {
  display: flex; flex-direction: column; align-items: center;
  gap: .5rem; padding: 1rem;
  background: var(--white); border-radius: var(--radius);
  border: 2px solid var(--purple-200);
  transition: all var(--transition);
}
.achievement-badge.earned { border-color: var(--purple-500); box-shadow: 0 0 20px rgba(139,92,246,.2); }
.achievement-badge.locked { opacity: .45; filter: grayscale(.8); }
.achievement-icon  { font-size: 2.5rem; }
.achievement-name  { font-weight: 700; font-size: .9rem; text-align: center; color: var(--gray-800); }
.achievement-desc  { font-size: .78rem; text-align: center; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════
   PARROT MASCOT BUBBLE
══════════════════════════════════════════════════════════ */
.parrot-bubble {
  position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 1500;
  max-width: 260px; transition: opacity var(--transition);
}
.parrot-bubble.hidden { opacity: 0; pointer-events: none; }
.parrot-bubble-inner {
  display: flex; gap: .75rem; align-items: flex-start;
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 2px solid var(--purple-200);
  padding: .9rem;
}
.parrot-mascot-small img { width: 48px; height: 48px; border-radius: 50%; }
.parrot-message { font-size: .88rem; font-weight: 600; color: var(--purple-800); line-height: 1.4; flex: 1; }
.parrot-close {
  background: none; border: none; color: var(--gray-400);
  font-size: 1.1rem; line-height: 1; padding: 0; align-self: flex-start;
  transition: color var(--transition);
}
.parrot-close:hover { color: var(--gray-700); }

/* ══════════════════════════════════════════════════════════
   TABLES (admin)
══════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; }
.table th {
  background: var(--purple-50); color: var(--purple-900); font-weight: 700;
  padding: .9rem 1rem; text-align: left; font-size: .88rem; border-bottom: 2px solid var(--purple-200);
}
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); font-size: .92rem; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--purple-50); }
.table-actions { display: flex; gap: .5rem; }

/* ══════════════════════════════════════════════════════════
   TEACHER CARDS
══════════════════════════════════════════════════════════ */
.teacher-card { display: flex; flex-direction: column; }
.teacher-photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.teacher-avatar {
  width: 80px; height: 80px; border-radius: 50%; margin: -40px auto 0;
  background: linear-gradient(135deg, var(--purple-800), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; color: var(--white);
  border: 4px solid var(--white); box-shadow: var(--shadow);
}
.teacher-name    { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; text-align: center; margin-bottom: .25rem; }
.teacher-subjects{ display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin: .6rem 0; }
.teacher-tag     { background: var(--purple-100); color: var(--purple-800); padding: .2rem .65rem; border-radius: var(--radius-xl); font-size: .78rem; font-weight: 600; }
.teacher-rate    { font-size: 1.2rem; font-weight: 800; color: var(--purple-800); text-align: center; margin: .5rem 0; }

/* ══════════════════════════════════════════════════════════
   VOCABULARY
══════════════════════════════════════════════════════════ */
.vocab-card {
  background: var(--white); border-radius: var(--radius); padding: 1.25rem;
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: .5rem;
  transition: all var(--transition);
}
.vocab-card:hover { border-color: var(--purple-300); box-shadow: var(--shadow); }
.vocab-german   { font-size: 1.5rem; font-weight: 800; color: var(--purple-800); font-family: var(--font-head); }
.vocab-serbian  { font-size: 1.1rem; color: var(--gray-700); font-weight: 600; }
.vocab-example  { font-size: .85rem; color: var(--text-muted); font-style: italic; }
.audio-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--purple-100); color: var(--purple-800); border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; transition: all var(--transition);
}
.audio-btn:hover { background: var(--purple-800); color: var(--white); }

/* ══════════════════════════════════════════════════════════
   GRAMMAR
══════════════════════════════════════════════════════════ */
.grammar-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.grammar-table th { background: var(--purple-100); color: var(--purple-900); padding: .7rem 1rem; text-align: left; font-weight: 700; border: 1px solid var(--purple-200); }
.grammar-table td { padding: .65rem 1rem; border: 1px solid var(--border); }
.grammar-table tr:hover td { background: var(--purple-50); }
p.tip { background: var(--yellow-light); border-left: 4px solid var(--yellow); padding: .75rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .92rem; }

/* ══════════════════════════════════════════════════════════
   QUIZ / TEST ENGINE
══════════════════════════════════════════════════════════ */
.quiz-wrap {
  max-width: 760px; margin: 0 auto; padding: 2rem 1rem;
}
.quiz-header {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.quiz-title   { flex: 1; font-size: 1.1rem; font-weight: 700; color: var(--gray-800); }
.quiz-timer {
  display: flex; align-items: center; gap: .4rem;
  background: var(--purple-800); color: var(--white);
  padding: .4rem 1rem; border-radius: var(--radius-xl);
  font-weight: 800; font-size: 1rem;
}
.quiz-timer.warning { background: var(--yellow); color: var(--gray-900); animation: timerPulse 1s ease infinite; }
.quiz-timer.danger  { background: var(--red); animation: timerPulse .5s ease infinite; }

.question-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 2rem; margin-bottom: 1.5rem;
}
.question-num  { font-size: .85rem; font-weight: 700; color: var(--text-muted); margin-bottom: .5rem; }
.question-text { font-size: 1.15rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--gray-900); }
.question-img  { max-height: 220px; width: auto; border-radius: var(--radius); margin-bottom: 1.25rem; }

.options-grid { display: grid; gap: .75rem; grid-template-columns: 1fr 1fr; }
.option-btn {
  padding: 1rem 1.25rem; background: var(--white);
  border: 2px solid var(--border); border-radius: var(--radius);
  font-size: 1rem; font-weight: 600; color: var(--gray-700);
  text-align: left; cursor: pointer; transition: all var(--transition);
}
.option-btn:hover:not(:disabled) { border-color: var(--purple-400); background: var(--purple-50); color: var(--purple-800); }
.option-btn.selected { border-color: var(--purple-800); background: var(--purple-100); color: var(--purple-800); }
.option-btn.correct  { border-color: var(--green); background: var(--green-light); color: var(--green); }
.option-btn.wrong    { border-color: var(--red);   background: var(--red-light);   color: var(--red); animation: shake .4s ease; }
.option-btn:disabled { cursor: default; }
.option-btn--image  { text-align: center; padding: .5rem; }
.option-img         { max-width: 100%; max-height: 120px; border-radius: 4px; display: block; margin: 0 auto; pointer-events: none; }

/* Hint */
.hint-box { background: var(--yellow-light); border: 1px solid #FDE68A; border-radius: var(--radius); padding: .75rem 1rem; font-size: .9rem; margin-top: .75rem; }

/* Matching */
.matching-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.match-item {
  padding: .8rem 1rem; background: var(--purple-50);
  border: 2px solid var(--purple-200); border-radius: var(--radius);
  font-weight: 600; cursor: grab; text-align: center;
  user-select: none; transition: all var(--transition);
}
.match-item.dragging   { opacity: .5; cursor: grabbing; }
.match-item.matched    { border-color: var(--green); background: var(--green-light); }
.match-item.mismatched { border-color: var(--red);   background: var(--red-light); animation: shake .4s ease; }

/* Drag-order */
.drag-words { display: flex; flex-wrap: wrap; gap: .6rem; min-height: 54px; padding: .5rem; background: var(--gray-50); border-radius: var(--radius); border: 2px dashed var(--border); }
.drag-word  { padding: .45rem .9rem; background: var(--purple-800); color: var(--white); border-radius: var(--radius-xl); font-weight: 700; cursor: grab; user-select: none; }
.drag-word:active { cursor: grabbing; }

/* Fill blank */
.blank-input {
  border: none; border-bottom: 3px solid var(--purple-800); background: transparent;
  padding: .1rem .5rem; font-size: 1.1rem; font-weight: 700; color: var(--purple-800);
  outline: none; width: 120px; text-align: center;
}

/* ══════════════════════════════════════════════════════════
   LEADERBOARD
══════════════════════════════════════════════════════════ */
.leaderboard-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; background: var(--white);
  border-radius: var(--radius); border: 1px solid var(--border);
  transition: all var(--transition);
}
.leaderboard-item:hover { border-color: var(--purple-300); box-shadow: var(--shadow-sm); }
.leaderboard-rank { font-size: 1.5rem; font-weight: 800; width: 2.5rem; text-align: center; }
.rank-1 { color: #F59E0B; }
.rank-2 { color: #94A3B8; }
.rank-3 { color: #CA8A04; }
.leaderboard-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-800), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 800; font-size: 1rem;
  flex-shrink: 0;
}
.leaderboard-name   { font-weight: 700; flex: 1; }
.leaderboard-points { font-weight: 800; color: var(--purple-800); font-size: 1.1rem; }

/* ══════════════════════════════════════════════════════════
   ADMIN PANEL
══════════════════════════════════════════════════════════ */
.admin-layout { display: flex; min-height: calc(100vh - var(--nav-h)); }
.admin-sidebar {
  width: 260px; background: var(--purple-900); color: var(--white);
  padding: 1.5rem 0; flex-shrink: 0; position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h)); overflow-y: auto;
}
.admin-logo {
  padding: 0 1.5rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.1);
  font-family: var(--font-head); font-weight: 800; font-size: 1.1rem;
  display: flex; align-items: center; gap: .6rem;
}
.admin-nav-section { margin-top: 1.25rem; }
.admin-nav-label   { padding: .5rem 1.5rem; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.45); }
.admin-nav-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.5rem; color: rgba(255,255,255,.75); font-weight: 600; font-size: .92rem;
  transition: all var(--transition);
}
.admin-nav-link:hover, .admin-nav-link.active {
  background: rgba(255,255,255,.1); color: var(--white); text-decoration: none;
}
.admin-nav-link .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.admin-content { flex: 1; padding: 2rem; background: var(--gray-50); overflow-y: auto; }
.admin-page-title { font-size: 1.6rem; margin-bottom: 1.5rem; color: var(--gray-900); }
.stat-card {
  background: var(--white); border-radius: var(--radius); padding: 1.5rem;
  border: 1px solid var(--border); text-align: center;
}
.stat-card-num   { font-size: 2.5rem; font-weight: 800; color: var(--purple-800); font-family: var(--font-head); }
.stat-card-label { color: var(--text-muted); font-size: .9rem; margin-top: .25rem; }

/* ══════════════════════════════════════════════════════════
   FLASHCARD
══════════════════════════════════════════════════════════ */
.flashcard-wrap  { perspective: 1000px; }
.flashcard {
  width: 100%; max-width: 460px; height: 240px; margin: 0 auto;
  position: relative; transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.4,0,.2,1); cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
  position: absolute; inset: 0; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; backface-visibility: hidden;
  box-shadow: var(--shadow);
}
.flashcard-front { background: linear-gradient(135deg, var(--purple-800), var(--accent)); color: var(--white); }
.flashcard-back  { background: var(--white); color: var(--gray-900); transform: rotateY(180deg); }
.flashcard-word  { font-size: 2.5rem; font-weight: 800; font-family: var(--font-head); }
.flashcard-hint  { font-size: 1rem; opacity: .8; margin-top: .5rem; }

/* ══════════════════════════════════════════════════════════
   DARK MODE
══════════════════════════════════════════════════════════ */
body.dark {
  --bg:         #0F0F1A;
  --text:       #E2E8F0;
  --text-muted: #94A3B8;
  --border:     rgba(255,255,255,.08);
  --gray-50:    #1A1A2E;
  --gray-100:   #1E1E30;
  --gray-200:   rgba(255,255,255,.08);
  --white:      #1A1A2E;
}
body.dark .navbar { background: rgba(15,15,26,.9); border-bottom-color: rgba(255,255,255,.06); }
body.dark .card   { background: #1A1A2E; }
body.dark .option-btn { background: #1A1A2E; color: #E2E8F0; border-color: rgba(255,255,255,.1); }

/* ── Dark mode toggle ──────────────────────────────────── */
.dark-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gray-100); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; cursor: pointer; transition: all var(--transition);
}
.dark-toggle:hover { background: var(--purple-50); border-color: var(--purple-300); }

/* ══════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════ */
.site-footer { background: var(--gray-900); color: rgba(255,255,255,.8); padding: 3rem 1.25rem 1.5rem; margin-top: auto; }
.footer-container { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2rem; }
.footer-logo { display: flex; align-items: center; gap: .6rem; font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; color: var(--white); text-decoration: none; margin-bottom: .75rem; }
.footer-tagline { font-size: .9rem; opacity: .7; line-height: 1.6; margin-bottom: 1rem; }
.footer-social  { display: flex; gap: .75rem; }
.social-link {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.social-link:hover { background: var(--purple-800); color: var(--white); text-decoration: none; }
.footer-heading { color: var(--white); font-size: .88rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1rem; }
.footer-links   { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a { color: rgba(255,255,255,.65); font-size: .9rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--white); text-decoration: none; }
.footer-bottom  { border-top: 1px solid rgba(255,255,255,.08); padding-top: 1.25rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .85rem; opacity: .6; }

/* ══════════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════════ */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius); font-weight: 600; margin-bottom: 1rem; display: flex; align-items: flex-start; gap: .6rem; }
.alert-success { background: var(--green-light);  color: #166534; border: 1px solid #A7F3D0; }
.alert-error   { background: var(--red-light);    color: #991B1B; border: 1px solid #FCA5A5; }
.alert-warning { background: var(--yellow-light); color: #92400E; border: 1px solid #FDE68A; }
.alert-info    { background: var(--blue-light);   color: #1E40AF; border: 1px solid #BFDBFE; }

/* ══════════════════════════════════════════════════════════
   UTILITY
══════════════════════════════════════════════════════════ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-purple { color: var(--purple-800); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.fw-bold     { font-weight: 700; }
.fw-800      { font-weight: 800; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  :root { --nav-h: 60px; }
  .nav-links, .nav-auth { display: none; }
  .hamburger { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .hero-parrot { width: 120px; height: 120px; }
  .hero-stats  { gap: 1.5rem; }
  .hero-stat-num { font-size: 1.75rem; }
  .admin-layout  { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: relative; }
  .footer-grid   { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .matching-grid { grid-template-columns: 1fr; }
  .parrot-bubble { bottom: .75rem; left: .75rem; max-width: 220px; }
  .toast-container { right: .75rem; bottom: .75rem; max-width: calc(100vw - 1.5rem); }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .hero-cta { flex-direction: column; }
  .quiz-header { flex-direction: column; align-items: flex-start; }
}
