/* ==============================
   COLOR PALETTE
   ============================== */
:root {
  --primary-gold: #d4af37;
  --dark-brown: #3a2f28;
  --light-brown: #6b5344;
  --black: #1a1a1a;
  --cream: #f5f1e8;
  --light-cream: #faf8f3;
  --accent-gold: #e6c750;
  --shadow-dark: rgba(26, 26, 26, 0.15);
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==============================
   GLOBAL STYLES
   ============================== */
* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--light-cream);
  color: var(--dark-brown);
  line-height: 1.7;
  margin: 0;
  padding: 0;
  letter-spacing: 0.3px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--black);
  font-weight: 600;
  letter-spacing: 0.5px;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-bottom: 30px; }
h3 { font-size: 1.5rem; }

/* ==============================
   ANIMATIONS
   ============================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7); }
  50% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

/* ==============================
   BUTTONS
   ============================== */
.btn {
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  border: none;
  transition: var(--transition-smooth);
  display: inline-block;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.btn.primary {
  background: linear-gradient(135deg, var(--dark-brown) 0%, var(--light-brown) 100%);
  color: var(--primary-gold);
  border: 2px solid var(--dark-brown);
  box-shadow: 0 4px 15px var(--shadow-dark);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow-dark);
  background: linear-gradient(135deg, var(--light-brown) 0%, var(--dark-brown) 100%);
}

.btn.primary:active {
  transform: translateY(0);
}

.btn.outline {
  border: 2px solid var(--dark-brown);
  color: var(--dark-brown);
  background: transparent;
}

.btn.outline:hover {
  background: var(--dark-brown);
  color: var(--primary-gold);
  transform: translateY(-2px);
}

.btn.gold {
  background: var(--primary-gold);
  color: var(--black);
  border: 2px solid var(--primary-gold);
}

.btn.gold:hover {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

/* ==============================
   CARDS
   ============================== */
.card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 12px var(--shadow-dark);
  border-left: 4px solid var(--primary-gold);
  transition: var(--transition-smooth);
  animation: slideInUp 0.6s ease-out;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px var(--shadow-dark);
  border-left-color: var(--accent-gold);
}

.card-header {
  border-bottom: 2px solid var(--primary-gold);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.card-header h3 {
  margin: 0;
  color: var(--dark-brown);
}

/* ==============================
   GRID LAYOUTS
   ============================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

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

/* ==============================
   ALERTS
   ============================== */
.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin: 15px 0;
  border-left: 4px solid;
  animation: slideInDown 0.4s ease-out;
}

.alert.info {
  background: rgba(212, 175, 55, 0.1);
  color: var(--dark-brown);
  border-left-color: var(--primary-gold);
}

.alert.success {
  background: rgba(107, 83, 68, 0.1);
  color: var(--dark-brown);
  border-left-color: var(--light-brown);
}

.alert.error {
  background: rgba(200, 100, 100, 0.1);
  color: #8b4545;
  border-left-color: #c86464;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark-brown);
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition-smooth);
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-group input::placeholder {
  color: #999;
}

/* ==============================
   AUTH PAGES
   ============================== */
.auth-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--light-cream) 0%, #ede5d9 100%);
}

.auth-box {
  background: white;
  padding: 40px 35px;
  border-radius: 12px;
  box-shadow: 0 8px 32px var(--shadow-dark);
  max-width: 420px;
  width: 100%;
  border-top: 3px solid var(--primary-gold);
  animation: slideInUp 0.6s ease-out;
}

.auth-box h2 {
  color: var(--dark-brown);
  text-align: center;
  margin-bottom: 30px;
}

.auth-link {
  text-align: center;
  margin-top: 20px;
}

.auth-link a {
  color: var(--dark-brown);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid var(--primary-gold);
  transition: var(--transition-smooth);
}

.auth-link a:hover {
  color: var(--primary-gold);
}

.auth-description {
  color: var(--light-brown);
  text-align: center;
  margin-bottom: 30px;
  font-size: 1rem;
}

.loading-status {
  margin-top: 20px;
  text-align: center;
  display: none;
  color: var(--dark-brown);
  font-size: 0.95rem;
  animation: slideInUp 0.4s ease-out;
}

.loading-text-main {
  margin-bottom: 8px;
  font-weight: 500;
}

