/**
 * Lake City Ultrabots Team 8041 - Main CSS
 * Global styling for website components
 * REFACTORED FOR MOBILE-FIRST APPROACH
 */

/* ------------------------------
   VARIABLES AND RESET
------------------------------ */
:root {
  --primary: #cc0000; /* Lake City red */
  --secondary: #000000; /* Black */
  --dark: #333333; /* Dark gray */
  --light: #f8f8f8; /* Light gray/off-white */
  --gray: #6c757d; /* Medium gray */
  --lightgray: #a1a1a1; /* Light gray for backgrounds */
  --darkgray: #616161; /* Dark gray for text */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Arial', sans-serif;
}

body {
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
  font-size: 16px; /* Base font size for rem calculation */
}

/* Screen Reader Only Class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ------------------------------
 LAYOUT & GENERAL COMPONENTS (Mobile Base)
------------------------------ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.container-wide {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 15px;
}

section {
  padding: 40px 0; /* Mobile padding */
}

p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* ------------------------------
 HEADER & MAIN NAVIGATION (Mobile Base)
------------------------------ */
header {
  background-color: var(--secondary);
  color: white;
  padding: 0; /* Padding will be on .header-container */
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 60px; /* Mobile header height */
}

.header-container {
  display: flex;
  justify-content: space-between; /* Pushes logo left, toggle right */
  align-items: center;
  /* max-width will be inherited from .container if this is a child, or set explicitly */
  max-width: 1200px; /* Consistent with .container */
  margin: 0 auto;
  padding: 0 15px; /* Padding for content inside header */
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  margin-right: 8px;
  height: 35px;
  width: auto;
}

.logo h1 {
  margin: 0;
  font-size: 1.2rem;
  white-space: nowrap;
}

/* Mobile Menu Toggle Button */
.menu-toggle {
  display: flex; /* Visible on mobile */
  flex-direction: column;
  justify-content: space-around; /* Better spacing for spans */
  width: 30px; /* Fixed width */
  height: 22px; /* Fixed height */
  cursor: pointer;
  background: none;
  border: none;
  padding: 0; /* Remove padding to rely on width/height for alignment */
  z-index: 1001; /* Ensure toggle is above nav panel when closed */
}

.menu-toggle span {
  height: 3px;
  width: 100%; /* Span takes full width of toggle */
  background: white;
  display: block;
  transition: all 0.3s ease-in-out;
  border-radius: 1px; /* Slight rounding */
  transform-origin: center; /* Animate from center */
}
/* Active state for hamburger to X (JS toggles .active on .menu-toggle) */
.menu-toggle.active span:nth-child(1) {
  transform: translateY(9.5px) rotate(45deg); /* Adjusted for 22px height */
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px); /* Optional: slide out */
}
.menu-toggle.active span:nth-child(3) {
  transform: translateY(-9.5px) rotate(-45deg); /* Adjusted for 22px height */
}


/* Main Navigation Panel (Mobile) */
nav {
  position: absolute;
  top: 60px; /* Below header */
  left: 0;
  right: 0;
  background-color: var(--secondary);
  max-height: 0; /* Collapsed by default */
  overflow: hidden;
  transition: max-height 0.35s ease-out; /* Smoother transition */
  z-index: 999; /* Below toggle when closed, above content */
  border-top: 1px solid rgba(255,255,255,0.05); /* Subtle top border */
}

nav.open { /* Toggled by JS */
  max-height: calc(100vh - 60px); /* Fill available screen height */
  overflow-y: auto; /* Scroll if content exceeds view */
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 1002; /* Ensure it's above toggle when open */
}

nav ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 10px 0;
}

nav ul li {
  position: relative; /* For potential future dropdowns within items */
  margin: 0;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.05); /* Separator */
}
nav ul li:last-child {
  border-bottom: none;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 500; /* Slightly less bold for mobile menu items */
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  padding: 14px 15px; /* Generous tap target */
  display: block;
  width: 100%;
  transition: background-color 0.2s ease, color 0.2s ease;
}
nav ul li a:hover,
nav ul li a.active { /* Mobile hover/active state */
  background-color: rgba(var(--primary-rgb, 204,0,0), 0.2); /* Use primary color with alpha */
  color: #fff;
}
nav ul li a.active {
  font-weight: bold; /* Make active link bolder */
}

