/* =========================================================
   Tuition Institute – Student Results Styles
   ========================================================= */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --ti-primary:   #1a73e8;
  --ti-secondary: #fbbc04;
  --ti-dark:      #1a1a2e;
  --ti-light:     #f4f7ff;
  --ti-success:   #34a853;
  --ti-radius:    12px;
  --ti-shadow:    0 4px 20px rgba(0,0,0,0.08);
  --ti-transition: all 0.3s ease;
}

/* ── Filter Bar ─────────────────────────────────────────── */
.ti-filter-bar       { margin-bottom: 28px; }
.ti-year-filter      { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ti-filter-label     { font-weight: 600; color: var(--ti-dark); margin-right: 4px; }
.ti-year-btn {
  display: inline-block;
  padding: 6px 16px;
  border: 2px solid var(--ti-primary);
  border-radius: 50px;
  color: var(--ti-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: var(--ti-transition);
}
.ti-year-btn:hover,
.ti-year-btn.active {
  background: var(--ti-primary);
  color: #fff;
  text-decoration: none;
}

/* ── Results Grid ───────────────────────────────────────── */
.ti-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

/* ── Result Card ────────────────────────────────────────── */
.ti-result-card {
  background: #fff;
  border-radius: var(--ti-radius);
  box-shadow: var(--ti-shadow);
  overflow: hidden;
  transition: var(--ti-transition);
  border: 1px solid #e8edf5;
}
.ti-result-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(26,115,232,0.15);
}

/* Photo area */
.ti-card-photo {
  position: relative;
  text-align: center;
  background: linear-gradient(135deg, var(--ti-primary), #6c63ff);
  padding: 28px 20px 20px;
}
.ti-card-photo img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.ti-no-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border: 4px solid rgba(255,255,255,0.5);
}
.ti-no-photo span {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}

/* Grade badge */
.ti-grade-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--ti-secondary);
  color: var(--ti-dark);
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Card body */
.ti-card-body       { padding: 20px; }
.ti-student-name    { font-size: 18px; font-weight: 700; color: var(--ti-dark); margin: 0 0 12px; }
.ti-card-body p     { margin: 6px 0; font-size: 14px; color: #555; line-height: 1.5; }
.ti-label           { font-weight: 600; color: var(--ti-dark); }
.ti-remarks         { font-style: italic; color: #777; font-size: 13px; margin-top: 10px !important; }

/* Percentage bar */
.ti-percentage-bar {
  background: #eef2ff;
  border-radius: 50px;
  height: 10px;
  margin: 12px 0 4px;
  position: relative;
  overflow: visible;
}
.ti-bar-fill {
  background: linear-gradient(90deg, var(--ti-primary), var(--ti-success));
  border-radius: 50px;
  height: 100%;
  transition: width 1s ease;
}
.ti-pct-label {
  display: block;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--ti-primary);
  margin-top: 2px;
}

/* ── Toppers Section ────────────────────────────────────── */
.ti-toppers-section  { margin: 40px 0; }
.ti-toppers-heading  {
  text-align: center;
  font-size: 28px;
  color: var(--ti-dark);
  margin-bottom: 32px;
  position: relative;
}
.ti-toppers-heading::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--ti-primary);
  margin: 12px auto 0;
  border-radius: 2px;
}
.ti-toppers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  text-align: center;
}
.ti-topper-card {
  background: #fff;
  border-radius: var(--ti-radius);
  box-shadow: var(--ti-shadow);
  padding: 24px 16px;
  position: relative;
  transition: var(--ti-transition);
}
.ti-topper-card:hover   { transform: translateY(-4px); }
.ti-topper-card.rank-1  { border-top: 4px solid #ffd700; }
.ti-topper-card.rank-2  { border-top: 4px solid #c0c0c0; }
.ti-topper-card.rank-3  { border-top: 4px solid #cd7f32; }

.ti-rank-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ti-primary);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rank-1 .ti-rank-badge { background: #ffd700; color: #333; }
.rank-2 .ti-rank-badge { background: #c0c0c0; color: #333; }
.rank-3 .ti-rank-badge { background: #cd7f32; color: #fff; }

.ti-topper-photo img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--ti-primary);
  margin-bottom: 12px;
}
.ti-topper-card h4     { font-size: 16px; color: var(--ti-dark); margin: 0 0 6px; }
.ti-topper-class       { font-size: 13px; color: #666; margin: 2px 0; }
.ti-topper-pct         { font-size: 22px; font-weight: 700; color: var(--ti-primary); margin: 4px 0; }
.ti-topper-year        { font-size: 12px; color: #999; }

/* ── Stats Bar ──────────────────────────────────────────── */
.ti-stats-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  background: linear-gradient(135deg, var(--ti-dark), #16213e);
  border-radius: var(--ti-radius);
  padding: 32px 20px;
  margin: 32px 0;
  text-align: center;
}
.ti-stat            { flex: 1; min-width: 120px; }
.ti-stat-num        { display: block; font-size: 36px; font-weight: 800; color: var(--ti-secondary); }
.ti-stat-label      { font-size: 14px; color: rgba(255,255,255,0.75); margin-top: 4px; display: block; }

/* ── Results Table ──────────────────────────────────────── */
.ti-results-table-wrap { overflow-x: auto; margin-bottom: 32px; }
.ti-results-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--ti-radius);
  overflow: hidden;
  box-shadow: var(--ti-shadow);
  font-size: 14px;
}
.ti-results-table th {
  background: var(--ti-dark);
  color: #fff;
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.ti-results-table td {
  padding: 12px;
  border-bottom: 1px solid #f0f3fa;
  color: #444;
  vertical-align: middle;
}
.ti-results-table tr:hover td { background: var(--ti-light); }
.ti-results-table tr:last-child td { border-bottom: none; }

.ti-no-photo-sm {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--ti-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* ── Pagination ─────────────────────────────────────────── */
.ti-pagination       { text-align: center; margin: 32px 0; }
.ti-pagination .page-numbers {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 3px;
  border: 2px solid var(--ti-primary);
  border-radius: 8px;
  color: var(--ti-primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--ti-transition);
}
.ti-pagination .page-numbers.current,
.ti-pagination .page-numbers:hover {
  background: var(--ti-primary);
  color: #fff;
  text-decoration: none;
}

/* ── No results ─────────────────────────────────────────── */
.ti-no-results {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 16px;
  background: var(--ti-light);
  border-radius: var(--ti-radius);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .ti-results-grid     { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
  .ti-toppers-grid     { grid-template-columns: repeat(2, 1fr); }
  .ti-stat-num         { font-size: 28px; }
  .ti-stats-bar        { padding: 24px 12px; }
}
@media (max-width: 480px) {
  .ti-results-grid     { grid-template-columns: 1fr; }
  .ti-toppers-grid     { grid-template-columns: 1fr; }
}