.loading-text-sub {
  font-size: 0.85rem;
  color: var(--light-brown);
  opacity: 0.8;
}

/* ==============================
   UTILITY CLASSES
   ============================== */
.full-width { width: 100%; }
.mt-2 { margin-top: 20px; }
.mt-5 { margin-top: 50px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.text-center { text-align: center; }

.icon {
  width: 50px;
  height: 50px;
  margin-bottom: 10px;
}

.school-list,
.student-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.school-list li,
.student-list li {
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
  transition: var(--transition-smooth);
}

.school-list li:hover,
.student-list li:hover {
  background: var(--light-cream);
  padding-left: 20px;
}

.search-bar {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.search-bar:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* ==============================
   HEADER
   ============================== */
header {
  background: linear-gradient(135deg, var(--dark-brown) 0%, var(--light-brown) 100%);
  color: white;
  padding: 15px 0;
  box-shadow: 0 2px 8px var(--shadow-dark);
  animation: slideInDown 0.5s ease-out;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 1px;
  color: var(--primary-gold);
}

header nav {
  display: flex;
  gap: 25px;
  align-items: center;
}

header nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
  position: relative;
}

header nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-gold);
  transition: width 0.3s ease;
}

header nav a:hover::after {
  width: 100%;
}

header nav a.active {
  color: var(--primary-gold);
  font-weight: 700;
}

/* ==============================
   HERO SECTION
   ============================== */
.hero {
  background: linear-gradient(135deg, var(--dark-brown) 0%, var(--light-brown) 100%);
  color: var(--light-cream);
  padding: 120px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  color: var(--primary-gold);
  animation: slideInUp 0.8s ease-out;
  letter-spacing: 1px;
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 40px;
  animation: slideInUp 1s ease-out;
  color: var(--light-cream);
}

.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 30px 0;
  animation: slideInUp 1.2s ease-out;
  flex-wrap: wrap;
}

.deadline-notice {
  font-size: 1.1rem;
  color: var(--accent-gold);
  font-weight: 600;
  animation: slideInUp 1.4s ease-out;
}

/* ==============================
   FEATURES SECTION
   ============================== */
.features {
  padding: 60px 0;
  animation: fadeIn 0.8s ease-out;
}

.features h2 {
  position: relative;
  padding-bottom: 20px;
}

.features h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--primary-gold);
}

/* ==============================
   FOOTER
   ============================== */
footer {
  background: linear-gradient(135deg, var(--dark-brown) 0%, var(--light-brown) 100%);
  color: var(--light-cream);
  padding: 40px 0;
  text-align: center;
  margin-top: 60px;
  border-top: 3px solid var(--primary-gold);
}

footer p {
  margin: 10px 0;
}

.footer-links {
  display: flex;
  gap: 25px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--primary-gold);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.footer-links a:hover {
  color: var(--accent-gold);
  text-decoration: underline;
}

/* ==============================
   SECTION STYLES
   ============================== */
.section-content {
  margin-top: 30px;
}

.section-description {
  color: var(--light-brown);
  font-size: 1.05rem;
  margin-bottom: 30px;
}

.loading-text {
  text-align: center;
  color: var(--light-brown);
  padding: 40px 20px;
  font-size: 1.1rem;
}

/* ==============================
   TOP STUDENTS TABLE
   ============================== */
.top-students-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow-dark);
}

.top-students-table thead {
  background: linear-gradient(135deg, var(--dark-brown) 0%, var(--light-brown) 100%);
  color: white;
}

.top-students-table th {
  padding: 15px 20px;
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.top-students-table td {
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--dark-brown);
}

.top-students-table tbody tr {
  transition: var(--transition-smooth);
}

.top-students-table tbody tr:hover {
  background: var(--light-cream);
}

.rank-cell {
  font-weight: 600;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--dark-brown) 0%, var(--light-brown) 100%);
  color: var(--primary-gold);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
}

.score-cell {
  font-weight: 700;
  color: var(--light-brown);
}

.features-alt {
  background: linear-gradient(135deg, var(--light-cream) 0%, #ede5d9 100%);
}

/* ==============================
   GRID LAYOUTS
   ============================== */
.finalists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.schools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
}

.school-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow-dark);
  transition: var(--transition-smooth);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-top: 3px solid var(--primary-gold);
}

