/* WCCA Robotics - Custom Theme */

/* === Variables === */
:root {
  --navy: #1B2A4A;
  --ocean-blue: #2E6DB4;
  --light-blue: #C5E0F0;
  --sand: #E8D5A0;
  --white: #FFFFFF;
  --gray: #6B7B8D;
  --light-gray: #F4F6F8;
  --dark-text: #2C3E50;
  --max-width: 1100px;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--dark-text);
  line-height: 1.6;
  background: var(--white);
}

a { color: var(--ocean-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* === Layout === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Header / Nav === */
.site-header {
  background: var(--navy);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 700;
  padding: 1rem 0;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-logo {
  height: 36px;
  width: auto;
}
.site-title:hover { text-decoration: none; color: var(--light-blue); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  color: var(--light-blue);
  padding: 1rem 0.85rem;
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
  border-radius: 4px 4px 0 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
  text-decoration: none;
}

/* Nav dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--navy);
  list-style: none;
  padding: 0.25rem 0;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  border-radius: 0 0 6px 6px;
  z-index: 200;
}

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

.nav-dropdown-menu a {
  padding: 0.6rem 1rem;
  white-space: nowrap;
  border-radius: 0;
  font-size: 0.9rem;
}

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; padding: 1rem 0; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy);
    padding: 0.5rem 1rem 1rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.75rem 1rem; border-radius: 4px; }

  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    padding: 0;
    min-width: 0;
    display: none;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }
  .nav-dropdown-menu a {
    padding-left: 2rem;
  }

  .page-content img[style*="float"] {
    float: none !important;
    max-width: 100% !important;
    margin: 1rem 0 !important;
  }
}

/* === Hero === */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--ocean-blue) 100%);
  color: var(--white);
  padding: 4rem 1.5rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 800;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 2rem;
  opacity: 0.9;
}

.hero a:not(.btn) {
  color: var(--sand);
  text-decoration: underline;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }
  .hero { padding: 3rem 1.5rem; }
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); text-decoration: none; }

.btn-primary { background: var(--sand); color: var(--navy); }
.btn-secondary { background: transparent; color: var(--white); border: 2px solid var(--white); }
.btn-blue { background: var(--ocean-blue); color: var(--white); }

/* === Team Cards === */
.team-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.team-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}
.team-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }

.team-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: var(--light-gray);
  padding: 1rem;
}

.team-card-body {
  padding: 1.5rem;
}