/* Desktop Header & Main Navigation Styles */
@media (min-width: 769px) {
  header {
    height: 70px; /* Restore desktop header height */
  }
  .logo img {
    height: 40px;
    margin-right: 10px;
  }
  .logo h1 {
    font-size: 1.5rem;
  }
  .menu-toggle {
    display: none; /* Hide toggle on desktop */
  }
  nav {
    position: static; /* Part of the normal flow on desktop */
    max-height: none;
    overflow: visible;
    background-color: transparent;
    border-top: none;
    box-shadow: none;
    display: block; /* Ensure it's block for flex items inside ul */
  }
  nav.open { /* Reset mobile open states */
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }
  nav ul {
    flex-direction: row; /* Horizontal layout for desktop */
    padding: 0;
    border-bottom: none; /* No item borders */
  }
  nav ul li {
    margin-left: 20px; /* Spacing between desktop nav items */
    text-align: left;
    border-bottom: none;
  }
  nav ul li:first-child {
    margin-left: 0;
  }
  nav ul li a {
    padding: 10px 0; /* Desktop link padding (top/bottom for underline) */
    width: auto; /* Let content define width */
    font-weight: bold; /* Original desktop font-weight */
    background-color: transparent; /* Reset mobile hover */
    position: relative; /* For underline pseudo-element */
  }
  nav ul li a::after { /* Desktop underline effect */
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
  }
  nav ul li a:hover::after,
  nav ul li a.active::after {
    transform: scaleX(1);
    transform-origin: left;
  }
  nav ul li a:hover,
  nav ul li a.active {
    background-color: transparent; /* Ensure no background on hover for desktop */
    color: #ffffff; /* Keep text color consistent */
  }
}


/* ========================================== */
/* SUB-NAVIGATION (Mobile Base)               */
/* ========================================== */
.sub-navigation {
  background-color: var(--dark, #333333);
  padding: 10px 0; /* Mobile padding for the bar itself */
  border-bottom: 3px solid var(--primary);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  width: 100%;
  text-align: center;
  position: relative; /* For mobile dropdown panel positioning */
  min-height: 48px; /* Approximate height for mobile button + padding */
  display: flex;
  align-items: center;
  justify-content: center;
}
.sub-navigation .container { /* This container is inside .sub-navigation */
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative; /* Context for toggle button */
  width: 100%;
}

/* Sub-Navigation Mobile Toggle Button */
.sub-nav-toggle {
    display: block; /* Visible on mobile */
    padding: 8px 15px;
    background-color: #4f4f4f;
    color: white;
    border: 1px solid #777;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    transition: background-color 0.3s, border-color 0.3s;
    z-index: 901; /* Above sub-nav panel when closed */
}
.sub-nav-toggle:hover {
    background-color: #5f5f5f;
    border-color: #888;
}

/* Sub-Navigation Panel (Mobile Dropdown) */
.sub-nav-tabs {
  display: none; /* Hidden by default, JS toggles to flex via .open */
  position: absolute;
  top: calc(100% + 3px); /* Position below the .sub-navigation bar (including its border) */
  left: 0;
  right: 0;
  background-color: var(--dark, #333333);
  z-index: 900; /* Below sub-nav toggle */
  box-shadow: 0 3px 5px rgba(0,0,0,0.15);
  flex-direction: column;
  align-items: stretch;
  gap: 1px; /* Minimal gap, borders will create separation */
  border-top: 1px solid rgba(255,255,255,0.1); /* Separator from bar */

  max-height: 0; /* Collapsed by default */
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  padding: 0 10px; /* Horizontal padding only when closed, vertical added when open */
}
.sub-nav-tabs.open { /* Toggled by JS */
    display: flex; /* Make it visible and flex container */
    max-height: 300px; /* Adjust to fit typical number of items, or use calc */
    padding: 10px; /* Full padding when open */
    overflow-y: auto; /* Scroll if many items */
    z-index: 902; 
}

/* Sub-Navigation Items (Mobile Dropdown) */
.sub-nav-tabs .tab-item {
  padding: 10px 15px;
  color: white;
  background-color: transparent; /* Or slightly different from panel bg */
  border: none; /* No individual borders, use panel border or item bg for separation */
  border-bottom: 1px solid rgba(255,255,255,0.08); /* Subtle item separator */
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
  text-align: center;
  border-radius: 3px; /* Slight rounding for items */
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  display: block; /* Ensure full width */
}
.sub-nav-tabs .tab-item:last-child {
  border-bottom: none;
}
.sub-nav-tabs .tab-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}
.sub-nav-tabs .tab-item.active {
  background-color: var(--primary, #CC0000);
  color: #ffffff;
  border-color: var(--primary, #CC0000); /* Though border is none now */
  font-weight: 600;
}

/* Desktop Sub-Navigation Styles */
@media (min-width: 769px) {
  .sub-navigation {
    padding: 15px 0; /* Restore desktop bar padding */
    height: auto; /* Let content define height */
    min-height: 56px; /* Original min-height */
  }
  .sub-nav-toggle {
    display: none; /* Hide toggle button on desktop */
  }
  .sub-nav-tabs {
    display: flex !important; /* Ensure it's visible and flex (overrides mobile display:none) */
    position: static; /* Reset mobile absolute positioning */
    flex-direction: row; /* Horizontal layout for tabs */
    background-color: transparent;
    padding: 0; /* Reset mobile padding */
    box-shadow: none;
    border-top: none;
    gap: 10px; /* Desktop gap between tabs */
    align-items: center;
    width: auto;
    max-height: none; /* Reset mobile max-height */
    overflow: visible; /* Reset mobile overflow */
  }
  .sub-nav-tabs .tab-item {
    padding: 10px 20px; /* Desktop padding */
    border: 1px solid rgba(255, 255, 255, 0.3); /* Restore desktop border */
    font-size: 0.9rem;
    border-radius: 5px; /* Restore desktop radius */
    border-bottom: 1px solid rgba(255, 255, 255, 0.3); /* Restore original border for consistency */
  }
  .sub-nav-tabs .tab-item:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3); /* Restore original border for consistency */
  }
  .sub-nav-tabs .tab-item.active {
     box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); /* Original desktop active shadow */
  }
}


