/* ===== MathCompass Design System ===== */
/* Modern, clean, professional blue theme */

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

body {
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: #1f2937;
  background: #ffffff;
  margin: 0;
  padding: 0;
}

main {
  padding: 60px 10%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== Header & Navigation ===== */
header {
  background: linear-gradient(135deg, #1a0a0a 0%, #7f1d1d 50%, #DC143C 100%);
  color: white;
  padding: 20px 8%;
  box-shadow: 0 2px 20px rgba(15, 23, 42, 0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header h1 {
  margin: 0 0 12px 0;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

header h1 a {
  color: white;
  text-decoration: none;
}

nav {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  margin: 0 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s ease;
}

nav a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

nav a.active {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

/* ===== Typography ===== */
h2 {
  margin-top: 50px;
  margin-bottom: 20px;
  font-size: 28px;
  font-weight: 700;
  color: #1a0a0a;
  letter-spacing: -0.5px;
}

h2:first-child {
  margin-top: 0;
}

h3 {
  margin-top: 30px;
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
}

p {
  margin-bottom: 16px;
  color: #374151;
}

a {
  color: #DC143C;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

a:hover {
  color: #B22222;
  text-decoration: underline;
}

strong {
  color: #1a0a0a;
  font-weight: 600;
}

ul, ol {
  margin-bottom: 16px;
  padding-left: 28px;
}

li {
  margin-bottom: 8px;
  color: #374151;
}

/* ===== Cards Grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  padding: 20px 0;
}

.card {
  display: block;
  padding: 28px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  text-decoration: none;
  color: #1f2937;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(220, 20, 60, 0.12);
  border-color: #fecaca;
  background: #ffffff;
  text-decoration: none;
}

.card h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #1a0a0a;
  font-weight: 600;
}

.card p {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 24px 0;
  font-size: 15px;
  text-align: center;
  background-color: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

th, td {
  border: none;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
}

th {
  background: linear-gradient(135deg, #1a0a0a, #7f1d1d);
  color: white;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  text-transform: none;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background-color: #f8fafc;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, #DC143C, #B22222);
  color: white;
  padding: 14px 36px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(220, 20, 60, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(220, 20, 60, 0.4);
  text-decoration: none;
  color: white;
}

.btn-outline {
  display: inline-block;
  background: white;
  color: #DC143C;
  padding: 14px 36px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border: 2px solid #DC143C;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  background: #DC143C;
  color: white;
  text-decoration: none;
}

/* ===== Hero / Section Titles ===== */
.section-title {
  text-align: center;
  font-size: 36px;
  margin-bottom: 20px;
  color: #1a0a0a;
  font-weight: 700;
  letter-spacing: -0.8px;
}

.section-subtitle {
  text-align: center;
  font-size: 18px;
  color: #64748b;
  max-width: 600px;
  margin: 0 auto 50px;
  line-height: 1.7;
}

/* ===== Highlight Section ===== */
.highlight-section {
  background: #fef2f2;
  padding: 70px 10%;
  margin: 0 -10%;
}

/* ===== Steps ===== */
.steps {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.step {
  flex: 1;
  min-width: 250px;
  background: white;
  padding: 30px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.step:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(220, 20, 60, 0.1);
}

.step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #DC143C, #B22222);
  color: white;
  width: 40px;
  height: 40px;
  text-align: center;
  border-radius: 50%;
  line-height: 40px;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 16px;
}

.step h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #1a0a0a;
}

.step p {
  margin: 0;
  font-size: 15px;
  color: #64748b;
  line-height: 1.6;
}

/* ===== Footer ===== */
footer {
  background: #1a0a0a;
  color: white;
  text-align: center;
  padding: 50px 8%;
  margin-top: 80px;
}

footer h2 {
  color: white;
  font-size: 28px;
  margin-bottom: 12px;
  margin-top: 0;
}

footer p {
  color: #94a3b8;
  font-size: 15px;
  margin: 0;
}

/* ===== Axis / Difficulty Scale (preserved) ===== */
.axis-container {
  width: 80%;
  margin: 50px auto;
}

.axis {
  position: relative;
  height: 6px;
  background: linear-gradient(
    to right,
    #22c55e 0%,
    #eab308 50%,
    #ef4444 100%
  );
  border-radius: 3px;
}

.marker {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: #1a0a0a;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.axis-label {
  position: absolute;
  font-size: 13px;
  color: #475569;
  transform: translateX(-50%);
  white-space: nowrap;
  font-weight: 500;
}

.axis-label.AMC-8-range { left: calc(100%*11/65); top: -30px; }
.axis-label.AMC-10-range { left: calc(100%*24/65); top: -30px; }
.axis-label.AMC-12-range { left: calc(100%*40/65); top: -30px; }
.axis-label.AIME-range { left: calc(100%*45/65); top: -30px; }
.axis-label.Waterloo-Pascal-range { left: calc(100%*10/65); top: 60px; }
.axis-label.Waterloo-Cayley-range { left: calc(100%*18/65); top: -30px; }
.axis-label.Waterloo-Fermat-range { left: calc(100%*33/65); top: 30px; }
.axis-label.UKMT-JMC-range { left: calc(100%*10/65); top: 30px; }
.axis-label.UKMT-IMC-range { left: calc(100%*20/65); top: 30px; }
.axis-label.UKMT-SMC-range { left: calc(100%*32/65); top: -30px; }

.axis-label.AMC-8-1-20-dif { left: calc(100%*4/16); top: -30px; }
.axis-label.AMC-8-21-25-dif { left: calc(100%*7/16); top: -30px; }
.axis-label.AMC-1012-1-20-dif { left: calc(100%*12/16); top: -30px; }
.axis-label.AMC-1012-21-25-dif { left: calc(100%*16/16); top: -30px; }
.axis-label.AIME-1-10-dif { left: calc(100%*12/16); top: -60px; }
.axis-label.AIME-11-15-dif { left: calc(100%*16/16); top: -60px; }
.axis-label.Waterloo-Pascal-AB-dif { left: calc(100%*5/16); top: 30px; }
.axis-label.Waterloo-Pascal-C-dif { left: calc(100%*8/16); top: 30px; }
.axis-label.Waterloo-Cayley-AB-dif { left: calc(100%*7/16); top: -60px; }
.axis-label.Waterloo-Cayley-C-dif { left: calc(100%*10/16); top: 30px; }
.axis-label.Waterloo-Fermat-AB-dif { left: calc(100%*8/16); top: -90px; }
.axis-label.Waterloo-Fermat-C-dif { left: calc(100%*12/16); top: 30px; }
.axis-label.UKMT-JMC-dif { left: calc(100%*5/16); top: 60px; }
.axis-label.UKMT-IMC-dif { left: calc(100%*9/16); top: 60px; }
.axis-label.UKMT-SMC-dif { left: calc(100%*12/16); top: -90px; }

/* ===== Whiteboard / Content Box ===== */
.whiteboard {
  background: white;
  border: 1px solid #e2e8f0;
  padding: 40px;
  width: 90%;
  max-width: 900px;
  margin: 50px auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border-radius: 16px;
}

/* ===== Return Home Button ===== */
.return-home-container {
  text-align: center;
  margin-top: 40px;
}

.return-home-btn {
  padding: 12px 28px;
  font-size: 15px;
  background: linear-gradient(135deg, #DC143C, #B22222);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(220, 20, 60, 0.25);
}

.return-home-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(220, 20, 60, 0.35);
}

/* ===== Nav Auth (user menu) ===== */
.nav-auth {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.nav-user-menu {
  position: relative;
  cursor: pointer;
}

.nav-user-email {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
}

.nav-user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  padding: 8px 0;
  display: none;
  z-index: 100;
  margin-top: 8px;
  border: 1px solid #e2e8f0;
}

.nav-user-menu:hover .nav-user-dropdown {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 10px 18px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.15s;
}

.dropdown-item:hover {
  background: #fef2f2;
  color: #DC143C;
  text-decoration: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  main {
    padding: 30px 5%;
  }

  header {
    padding: 16px 5%;
  }

  header h1 {
    font-size: 20px;
  }

  nav a {
    font-size: 13px;
    margin: 0 4px;
    padding: 5px 10px;
  }

  h2 {
    font-size: 24px;
  }

  .card {
    padding: 20px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 13px;
  }

  th, td {
    padding: 10px 12px;
  }
}

/* ===== Language Toggle ===== */
.nav-auth {
  margin-left: auto;
  display: flex;
  align-items: center;
}

#lang-toggle {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  margin-left: 8px;
}

#lang-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
  #lang-toggle {
    padding: 4px 10px;
    font-size: 12px;
  }
}
