/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Yagona dizayn: muxtorbek.uz navy + oltin palitrasi */
  --bg:          #f8f7f3;
  --bg2:         #f3f5fa;
  --bg3:         #eef1f7;
  --surface:     #ffffff;
  --surface2:    #eef1f7;
  --border:      rgba(26,58,92,0.10);
  --border2:     rgba(26,58,92,0.18);
  --accent:      #1a3a5c;
  --accent2:     #2456a4;
  --accent-glow: rgba(26,58,92,0.12);
  --gold:        #c98a12;
  --green:       #1f8a5b;
  --orange:      #d97a1e;
  --text:        #1c2333;
  --text2:       #5a6680;
  --text3:       #8a94a8;
  --radius:      14px;
  --radius-sm:   10px;
  --font:        'DM Sans', system-ui, sans-serif;
  --mono:        'DM Sans', system-ui, sans-serif;
}

html { font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== BACKGROUND ===== */
.bg-grid {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(36,86,164,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36,86,164,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.bg-glow {
  position: fixed; z-index: 0; border-radius: 50%;
  filter: blur(80px); pointer-events: none; opacity: 0.5;
}
.glow-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(36,86,164,0.12), transparent 70%);
  top: -200px; right: -200px;
}
.glow-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(62,207,142,0.08), transparent 70%);
  bottom: 0; left: -150px;
}

/* ===== PAGE ===== */
.page {
  position: relative; z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* ===== HEADER ===== */
.header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.header-icon {
  width: 54px; height: 54px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.header-text { flex: 1; }
.header-text h1 { font-family: var(--mux-display, Georgia, serif); font-size: clamp(1.7rem, 3.5vw, 2.3rem); font-weight: 700; color: var(--accent); letter-spacing: -0.01em; }
.header-text p { font-size: 0.85rem; color: var(--text2); margin-top: 2px; }
.header-badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px;
  color: var(--text2);
  white-space: nowrap;
}

/* ===== FORMULA BANNER ===== */
.formula-banner {
  display: flex; align-items: center; gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 8px;
}
.formula-item {
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 180px;
}
.fi-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
  flex-shrink: 0;
}
.fi-deg  { background: rgba(36,86,164,0.15); color: var(--accent2); border: 1px solid rgba(36,86,164,0.25); }
.fi-cert { background: rgba(245,200,66,0.12); color: var(--gold);   border: 1px solid rgba(245,200,66,0.25); }
.fi-ball { background: rgba(62,207,142,0.12); color: var(--green);  border: 1px solid rgba(62,207,142,0.25); }
.fi-title { font-size: 0.85rem; font-weight: 600; }
.fi-desc  { font-size: 0.75rem; color: var(--text2); }
.fi-weight {
  margin-left: auto; font-size: 0.7rem; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.fi-weight.high { background: rgba(36,86,164,0.15); color: var(--accent2); }
.fi-weight.mid  { background: rgba(245,200,66,0.12); color: var(--gold); }
.fi-weight.low  { background: rgba(62,207,142,0.12); color: var(--green); }
.formula-sep {
  font-size: 1.4rem; color: var(--text3); padding: 0 4px;
  font-weight: 300; align-self: center;
}

/* ===== SECTION ===== */
.section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
  animation: fadeUp 0.4s ease both;
}
.section-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text3);
  margin-bottom: 1.2rem;
}
.step-num {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--accent); opacity: 0.8;
}

/* ===== GENERAL GRID ===== */
.general-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}
@media (max-width: 600px) {
  .general-grid { grid-template-columns: 1fr; }
}

/* ===== FIELD GROUP ===== */
.field-group { display: flex; flex-direction: column; gap: 7px; }
.field-group label {
  font-size: 0.8rem; color: var(--text2); font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.field-group label svg { color: var(--accent); opacity: 0.7; }
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%; padding: 10px 14px;
  padding-right: 48px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font); font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.input-wrap input::placeholder { color: var(--text3); }
.input-unit {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem; color: var(--text3);
  font-family: var(--mono);
  pointer-events: none;
}

/* ===== BUTTONS ===== */
.btn-generate {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(36,86,164,0.3);
}
.btn-generate:hover {
  background: var(--accent2);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(36,86,164,0.4);
}
.btn-generate:active { transform: scale(0.97); }

.calc-wrap { margin-bottom: 1.5rem; }
.btn-calc {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--accent), #2456a4);
  color: #fff; border: none;
  border-radius: var(--radius);
  font-family: var(--font); font-size: 1rem; font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 30px rgba(36,86,164,0.35);
  letter-spacing: 0.01em;
}
.btn-calc:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(36,86,164,0.45);
}
.btn-calc:active { transform: scale(0.98); }

/* ===== TEACHER CARDS ===== */
.teacher-section-label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text3);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 1rem; margin-top: 0.5rem;
}

