/* erlams.az — əsas stil */

:root {
  --brand: #2563eb;
  --brand-2: #06b6d4;
  --tg: #229ed9;
  --ok: #16a34a;
  --bad: #dc2626;
  --warn: #d97706;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --radius: 18px;
  --nav-h: 72px;
}
[data-bs-theme="dark"] {
  --bg: #0b1120;
  --surface: #111a2e;
  --surface-2: #17223a;
  --text: #e5e9f2;
  --muted: #94a3b8;
  --border: #23314d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-top: var(--nav-h);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Naviqasiya ---------- */
.site-nav {
  min-height: var(--nav-h);
  background: rgba(15, 23, 42, .92);
  backdrop-filter: saturate(160%) blur(10px);
  transition: box-shadow .2s;
}
.site-nav.scrolled { box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.site-nav .nav-link { color: #cbd5e1; font-weight: 500; padding: .5rem .9rem !important; border-radius: 10px; }
.site-nav .nav-link:hover, .site-nav .nav-link:focus { color: #fff; background: rgba(255, 255, 255, .08); }
.site-nav .navbar-toggler { border-color: rgba(255, 255, 255, .25); }
.site-nav .navbar-toggler-icon { filter: invert(1); }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .06); font-size: 18px; line-height: 1; cursor: pointer;
}
.theme-toggle .i-moon { display: none; }
[data-bs-theme="dark"] .theme-toggle .i-sun { display: none; }
[data-bs-theme="dark"] .theme-toggle .i-moon { display: inline; }

/* ---------- Hero ---------- */
.hero { margin-top: 1.5rem; }
.hero .carousel { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero .carousel-item img { aspect-ratio: 16 / 6; object-fit: cover; }
.hero .carousel-item::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(2, 6, 23, .75));
}
.hero .carousel-caption { z-index: 2; text-align: left; left: 6%; right: 6%; bottom: 2.2rem; }
.hero .carousel-caption h2 { font-weight: 800; font-size: clamp(1.4rem, 3.5vw, 2.6rem); margin-bottom: .3rem; }
.hero .carousel-caption p { font-size: clamp(.85rem, 1.5vw, 1.1rem); max-width: 720px; opacity: .92; margin: 0; }
@media (max-width: 575px) {
  .hero .carousel-item img { aspect-ratio: 4 / 3; }
  .hero .carousel-caption { bottom: 1.6rem; }
  .hero .carousel-caption p { display: none; }
}

/* ---------- Bölmələr ---------- */
.section { padding-top: 3rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.25rem; }
.section-head > :first-child { flex: 1 1 100%; }
.section-title { font-weight: 800; font-size: clamp(1.35rem, 2.6vw, 1.9rem); margin: 0; display: flex; align-items: center; gap: .5rem; letter-spacing: -.01em; }
.section-sub { color: var(--muted); margin: .35rem 0 0; flex: 1 1 100%; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }

/* ---------- Reytinq ---------- */
.report-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: .95rem;
  padding: .5rem .95rem; border-radius: 10px; transition: background .15s, color .15s; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg-sm button { font-size: .85rem; padding: .4rem .75rem; }
.report-toolbar .search { max-width: 240px; margin-left: auto; border-radius: 12px; background: var(--surface-2); border-color: var(--border); }
@media (max-width: 767px) {
  .report-toolbar .search { max-width: none; margin-left: 0; flex: 1 1 100%; }
  .seg { flex: 1 1 100%; flex-wrap: nowrap; }
  .seg button { flex: 1; padding: .5rem .3rem; font-size: .85rem; }
}
.period-label { color: var(--muted); font-size: .9rem; margin: .9rem 0 .25rem; min-height: 1.2em; }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: .75rem 0 1.25rem; align-items: end; }
.podium-item {
  border-radius: 16px; padding: 1rem .75rem; text-align: center; border: 1px solid var(--border);
  background: var(--surface-2); min-width: 0;
}
.podium-item.p1 { order: 2; background: linear-gradient(160deg, rgba(250, 204, 21, .22), rgba(250, 204, 21, .05)); border-color: rgba(250, 204, 21, .5); padding-top: 1.6rem; }
.podium-item.p2 { order: 1; background: linear-gradient(160deg, rgba(148, 163, 184, .25), rgba(148, 163, 184, .05)); }
.podium-item.p3 { order: 3; background: linear-gradient(160deg, rgba(217, 119, 6, .2), rgba(217, 119, 6, .04)); }
.podium .medal { font-size: 2rem; line-height: 1; }
.podium .p1 .medal { font-size: 2.6rem; }
.podium .pname { font-weight: 700; margin-top: .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium .pscore { font-size: 1.5rem; font-weight: 800; color: var(--brand); }
.podium .pmeta { font-size: .8rem; color: var(--muted); }
@media (max-width: 575px) {
  .podium { gap: .4rem; }
  .podium-item { padding: .7rem .35rem; }
  .podium .pname { font-size: .82rem; }
  .podium .pscore { font-size: 1.15rem; }
  .podium .pmeta { display: none; }
}

.report-table { --bs-table-bg: transparent; color: var(--text); }
.report-table thead th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; border-bottom-color: var(--border); }
.report-table td { border-color: var(--border); padding-top: .7rem; padding-bottom: .7rem; }
.report-table tbody tr:hover { background: var(--surface-2); }
.report-table .rank { width: 3rem; font-weight: 700; color: var(--muted); }
.report-table tr.top1 .rank { color: #ca8a04; }
.report-table tr.top2 .rank { color: #64748b; }
.report-table tr.top3 .rank { color: #b45309; }
.report-table .name { font-weight: 600; }
.report-table .ok { color: var(--ok); font-weight: 600; }
.report-table .bad { color: var(--bad); font-weight: 600; }
.report-table .blank { color: var(--warn); font-weight: 600; }
.report-table .muted { color: var(--muted); }
.cls-badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 6px; margin-left: .35rem; vertical-align: middle; }
.cls-badge.c10 { background: rgba(37, 99, 235, .12); color: #2563eb; }
.cls-badge.c11 { background: rgba(147, 51, 234, .12); color: #9333ea; }
.pct-col { width: 34%; min-width: 150px; }
.pct { display: flex; align-items: center; gap: .6rem; }
.pct .bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.pct .bar span { display: block; height: 100%; border-radius: 99px; transition: width .5s; }
.pct.hi .bar span { background: linear-gradient(90deg, #22c55e, #16a34a); }
.pct.mid .bar span { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.pct.lo .bar span { background: linear-gradient(90deg, #f87171, #dc2626); }
.pct b { width: 3rem; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 575px) {
  .pct-col { width: auto; min-width: 0; }
  .pct .bar { display: none; }
  .report-table { font-size: .9rem; }
  .report-table th, .report-table td { padding-left: .35rem; padding-right: .35rem; }
}
.empty-state { text-align: center; color: var(--muted); padding: 2rem 1rem 1rem; margin: 0; }

/* ---------- Yazılı test kartları ---------- */
.exam-swiper { padding: .5rem .25rem 3rem; }
.exam-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.5rem 1.25rem; text-align: center; height: 100%;
}
.exam-card img, .exam-card .avatar-ph {
  width: 150px; height: 150px; border-radius: 50%; object-fit: cover; margin: 0 auto .9rem; display: block;
  border: 4px solid var(--surface); box-shadow: 0 0 0 3px var(--brand-2), 0 10px 24px rgba(0, 0, 0, .15);
}
.exam-card .avatar-ph { display: grid; place-items: center; font-size: 3rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.exam-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: .9rem; }
.exam-card dl { margin: 0 0 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.exam-card dl div { background: var(--surface-2); border-radius: 10px; padding: .45rem .3rem; }
.exam-card dt { font-size: .72rem; color: var(--muted); font-weight: 500; }
.exam-card dd { margin: 0; font-weight: 700; }
.exam-card dl .bad dd { color: var(--bad); }
.exam-card .score {
  display: inline-flex; align-items: baseline; gap: .4rem; padding: .5rem 1.1rem; border-radius: 99px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); font-weight: 600;
}
.exam-card .score b { font-size: 1.35rem; }
.swiper-button-next, .swiper-button-prev { color: var(--brand); }
.swiper-pagination-bullet-active { background: var(--brand); }
@media (max-width: 767px) { .swiper-button-next, .swiper-button-prev { display: none; } }

/* ---------- Onlayn imtahan cədvəli ---------- */
.legend { display: flex; gap: .4rem; flex-wrap: wrap; font-size: .8rem; }
.legend span { padding: .2rem .55rem; border-radius: 8px; font-weight: 600; }
.quiz-scroll { overflow: auto; max-height: 80vh; border-radius: var(--radius); }
.quiz-table { --bs-table-bg: transparent; font-size: .85rem; color: var(--text); border-collapse: separate; border-spacing: 0; }
.quiz-table th, .quiz-table td { border-color: var(--border); white-space: nowrap; text-align: center; padding: .35rem .3rem; }
.quiz-table thead th { position: sticky; top: 0; z-index: 2; background: var(--tg); color: #fff; vertical-align: bottom; border-color: rgba(255, 255, 255, .25); }
.quiz-table .vh { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 230px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; margin: 0 auto; }
.quiz-table .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.quiz-table .name-col { left: 2.6rem; text-align: left; font-weight: 600; padding-left: .75rem; padding-right: .75rem; box-shadow: 1px 0 0 var(--border); }
.quiz-table td.sticky-col:first-child { width: 2.6rem; min-width: 2.6rem; }
.quiz-table thead .sticky-col { z-index: 3; background: #1a86bb; }
.quiz-table .avg-col { font-weight: 800; }
.quiz-table tbody tr td { background-clip: padding-box; }
.q-top { --row: rgba(6, 182, 212, .18); }
.q-good { --row: rgba(34, 197, 94, .18); }
.q-mid { --row: rgba(245, 158, 11, .2); }
.q-low { --row: rgba(239, 68, 68, .16); }
.legend .q-top, .legend .q-good, .legend .q-mid, .legend .q-low { background: var(--row); }
.quiz-table tbody tr td { background-color: var(--row, transparent); }
.quiz-table tbody tr td.sticky-col { background: linear-gradient(var(--row, transparent), var(--row, transparent)), var(--surface); }

/* ---------- Dərs cədvəli ---------- */
.schedule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.schedule-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; border-top: 4px solid var(--brand); }
.schedule-card:nth-child(2n) { border-top-color: #9333ea; }
.schedule-card:nth-child(3n) { border-top-color: var(--brand-2); }
.schedule-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .75rem; }
.schedule-card ul { list-style: none; padding: 0; margin: 0; }
.schedule-card li { padding: .4rem 0; border-top: 1px dashed var(--border); color: var(--text); }
.schedule-card li::before { content: '🕒'; margin-right: .5rem; }

/* ---------- Xəritə, WhatsApp, footer ---------- */
.map-wrap iframe { width: 100%; height: 420px; border: 0; display: block; }
[data-bs-theme="dark"] .map-wrap iframe { filter: invert(.9) hue-rotate(180deg); }
.whatsapp-button { position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px; z-index: 1000; }
.whatsapp-button img { width: 100%; height: 100%; transition: transform .2s; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .25)); }
.whatsapp-button:hover img { transform: scale(1.1); }
.site-footer { margin-top: 3rem; padding: 1.5rem 1rem; text-align: center; color: #94a3b8; background: #0f172a; font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ---------- Onlayn test çağırışı ---------- */
.btn-kabinet { border-radius: 10px; font-weight: 600; padding: .45rem 1rem; }
@media (max-width: 991px) { .btn-kabinet { display: block; margin: .5rem 0; } }
.cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem;
  padding: 2rem; border-radius: var(--radius); color: #fff; box-shadow: var(--shadow);
  background: linear-gradient(120deg, #1d4ed8, #0891b2);
}
.cta h2 { font-weight: 800; font-size: clamp(1.3rem, 2.5vw, 1.8rem); margin-bottom: .35rem; }
.cta p { margin: 0; opacity: .92; max-width: 560px; }
.cta-btns { display: flex; gap: .6rem; flex-wrap: wrap; }
.cta-btns .btn { font-weight: 600; border-radius: 12px; }