.team-card h3 {
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.team-number {
  color: #888;
  font-size: 0.85rem;
}

.team-card .badge {
  display: inline-block;
  background: var(--light-blue);
  color: var(--navy);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* === Section styles === */
.section {
  padding: 3rem 0;
}

.section-alt {
  background: var(--light-gray);
}

.section h2 {
  color: var(--navy);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

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

/* === Highlight / Trophy === */
.highlight-box {
  background: linear-gradient(135deg, var(--sand) 0%, #f0e6c8 100%);
  border-left: 4px solid var(--ocean-blue);
  padding: 1.5rem 2rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
}

.highlight-box h3 { color: var(--navy); margin-bottom: 0.5rem; }

/* === Content Pages === */
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-content h1 {
  color: var(--navy);
  font-size: 2rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--ocean-blue);
}

.page-content h2 {
  color: var(--navy);
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.page-content h3 {
  color: var(--ocean-blue);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.page-content p {
  margin-bottom: 1rem;
}

.page-content ul, .page-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.page-content li {
  margin-bottom: 0.4rem;
}

.page-content img {
  border-radius: 8px;
  margin: 1rem 0;
}

/* === Logo display === */
.team-logo {
  max-width: min(400px, 100%);
  margin: 1rem 0;
}

/* === Photo grid === */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  align-items: start;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

/* === Innovation page images === */
.page-content img.portrait {
  max-width: min(400px, 100%);
  display: block;
  margin: 1rem auto;
}

.page-content img.portrait-sm {
  max-width: min(300px, 100%);
  display: block;
  margin: 1rem auto;
}

/* === Video embed === */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1.5rem 0;
  border-radius: 8px;
}

.video-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.video-container-vertical {
  position: relative;
  padding-bottom: 177.78%; /* 9:16 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
}

.video-container-vertical iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .video-grid { grid-template-columns: 1fr; max-width: 400px; margin-left: auto; margin-right: auto; }
}

/* === CTA Section === */
.cta-section {
  background: linear-gradient(135deg, var(--navy) 0%, var(--ocean-blue) 100%);
  color: var(--white);
  padding: 3rem 1.5rem;
  text-align: center;
  margin-top: 2rem;
}

.cta-section h2 { color: var(--white); margin-bottom: 1rem; }
.cta-section p { max-width: 600px; margin: 0 auto 1.5rem; opacity: 0.9; }

/* === Support page cards === */
.support-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

@media (max-width: 768px) {
  .support-grid {
    grid-template-columns: 1fr;
  }
}

.support-card {
  background: var(--white);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.support-card .icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.support-card h3 {
  color: var(--navy);
  margin-bottom: 0.75rem;
}

/* === Tables (tournament match data) === */
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.92rem;
}

.page-content th {
  background: var(--navy);
  color: var(--white);
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  user-select: none;
}

.page-content th.sort-asc::after,
.page-content th.sort-desc::after {
  margin-left: 0.35em;
  font-size: 0.7em;
}

.page-content th.sort-asc::after {
  content: "▲";
}

.page-content th.sort-desc::after {
  content: "▼";
}

.page-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.page-content tbody tr:nth-child(even) {
  background: var(--light-gray);
}

.page-content tbody tr:hover {
  background: var(--light-blue);
}

@media (max-width: 768px) {
  .page-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.82rem;
  }
  .page-content th, .page-content td {
    padding: 0.4rem 0.5rem;
    white-space: nowrap;
  }
}

/* === Team highlight (tournament pages) === */
.team-ref {
  cursor: pointer;
  border-radius: 3px;
  padding: 0 2px;
  transition: background 0.15s;
}

.team-ref:hover {
  background: rgba(232, 213, 160, 0.5);
}

.team-highlight {
  background: #f0a030;
  color: #1B2A4A;
  border-radius: 3px;
}

td.team-cell-highlight {
  background: rgba(240, 160, 48, 0.3) !important;
}

/* === Tournament listing cards === */
.tournament-list {
  display: grid;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.tournament-card {
  background: var(--white);
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--ocean-blue);
  border-radius: 0 8px 8px 0;
  padding: 1.5rem 2rem;
}

.tournament-card h3 {
  color: var(--navy);
  margin: 0 0 0.5rem;
}

.tournament-card h3 a {
  color: var(--navy);
}

.tournament-card p {
  margin-bottom: 0.4rem;
  color: var(--gray);
}

/* === Footer === */
.site-footer {
  background: var(--navy);
  color: var(--light-blue);
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-links a { color: var(--light-blue); }
.footer-links a:hover { color: var(--white); }

.footer-copy {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* === Scouting form === */
.scouting-page {
  padding: 8px 12px;
  margin-bottom: 4px;
  font-size: 11px;
  line-height: 1.4;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.scouting-page h2 {
  font-size: 14px;
  margin: 0 0 6px 0;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--navy);
  color: var(--navy);
}

.scouting-page h3 {
  font-size: 11px;
  margin: 8px 0 3px 0;
  color: var(--ocean-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-row {
  display: flex;
  align-items: baseline;
  padding: 2px 0;
  border-bottom: 1px dotted #ddd;
  gap: 6px;
}
.form-row:last-child { border-bottom: none; }
.form-row:has(+ .form-spacer),
.form-row:has(+ .form-spacer-lg) { border-bottom: none; }

.form-spacer { height: 30px; }
.form-spacer-lg { height: 74px; }

.form-label {
  flex: 0 0 auto;
  font-weight: 600;
  white-space: nowrap;
}

.form-value {
  flex: 1;
  min-width: 0;
}

.form-line {
  border-bottom: 1px solid #999;
  display: inline-block;
}

.form-checks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  white-space: nowrap;
}

.form-divider {
  border: none;
  border-top: 2px solid var(--navy);
  margin: 12px 0;
}