/* ------------------------------
 BUTTONS & COMMON ELEMENTS (Mobile Base)
------------------------------ */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: all 0.3s;
  border: 2px solid transparent;
  text-align: center;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn:hover {
  background: #a30000;
  border-color: #a30000;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
/* ... other .btn variations ... */

/* ------------------------------
 SECTION HEADERS (Generic - Mobile Base)
------------------------------ */
.section-header {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
}
.section-header h2 {
  color: var(--primary);
  font-size: 1.8rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  font-weight: bold;
}
.section-header p {
  color: var(--gray);
  max-width: 90%;
  margin: 0 auto;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ------------------------------
 STANDARD PAGE HEADERS (Mobile Base)
------------------------------ */
.page-header {
  background-color: var(--secondary);
  color: white;
  padding: 30px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
/* ... .page-header::before, .page-header::after, .page-header h1, .page-header p mobile styles ... */
.page-header::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background-color: rgba(204, 0, 0, 0.7); z-index: 3; }
.page-header::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 1;}
.page-header .container { position: relative; z-index: 2; padding: 0 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.page-header h1 { margin: 0 0 10px 0; font-size: 1.8rem; text-transform: uppercase; max-width: 95%; }
.page-header p { font-size: 1rem; max-width: 90%; margin: 0 auto; }


/* ------------------------------
 FOOTER (Mobile Base)
------------------------------ */
/* ... red-sponsors-bar and its children mobile styles ... */
.red-sponsors-bar { background-color: var(--secondary); padding: 15px 0; position: relative; border-bottom: 3px solid rgba(204, 0, 0, 0.7); text-align: center; }
.red-sponsors-flex { display: flex; flex-direction: column; align-items: center; gap: 20px; max-width: 90%; margin: 0 auto; padding: 0 15px; }
.red-sponsors-heading { position: relative; border-left: none; border-bottom: 2px solid var(--primary); padding-bottom: 10px; text-align: center; width: auto; padding-left: 0;}
.red-sponsors-heading h3 { font-size: 1rem; font-weight: bold; color: white; margin: 0; text-transform: uppercase; letter-spacing: 1px; background-image: linear-gradient(90deg, rgba(32, 32, 255, 0.1) 0%, rgba(255, 80, 80, 0.7) 25%, rgba(255, 255, 255, 0.9) 50%, rgba(255, 80, 80, 0.7) 75%, rgba(32, 32, 255, 0.1) 100%); background-size: 200% auto; background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: blueShine 3s linear infinite; }
@keyframes blueShine { 0% { background-position: 0% center; } 100% { background-position: 200% center; } }
.red-sponsors-logos { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; justify-content: center; }
.footer-sponsor-logo {
  width: 110px; 
  height: 70px; 
  display: block;
  background-color: white;
  border-radius: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  overflow: hidden;
  position: relative;
}
.footer-sponsor-logo a {
  display: block;
  width: 100%;
  height: 100%;
  padding: 5px; 
}
.footer-sponsor-logo.bc-pizza { background-image: url('../images/sponsors/bc-pizza-logo-2x.png'); }
.footer-sponsor-logo.haas { background-image: url('../images/sponsors/haas.jpg'); }
.footer-sponsor-logo:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.footer-sponsor-logo.placeholder { border: 2px dashed rgba(255,255,255,0.3); background-color: rgba(255,255,255,0.1); background-image: none; display: flex; align-items: center; justify-content: center; }
.footer-sponsor-logo.placeholder .placeholder-text { color: rgba(255,255,255,0.8); font-size: 0.7rem; text-align: center; padding: 5px; }
.footer-sponsor-cta { display: flex; align-items: center; width: 100%; justify-content: center; }
.sponsor-btn { background-color: rgba(255,255,255,0.15); color: white; padding: 8px 12px; border-radius: 4px; font-size: 0.8rem; text-decoration: none; transition: all 0.3s ease; border: 1px solid rgba(255,255,255,0.3); white-space: nowrap; }
.sponsor-btn:hover { background-color: rgba(255,255,255,0.25); transform: translateY(-2px); }

/* ... main footer content mobile styles ... */
footer { background-color: var(--secondary); color: white; padding: 0 0 15px 0; margin-top: 0; }
.footer-main { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; margin-bottom: 20px; }
.footer-column { flex: 1; min-width: 100%; margin-bottom: 20px; }
.footer-column h3 { font-size: 1rem; margin-bottom: 10px; font-weight: 600; letter-spacing: 0.5px; position: relative; padding-bottom: 6px; }
.footer-column h3::after { content: ''; position: absolute; left: 0; bottom: 0; width: 30px; height: 2px; background-color: rgba(255,255,255,0.3); }
.about-column .tagline { line-height: 1.6; margin-bottom: 10px; font-size: 0.9rem; }
.team-links { margin-top: 10px; }
.blue-alliance-link { display: inline-block; color: white; text-decoration: none; padding: 6px 0; position: relative; font-size: 0.85rem; transition: all 0.3s ease; }
.blue-alliance-link:before { content: ''; position: absolute; bottom: 2px; left: 0; right: 0; height: 1px; background-color: rgba(255,255,255,0.4); transition: all 0.3s ease; }
.blue-alliance-link:hover { color: #9b9fa1; }
.blue-alliance-link:hover:before { background-color: #3498db; height: 2px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { color: white; text-decoration: none; transition: opacity 0.3s; position: relative; padding-left: 12px; font-size: 0.9rem; }
.footer-links a:before { content: '›'; position: absolute; left: 0; font-size: 1.1rem; line-height: 1; }
.footer-links a:hover { opacity: 0.8; }
.contact-info { list-style: none; padding: 0; margin: 0; }
.contact-info li { margin-bottom: 10px; display: flex; align-items: flex-start; font-size: 0.9rem; }
.contact-icon { display: inline-block; width: 18px; text-align: center; margin-right: 8px; opacity: 0.9; font-size: 1rem; line-height: 1.3; }
.email-icon:before { content: '✉'; } .phone-icon:before { content: '☎'; } .location-icon:before { content: '⌖'; }
.contact-info a { color: white; text-decoration: none; transition: opacity 0.3s; word-break: break-word; }
.contact-info a:hover { opacity: 0.8; }
.footer-bottom { display: flex; flex-direction: column; justify-content: center; align-items: center; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; text-align: center; gap: 8px; }
.copyright, .school-link { width: auto; text-align: center; }
.copyright p { margin-bottom: 0; }
.school-link a { color: white; text-decoration: none; opacity: 0.7; transition: opacity 0.3s; }
.school-link a:hover { opacity: 1; text-decoration: underline; }


/* ------------------------------
 RESPONSIVE OVERRIDES FOR DESKTOP
------------------------------ */
@media (min-width: 769px) {
  .container-wide { padding: 0 20px; } 
  section { padding: 60px 0; } 
  .btn { padding: 12px 24px; font-size: 1rem; }

  /* SECTION HEADERS (Desktop) */
  .section-header { margin-bottom: 40px; }
  .section-header h2 { font-size: 2rem; margin-bottom: 15px; }
  .section-header p { max-width: 700px; font-size: 1rem; }

  /* STANDARD PAGE HEADERS (Desktop) */
  .page-header { padding: 40px 0; }
  .page-header h1 { font-size: 2.5rem; }
  .page-header p { font-size: 1.1rem; max-width: 800px; }

  /* FOOTER (Desktop) */
  .red-sponsors-flex {
    flex-direction: row;
    justify-content: space-between; /* MODIFIED: Was center, distributes heading, logos, CTA */
    align-items: center; /* Added for vertical alignment of children */
    gap: 20px; /* MODIFIED: Was 40px, adjusts space between heading, logos, CTA */
    max-width: 1100px; /* MODIFIED: Was 800px, makes the whole section wider */
    margin: 0 auto; /* Added to center .red-sponsors-flex if its parent is wider */
    text-align: left; /* Keeps text within children left-aligned if not overridden */
  }
  .red-sponsors-heading {
    border-left: 3px solid var(--primary);
    padding-left: 15px;
    border-bottom: none;
    padding-bottom: 0;
    text-align: left;
    flex: 0 0 auto; /* Ensures it doesn't grow or shrink excessively */
    width: auto;
  }
  .red-sponsors-heading h3 { font-size: 1.1rem; }

  .red-sponsors-logos {
    display: flex; /* Ensures it's a flex container for the logos */
    justify-content: center; /* Centers the group of logos in their allocated space */
    align-items: center;
    flex-wrap: nowrap;
    gap: 30px; /* MODIFIED: Was 20px, increases space between individual logos */
    flex-grow: 1; /* Allows this section to take available space in the middle */
  }
  .footer-sponsor-logo {
    width: 180px; /* MODIFIED: Was 150px */
    height: 100px; /* MODIFIED: Was 90px */
  }
  .footer-sponsor-logo.placeholder .placeholder-text { font-size: 0.8rem; }
  
  .footer-sponsor-cta {
    width: auto; /* MODIFIED: Overrides mobile's width: 100% */
    /* display: flex and align-items: center are inherited from mobile, which is fine */
    justify-content: flex-end; /* Aligns button to the right if CTA has more space than button */
  }
  .sponsor-btn { font-size: 0.85rem; }


  .footer-main { flex-direction: row; justify-content: space-between; gap: 30px; }
  .footer-column { flex: 1; min-width: 200px; margin-bottom: 0; }
  .about-column { flex: 2; max-width: 400px; }
  .footer-column h3 { font-size: 1.1rem; margin-bottom: 15px; padding-bottom: 8px; }
  .footer-column h3::after { width: 40px; }
  .about-column .tagline { font-size: 1rem; margin-bottom: 15px; }
  .blue-alliance-link { padding: 8px 0; font-size: 0.9rem; }

  .footer-links li { margin-bottom: 8px; }
  .footer-links a {
    padding-left: 20px; 
    font-size: 1rem;
  }
  .footer-links a:before {
    font-size: 1.5rem; 
    
  }

  .contact-info li {
    margin-bottom: 12px;
    font-size: 1rem;
  }
  .contact-icon {
    width: 25px; 
    margin-right: 10px;
    font-size: 1.4rem; 
    line-height: 1.5; 
  }
  .footer-bottom { font-size: 0.9rem; }
}
@media (min-width: 993px) { 
  .page-header h1 { font-size: 2.2rem; }
  .page-header p { font-size: 1.05rem; }
  .tab-item { padding: 10px 15px; font-size: 0.85rem; }
}

@media (min-width: 1025px) { 
   .container-wide { max-width: 1600px; padding: 0 30px; }
}