/* ===== BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #1A1A1A;
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px;
}

.container {
  width: 100%;
  max-width: 520px;
}

.hidden { display: none !important; }

/* ===== HEADER ===== */
.header {
  text-align: center;
  margin-bottom: 40px;
}

.title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 1rem;
  font-weight: 500;
  color: #a0a0a0;
}

/* ===== SEARCH ===== */
.search-section {
  margin-bottom: 24px;
}

.search-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #a0a0a0;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-box {
  display: flex;
  gap: 0;
  background: #111111;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.search-box:focus-within {
  border-color: #ffffff;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  padding: 14px 16px;
  letter-spacing: 0.5px;
}

.search-box input::placeholder {
  color: #555555;
}

.search-box button {
  background: #ffffff;
  color: #000000;
  border: none;
  padding: 14px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.search-box button:hover {
  background: #e0e0e0;
}

.search-box button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== LOADING ===== */
.loading {
  text-align: center;
  padding: 40px 0;
}

.loading p {
  font-size: 0.85rem;
  color: #888888;
  margin-top: 12px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid #333333;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== ERROR ===== */
.error-card {
  background: #1a0a0a;
  border: 1px solid #4a1a1a;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.error-card p {
  font-size: 0.85rem;
  color: #ff6b6b;
}

/* ===== STUDENT INFO CARD ===== */
.student-info-card {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
}

.student-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.student-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-item {
  font-size: 0.8rem;
  color: #888888;
  font-weight: 500;
}

.meta-sep {
  color: #333333;
  font-size: 0.75rem;
}

.team-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 12px;
  background: #0d1a2d;
  border: 1px solid #1a3050;
  border-radius: 8px;
  font-size: 0.75rem;
  color: #60a5fa;
  font-weight: 600;
}

.team-role {
  color: #4a7ab5;
  font-weight: 400;
}

/* ===== PHASE TIMELINE ===== */
.phase-timeline {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ===== PHASE CONNECTOR ===== */
.phase-connector {
  width: 2px;
  height: 20px;
  margin-left: 23px;
  background: #2a2a2a;
}

.phase-connector.active {
  background: #4ade80;
}

.phase-connector.locked {
  background: #1a1a1a;
}

/* ===== PHASE CARD ===== */
.phase-card {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 16px;
  overflow: hidden;
  animation: fadeIn 0.3s ease;
}

.phase-card.phase-passed {
  border-color: #1a3a1a;
}

.phase-card.phase-failed {
  border-color: #3a1a1a;
}

.phase-card.phase-pending {
  border-color: #3a3000;
}

.phase-card.phase-warning {
  border-color: #3a2a00;
}

.phase-card.phase-locked {
  border-color: #141414;
  opacity: 0.5;
}

.phase-card.phase-upcoming {
  border-color: #1a1a2a;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== PHASE HEADER ===== */
.phase-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
}

.phase-indicator {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #1a1a1a;
  border: 2px solid #2a2a2a;
}

.phase-indicator.passed {
  background: #0a2a0a;
  border-color: #4ade80;
}

.phase-indicator.failed {
  background: #2a0a0a;
  border-color: #f87171;
}

.phase-indicator.pending {
  background: #2a2500;
  border-color: #facc15;
}

.phase-indicator.warning {
  background: #2a1a00;
  border-color: #fb923c;
}

.phase-indicator.locked {
  background: #111111;
  border-color: #1a1a1a;
}

.phase-indicator.upcoming {
  background: #0a0a1a;
  border-color: #6366f1;
}

.phase-number {
  font-size: 0.85rem;
  font-weight: 700;
  color: #888888;
}

.phase-indicator.passed .phase-number { color: #4ade80; }
.phase-indicator.failed .phase-number { color: #f87171; }
.phase-indicator.pending .phase-number { color: #facc15; }
.phase-indicator.warning .phase-number { color: #fb923c; }
.phase-indicator.locked .phase-number { color: #333333; }
.phase-indicator.upcoming .phase-number { color: #6366f1; }

.phase-title-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}

.phase-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e0e0e0;
}

/* ===== PHASE STATUS BADGES ===== */
.phase-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 100px;
}

.badge-passed {
  background: #0a2a0a;
  color: #4ade80;
  border: 1px solid #1a4a1a;
}

.badge-failed {
  background: #2a0a0a;
  color: #f87171;
  border: 1px solid #4a1a1a;
}

.badge-pending {
  background: #2a2500;
  color: #facc15;
  border: 1px solid #4a4000;
}

.badge-warning {
  background: #2a1a00;
  color: #fb923c;
  border: 1px solid #4a2a00;
}

.badge-locked {
  background: #111111;
  color: #444444;
  border: 1px solid #1a1a1a;
}

.badge-upcoming {
  background: #0a0a1a;
  color: #6366f1;
  border: 1px solid #1a1a3a;
}

/* ===== PHASE BODY ===== */
.phase-body {
  padding: 0 20px 16px 70px;
}

.phase-note {
  font-size: 0.8rem;
  color: #666666;
  line-height: 1.5;
}

/* ===== SCORE GRID ===== */
.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.score-item {
  background: #111111;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  padding: 10px 14px;
}

.score-item.score-main {
  background: #0a1210;
  border-color: #1a2a20;
}

.score-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: #666666;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.score-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #e0e0e0;
}

.score-main .score-value {
  color: #ffffff;
}

.text-green { color: #4ade80 !important; }
.text-red { color: #f87171 !important; }

/* ===== GRADE COLORS ===== */
.grade-a { color: #4ade80 !important; }
.grade-b { color: #facc15 !important; }
.grade-c { color: #fb923c !important; }

/* ===== BREAKDOWN BARS ===== */
.breakdown-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.breakdown-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breakdown-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.breakdown-score {
  font-size: 0.75rem;
  font-weight: 700;
  color: #e0e0e0;
}

.breakdown-bar-bg {
  height: 5px;
  background: #2a2a2a;
  border-radius: 100px;
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  background: #4ade80;
  border-radius: 100px;
  transition: width 0.6s ease;
}

/* ===== FEEDBACK BOX ===== */
.feedback-box {
  margin-top: 14px;
  background: #0f1410;
  border: 1px solid #1a2a1a;
  border-radius: 10px;
  padding: 12px 14px;
}

.feedback-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: #4ade80;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.feedback-text {
  font-size: 0.8rem;
  color: #a0a0a0;
  line-height: 1.6;
}

/* ===== NOT FOUND ===== */
.not-found-card {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

.status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.status-banner.not-found {
  background: #1a0a0a;
  border-bottom: 1px solid #3a1a1a;
  color: #f87171;
}

.status-icon {
  font-size: 1.1rem;
}

.not-found-text {
  padding: 20px;
  font-size: 0.85rem;
  color: #888888;
  line-height: 1.6;
}

.not-found-text strong {
  color: #ffffff;
  font-family: monospace;
}

/* ===== FOOTER ===== */
.footer-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 4px;
  margin-top: 24px;
}

.footer-note svg {
  flex-shrink: 0;
  color: #555555;
  margin-top: 1px;
}

.footer-note p {
  font-size: 0.75rem;
  color: #555555;
  line-height: 1.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  body { padding: 24px; }
  .title { font-size: 1.6rem; }
  .subtitle { font-size: 0.9rem; }
  .phase-body { padding-left: 20px; }
  .score-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .score-item { padding: 8px 10px; }
  .score-value { font-size: 0.95rem; }
  .student-meta { flex-direction: column; gap: 2px; }
  .meta-sep { display: none; }
}