.tc {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 10px;
  transition: border-color 0.2s, transform 0.2s;
  animation: fadeUp 0.35s ease both;
}
.tc:hover { border-color: var(--border2); transform: translateY(-1px); }

.tc-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.tc-avatar {
  width: 32px; height: 32px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--accent); font-weight: 500;
  flex-shrink: 0;
}
.tc-num { font-size: 0.8rem; font-weight: 600; color: var(--text2); }

.tc-grid {
  display: grid;
  grid-template-columns: 2fr 2fr 2fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .tc-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== SELECT & INPUT inside tc ===== */
.field-group select,
.field-group input[type="text"],
.field-group input[type="number"] {
  width: 100%; padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font); font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none; -webkit-appearance: none;
}
.field-group select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b92a8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.field-group select:focus,
.field-group input[type="text"]:focus,
.field-group input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field-group input::placeholder { color: var(--text3); }
.field-group select option { background: var(--surface); color: var(--text); }

/* ===== BALL INPUT SPECIAL ===== */
.ball-wrap { position: relative; }
.ball-wrap input {
  padding-right: 40px;
  font-family: var(--mono);
  font-weight: 500;
}
.ball-max {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem; color: var(--text3); font-family: var(--mono);
  pointer-events: none;
}

/* ===== RESULTS ===== */
.results-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fadeUp 0.4s ease both;
  margin-bottom: 1.5rem;
}
.results-header {
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.results-title { font-size: 1rem; font-weight: 600; }
.stats-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-chip {
  font-family: var(--mono); font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text2);
}
.stat-chip span { color: var(--text); font-weight: 500; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem;
}
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s; }
tbody tr:hover td { background: var(--surface); }

/* rank number */
.rank { font-family: var(--mono); font-size: 0.75rem; color: var(--text3); }
.rank-1 { color: var(--gold); }
.rank-2 { color: #7a8699; }
.rank-3 { color: var(--orange); }

/* name */
.t-name { font-weight: 600; font-size: 0.9rem; }

/* degree pills */
.pill {
  display: inline-flex; align-items: center;
  font-size: 0.72rem; padding: 3px 10px;
  border-radius: 20px; font-weight: 500;
  white-space: nowrap;
}
.pill-d1 { background: rgba(36,86,164,0.15); color: #1a3a5c; border: 1px solid rgba(36,86,164,0.2); }
.pill-d2 { background: rgba(62,207,142,0.12); color: #1f8a5b; border: 1px solid rgba(62,207,142,0.2); }
.pill-d3 { background: rgba(245,200,66,0.12); color: #c98a12; border: 1px solid rgba(245,200,66,0.2); }
.pill-d4 { background: rgba(245,167,66,0.1);  color: #d97a1e; border: 1px solid rgba(245,167,66,0.2); }
.pill-d5 { background: rgba(139,146,168,0.1); color: #8b92a8; border: 1px solid rgba(139,146,168,0.2); }

.pill-c0 { background: rgba(245,200,66,0.15); color: #c98a12; border: 1px solid rgba(245,200,66,0.25); }
.pill-c1 { background: rgba(62,207,142,0.12); color: #1f8a5b; border: 1px solid rgba(62,207,142,0.2); }

/* score bar */
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-bg { flex: 1; height: 5px; background: var(--surface2); border-radius: 3px; overflow: hidden; min-width: 50px; }
.bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.6s ease; }
.bar-val { font-family: var(--mono); font-size: 0.72rem; color: var(--text2); min-width: 32px; text-align: right; }

/* hours */
.hours-val {
  font-family: var(--mono);
  font-size: 1.1rem; font-weight: 700;
  color: var(--text);
  text-align: right;
}
.hours-val.top1 { color: var(--gold); }
.hours-val.top2 { color: #7a8699; }
.hours-val.top3 { color: var(--orange); }

/* total ball */
.total-ball {
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--text3);
  padding: 2px 8px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ===== NOTE BOX ===== */
.note-box {
  margin: 0 1.4rem 1.4rem;
  padding: 12px 16px;
  background: rgba(36,86,164,0.06);
  border: 1px solid rgba(36,86,164,0.15);
  border-radius: var(--radius-sm);
  font-size: 0.8rem; color: var(--text2);
  line-height: 1.7;
}
.note-box strong { color: var(--accent2); font-weight: 600; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* stagger teacher cards */
.tc:nth-child(1)  { animation-delay: 0.02s; }
.tc:nth-child(2)  { animation-delay: 0.05s; }
.tc:nth-child(3)  { animation-delay: 0.08s; }
.tc:nth-child(4)  { animation-delay: 0.11s; }
.tc:nth-child(5)  { animation-delay: 0.14s; }
.tc:nth-child(6)  { animation-delay: 0.17s; }
.tc:nth-child(7)  { animation-delay: 0.20s; }
.tc:nth-child(8)  { animation-delay: 0.23s; }
.tc:nth-child(9)  { animation-delay: 0.26s; }
.tc:nth-child(10) { animation-delay: 0.29s; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }
