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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  line-height: 1.6;
}

.navbar {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.navbar h1 { font-size: 1.3rem; font-weight: 600; }
.navbar a { color: #a8b2d1; text-decoration: none; margin-left: 1.5rem; transition: color 0.2s; }
.navbar a:hover { color: white; }

.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #1a1a2e;
  border-bottom: 2px solid #e8e8e8;
  padding-bottom: 0.5rem;
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #16213e;
}

/* Forms */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: #333;
}

.form-group .hint {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.3rem;
}

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #0f3460;
}

textarea { resize: vertical; min-height: 80px; }

/* Score slider */
.score-slider {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.score-slider input[type="range"] {
  flex: 1;
  height: 8px;
  -webkit-appearance: none;
  background: #ddd;
  border-radius: 4px;
  outline: none;
  border: none;
  padding: 0;
}

.score-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0f3460;
  cursor: pointer;
}

.score-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f3460;
  min-width: 40px;
  text-align: center;
}

.weight-badge {
  background: #e8f0fe;
  color: #0f3460;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: #0f3460;
  color: white;
}
.btn-primary:hover { background: #1a4a7a; }

.btn-danger {
  background: #e74c3c;
  color: white;
}
.btn-danger:hover { background: #c0392b; }

.btn-success {
  background: #27ae60;
  color: white;
}
.btn-success:hover { background: #219a52; }

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  padding: 0.7rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background: #f8f9fa;
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:hover { background: #f8f9fa; }

/* Ranking */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
}

.rank-1 { background: #ffd700; color: #333; }
.rank-2 { background: #c0c0c0; color: #333; }
.rank-3 { background: #cd7f32; color: white; }
.rank-other { background: #e8e8e8; color: #666; }

.weighted-score {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f3460;
}

/* Login card */
.login-card {
  max-width: 400px;
  margin: 4rem auto;
}

/* Alerts */
.alert {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Stats */
.stats-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  flex: 1;
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-card .number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #0f3460;
}

.stat-card .label {
  color: #666;
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

/* Project selector for judge */
.project-card {
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.project-card:hover { border-color: #0f3460; background: #f8f9ff; }
.project-card.selected { border-color: #0f3460; background: #e8f0fe; }
.project-card.scored { border-color: #27ae60; }
.project-card.scored::after {
  content: ' (scored)';
  color: #27ae60;
  font-weight: 600;
}

.project-card h4 { font-size: 1rem; }
.project-card .team { font-size: 0.85rem; color: #666; }

/* Judge scoring section */
.scoring-section {
  border: 2px solid #0f3460;
  border-radius: 12px;
  padding: 1.5rem;
  background: #fafbff;
}

.scoring-section .criteria-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e8e8e8;
}

.scoring-section .criteria-item:last-of-type {
  border-bottom: none;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal h2 { margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats-row { flex-direction: column; }
  .navbar { flex-direction: column; gap: 0.5rem; }
  table { font-size: 0.85rem; }
  th, td { padding: 0.5rem; }
}

.hidden { display: none; }

/* Hero section */
.hero {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: white;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.hero h2 { font-size: 2rem; margin-bottom: 0.5rem; border: none; color: white; padding: 0; }
.hero p { color: #a8b2d1; font-size: 1.1rem; }

/* Expand/collapse */
.expandable-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.expandable-header .arrow {
  transition: transform 0.2s;
  font-size: 1.2rem;
}

.expandable-header.expanded .arrow {
  transform: rotate(90deg);
}

.expandable-content {
  display: none;
  margin-top: 1rem;
}

.expandable-content.show { display: block; }
