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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f3f4f6;
  color: #111827;
}

/* Navigation */
.navbar {
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar h1 {
  font-size: 20px;
  font-weight: 700;
}

.navbar a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  opacity: 0.9;
}

.navbar a:hover {
  opacity: 1;
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 32px;
  margin-bottom: 24px;
}

.card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #111827;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #047857, #065f46);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
}

.btn-danger:hover {
  background: #fecaca;
}

.btn-warning {
  background: #fef3c7;
  color: #d97706;
}

.btn-warning:hover {
  background: #fde68a;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

.alert-error {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #d1fae5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.alert-info {
  background: #dbeafe;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th {
  text-align: left;
  padding: 12px 16px;
  background: #f9fafb;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 2px solid #e5e7eb;
}

table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

table tr:hover td {
  background: #f9fafb;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green {
  background: #d1fae5;
  color: #059669;
}

.badge-red {
  background: #fee2e2;
  color: #dc2626;
}

.badge-yellow {
  background: #fef3c7;
  color: #d97706;
}

.badge-blue {
  background: #dbeafe;
  color: #2563eb;
}

.badge-gray {
  background: #f3f4f6;
  color: #6b7280;
}

/* Grid */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 16px;
  }

  .card {
    padding: 20px;
  }
}

/* Stats cards */
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-align: center;
}

.stat-card .stat-value {
  font-size: 36px;
  font-weight: 800;
  color: #059669;
}

.stat-card .stat-label {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

/* Login page */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #059669, #047857);
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-card h1 {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 8px;
}

.login-card p {
  color: #6b7280;
  margin-bottom: 28px;
}

/* Exam timer */
.timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #111827;
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 700;
  font-family: monospace;
}

.timer.warning {
  background: #d97706;
}

.timer.danger {
  background: #dc2626;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Question cards */
.question-card {
  background: white;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid #059669;
}

.question-number {
  font-size: 12px;
  font-weight: 700;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.question-text {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 16px;
  line-height: 1.5;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.option-label:hover {
  border-color: #059669;
  background: #f0fdf4;
}

.option-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #059669;
}

.option-label.selected {
  border-color: #059669;
  background: #f0fdf4;
}

.option-label.correct {
  border-color: #059669;
  background: #d1fae5;
}

.option-label.incorrect {
  border-color: #dc2626;
  background: #fee2e2;
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #047857);
  border-radius: 4px;
  transition: width 0.3s;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal {
  background: white;
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-3 {
  gap: 12px;
}

.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

.text-center {
  text-align: center;
}

.text-gray {
  color: #6b7280;
}

.text-sm {
  font-size: 14px;
}

.font-bold {
  font-weight: 700;
}
