﻿* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Segoe UI, Arial, sans-serif;
  background: linear-gradient(135deg, #0b1220 0%, #111827 55%, #1f2937 100%);
  color: #e5e7eb;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: #111827;
  color: white;
}
.nav a { color: white; text-decoration: none; margin-left: 12px; }
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
}
.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
}
.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.user-chip {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 10px;
}
.container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 20px 40px;
}
.card {
  background: #0f172a;
  border-radius: 18px;
  border: 1px solid #1f2937;
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.45);
  padding: 24px;
  margin-bottom: 20px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.btn {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: #2563eb;
  color: white;
  text-decoration: none;
  cursor: pointer;
}
.btn.secondary { background: #475569; }
.btn.success { background: #059669; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; }
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.success { background: #dcfce7; color: #166534; }
.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  margin-bottom: 14px;
}
.subject-card, .topic-card, .test-card {
  padding: 18px;
  border: 1px solid #334155;
  border-radius: 14px;
  background: #111827;
}
.muted { color: #cbd5e1; }
.question {
  border: 1px solid #475569;
  border-radius: 14px;
  background: #020617;
  padding: 16px;
  margin-bottom: 16px;
}
.question img {
  width: 100%;
  max-width: 860px;
  border-radius: 12px;
  border: 2px solid #64748b;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08), 0 14px 28px rgba(0, 0, 0, 0.45);
}
.placeholder {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 2px dashed #64748b;
  color: #cbd5e1;
  background: #0f172a;
  border-radius: 12px;
  padding: 16px;
}
.footer-note { margin-top: 16px; font-size: 0.95rem; color: #64748b; }

.result-table .result-row {
  border-bottom: 1px solid #334155;
}

.result-table .status-correct {
  background: #052e16;
}

.result-table .status-incorrect {
  background: #450a0a;
}

.result-table .status-unattempted {
  background: #0f172a;
}

table {
  width: 100%;
}

@media (max-width: 768px) {
  .nav {
    padding: 12px 14px;
    align-items: flex-start;
  }

  .brand-link {
    gap: 8px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  .container {
    margin: 12px auto;
    padding: 0 10px 20px;
  }

  .card {
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 12px;
  }

  .question {
    padding: 12px;
  }

  .btn {
    width: 100%;
    text-align: center;
    margin-left: 0;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }

  .nav-links a,
  .nav-links .user-chip {
    margin-left: 0;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .question img {
    max-width: 100%;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  th, td {
    font-size: 12px;
    padding: 8px !important;
  }
}
