/* ============================================
   FTC Team 19098 - Eastern Foxes
   Responsive Styles (Mobile-First)
   ============================================ */

/* ============================================
   MOBILE STYLES (Default - <768px)
   ============================================ */

/* Mobile Navigation */
@media (max-width: 767px) {
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }

  body {
    padding-top: 60px;
  }

  .navbar-toggle {
    display: flex;
  }

  .navbar-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80vw;
    max-width: 300px;
    height: 100vh;
    background-color: var(--color-nav-bg);
    flex-direction: column;
    padding: var(--space-3xl) var(--space-xl);
    gap: var(--space-lg);
    transition: var(--transition-normal);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    overflow-x: hidden;
  }

  /* Show menu when checkbox is checked */
  #mobile-menu-toggle:checked ~ nav .navbar-menu {
    right: 0;
  }

  .navbar-link {
    font-size: var(--size-h4);
  }

  /* Mobile Grid Adjustments */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Make container flexbox on mobile so all sponsors flow together */
  #sponsors-grid-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  /* Remove the row divs from layout - make them transparent containers */
  #sponsors-grid-row-1,
  #sponsors-grid-row-2,
  #sponsors-grid-row-3,
  #sponsors-grid-row-4 {
    display: contents !important;
  }

  /* 2 sponsors per row */
  #sponsors-grid-row-1 .sponsor-card,
  #sponsors-grid-row-2 .sponsor-card,
  #sponsors-grid-row-3 .sponsor-card,
  #sponsors-grid-row-4 .sponsor-card {
    flex: 0 0 calc((100% - 10px) / 2) !important;
    max-width: calc((100% - 10px) / 2) !important;
  }

  /* 3 sponsors per row for small icons */
  #sponsors-grid-row-5 {
    display: contents !important;
  }

  #sponsors-grid-row-5 .sponsor-card {
    flex: 0 0 calc((100% - 20px) / 3) !important;
    max-width: calc((100% - 20px) / 3) !important;
  }

  /* Mobile Hero */
  .hero {
    height: 70vh;
    min-height: 500px;
    padding: var(--space-xl) var(--space-md);
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-tagline {
    font-size: 20px;
  }

  /* Mobile Statistics - Vertical Stack of Small Squares */
  .stats-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .stat-box {
    width: 120px !important;
    height: 120px !important;
    padding: 60px !important;
    gap: 6px !important;
  }

  .stat-number {
    font-size: 30px !important;
  }

  .stat-label {
    font-size: 10px !important;
  }

  /* Mobile Corner Lines - Maintain Desktop Ratio */
  .hero-corner-tl-outer {
    top: 60px;
    left: 20px;
  }

  .hero-corner-tl-inner {
    top: 40px;
    left: 35px;
  }

  .hero-corner-br-outer {
    bottom: 60px;
    right: 20px;
  }

  .hero-corner-br-inner {
    bottom: 40px;
    right: 35px;
  }

  /* Mobile Sidebar Layout */
  .sidebar-layout {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .sidebar {
    position: static;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  /* Keep sidebar vertical like desktop */
  .sidebar-menu {
    flex-direction: column;
    gap: clamp(8px, 2vw, 12px);
  }

  .sidebar-item {
    width: 100%;
  }

  .sidebar-link {
    text-align: center;
    padding: clamp(10px, 2vw, 12px);
    font-size: clamp(14px, 2vw, 16px);
  }

  /* Resources Page - Single Column on Mobile */
  .resources-main-content {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  /* 3D Model Viewer Mobile Adjustments */
  model-viewer {
    width: 90%;
    max-width: 600px;
    height: 400px;
    min-height: 300px;
    margin: 0 auto;
    display: block;
  }

  /* 3D Model Placeholder Mobile Adjustments */
  .model-placeholder {
    width: 90%;
    max-width: 600px;
    height: 400px;
    min-height: 300px;
    margin: 0 auto;
  }

  .load-model-btn {
    padding: 14px 28px;
    font-size: 14px;
  }

  .loading-spinner {
    font-size: 14px;
  }

  .robot-3d-section {
    margin: 20px auto;
    padding: 0;
    width: 100%;
    max-width: 100%;
    display: block;
  }

  .models-container {
    padding: 0;
    width: 100%;
    max-width: 100%;
  }

  /* Mobile Spacing */
  .section {
    padding: var(--space-xl) 0;
  }

  .container {
    padding: 0 var(--space-md);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Sponsors container needs less padding to fit 2/3 columns */
  #sponsors-grid-container.container {
    padding: 0 8px !important;
  }

  /* Make sure all child elements fit within container */
  .container > * {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Sponsor grids need to be full width with no extra spacing */
  #sponsors-grid-row-1,
  #sponsors-grid-row-2,
  #sponsors-grid-row-3,
  #sponsors-grid-row-4,
  #sponsors-grid-row-5 {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 0 var(--space-lg) 0 !important;
    padding: 0 !important;
  }

  /* Sponsor cards - consistent size and centering on mobile */
  #sponsors-grid-container .sponsor-card {
    box-sizing: border-box !important;
    margin: 0 !important;
    height: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    padding: 16px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  /* Sponsor logos - exact locked size for mobile */
  #sponsors-grid-container .sponsor-logo {
    width: 140px !important;
    height: 80px !important;
    min-width: 140px !important;
    min-height: 80px !important;
    max-width: 140px !important;
    max-height: 80px !important;
    object-fit: contain !important;
    display: block !important;
  }

  /* Mobile Typography */
  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 32px;
  }

  h3 {
    font-size: 24px;
  }

  h4 {
    font-size: 20px;
  }

  /* Mobile Cards */
  .team-card-image {
    width: 100px;
    height: 100px;
  }

  .sponsor-card {
    height: 120px;
    padding: var(--space-lg);
  }

  /* Mobile Footer */
  .footer-social {
    gap: var(--space-lg);
  }

  .footer-social-icon {
    width: 28px;
    height: 28px;
  }
}

/* ============================================
   TABLET STYLES (768px - 1024px)
   ============================================ */

@media (min-width: 768px) and (max-width: 1023px) {
  /* Tablet Grid Adjustments */
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Tablet Navigation */
  .navbar-menu {
    gap: var(--space-lg);
  }

  /* Tablet Hero */
  .hero {
    min-height: 70vh;
  }

  .hero-title {
    font-size: 56px;
  }

  .hero-tagline {
    font-size: 28px;
  }

  /* Tablet Sidebar Layout */
  .sidebar-layout {
    grid-template-columns: 200px 1fr;
    gap: var(--space-xl);
  }

  /* Tablet Typography */
  h1 {
    font-size: 56px;
  }

  h2 {
    font-size: 40px;
  }

  h3 {
    font-size: 28px;
  }
}

/* ============================================
   DESKTOP STYLES (1024px+)
   ============================================ */

@media (min-width: 1024px) {
  /* Desktop Grid Adjustments */
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Desktop Navigation - Always Visible */
  .navbar-toggle {
    display: none;
  }

  .navbar-menu {
    display: flex;
    position: static;
    flex-direction: row;
    width: auto;
    height: auto;
    background: transparent;
    padding: 0;
    box-shadow: none;
  }

  /* Desktop Hero */
  .hero {
    min-height: 80vh;
  }

  /* Desktop Hover Effects Enhancement */
  .team-card:hover {
    transform: scale(1.05) translateY(-5px);
  }

  .sponsor-card:hover {
    transform: scale(1.1) translateY(-5px);
  }

  /* Desktop Sidebar Layout */
  .sidebar-layout {
    grid-template-columns: 250px 1fr;
    gap: var(--space-2xl);
  }
}

/* ============================================
   LARGE DESKTOP STYLES (1200px+)
   ============================================ */

@media (min-width: 1200px) {
  /* Larger Container */
  .container {
    max-width: 1200px;
  }

  /* Larger Hero Typography */
  .hero-title {
    font-size: 72px;
  }

  .hero-tagline {
    font-size: 32px;
  }

  /* Full Typography Scale */
  h1 {
    font-size: 72px;
  }

  h2 {
    font-size: 48px;
  }

  h3 {
    font-size: 32px;
  }

  h4 {
    font-size: 24px;
  }

  /* Enhanced Spacing */
  .section {
    padding: var(--space-3xl) 0;
  }
}

/* ============================================
   EXTRA LARGE DESKTOP (1440px+)
   ============================================ */

@media (min-width: 1440px) {
  /* Maximum Container Width */
  .container {
    max-width: 1400px;
  }

  .content-wide {
    max-width: 1600px;
  }

  /* More generous spacing on large screens */
  .grid {
    gap: var(--space-xl);
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  body::before {
    display: none;
  }

  .navbar,
  .footer,
  .btn {
    display: none;
  }

  * {
    background: white !important;
    color: black !important;
  }
}

/* ============================================
   ACCESSIBILITY - Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