.school-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px var(--shadow-dark);
}

.school-card-image-wrapper {
  width: 100%;
  height: 150px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--light-cream) 0%, #ede5d9 100%);
}

.school-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.school-card:hover .school-card-image {
  transform: scale(1.05);
}

.school-card-no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-brown);
}

.school-card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.school-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--dark-brown);
  margin: 0 0 12px 0;
}

.school-card-location {
  color: var(--light-brown);
  font-size: 0.95rem;
  margin: 8px 0;
}

.school-card-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.school-card-stat {
  text-align: center;
  flex: 1;
}

.school-card-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-brown);
  display: block;
}

.school-card-stat-label {
  font-size: 0.75rem;
  color: var(--light-brown);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.school-card-action {
  margin-top: 12px;
  text-align: center;
  color: var(--primary-gold);
  font-weight: 600;
  font-size: 0.85rem;
}

/* ==============================
   FINALIST CARD
   ============================== */
.finalist-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid var(--primary-gold);
  box-shadow: 0 2px 12px var(--shadow-dark);
  transition: var(--transition-smooth);
}

.finalist-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--shadow-dark);
  border-left-color: var(--accent-gold);
}

.finalist-school-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark-brown);
  border-bottom: 2px solid var(--primary-gold);
  padding-bottom: 12px;
  margin: 0 0 15px 0;
}

.finalist-pair {
  display: flex;
  gap: 20px;
}

.finalist-slot {
  flex: 1;
}

.finalist-label {
  font-size: 0.75rem;
  color: var(--light-brown);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 5px;
}

.finalist-name {
  font-size: 1rem;
  color: var(--dark-brown);
  font-weight: 600;
}

.finalist-empty {
  color: var(--light-brown);
  font-size: 0.9rem;
}

/* ==============================
   CUSTOM ASSETS SECTIONS
   ============================== */
.hero-banner-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--dark-brown) 0%, var(--light-brown) 100%);
}

.hero-banner-wrapper {
  position: relative;
  width: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-banner-image {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  animation: fadeIn 0.8s ease-out;
}

.hero-default {
  text-align: center;
  color: var(--light-cream);
  padding: 60px 20px;
  position: relative;
  z-index: 1;
  animation: slideInUp 0.8s ease-out;
}

.hero-default h1 {
  font-size: 3rem;
  color: var(--primary-gold);
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.hero-default p {
  font-size: 1.2rem;
  color: var(--light-cream);
}

.org-section {
  padding: 60px 20px;
  background: white;
  animation: fadeIn 0.8s ease-out;
}

.org-content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 50px;
  align-items: start;
}

.org-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.org-logo {
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow-dark);
  animation: slideInLeft 0.6s ease-out;
}

.org-info-container {
  padding: 20px;
  animation: slideInRight 0.6s ease-out;
}

.org-info-container h2 {
  color: var(--dark-brown);
  font-size: 2rem;
  margin-top: 0;
}

.org-description {
  color: var(--light-brown);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 20px;
}

.org-info-container h3 {
  color: var(--dark-brown);
  font-size: 1.3rem;
  margin-top: 30px;
  margin-bottom: 15px;
}

.org-mission {
  color: var(--light-brown);
  font-size: 1rem;
  line-height: 1.8;
  font-style: italic;
  border-left: 4px solid var(--primary-gold);
  padding-left: 20px;
}

.org-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.illustrations-section {
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--light-cream) 0%, #ede5d9 100%);
  animation: fadeIn 0.8s ease-out;
}

.illustrations-section h2 {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 20px;
}

.illustrations-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--primary-gold);
}

.illustrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  max-width: 1200px;
  margin: 0 auto;
}

.illustration-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow-dark);
  transition: var(--transition-smooth);
  animation: slideInUp 0.6s ease-out;
}

.illustration-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px var(--shadow-dark);
}

.illustration-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.illustration-card:hover .illustration-image {
  transform: scale(1.05);
}

/* ==============================
   RESPONSIVE ADJUSTMENTS
   ============================== */
@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.2rem; }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .finalists-grid,
  .schools-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 80px 20px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 15px;
  }

  header nav {
    gap: 15px;
    font-size: 0.9rem;
  }

  header .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .finalist-pair {
    flex-direction: column;
    gap: 15px;
  }
}
