/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
  --primary-black: #000000;
  --secondary-black: #111111;
  --accent-red: #dc2626;
  --light-red: #ef4444;
  --primary-white: #ffffff;
  --text-gray: #e5e5e5;
  --border-gray: #333333;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Rajdhani', sans-serif;
  background-color: var(--primary-black);
  color: var(--primary-white);
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

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

iframe {
  max-width: 100%;
  width: 100%;
  display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

h1 {
  font-size: 3.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
}

h2 {
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

h3 {
  font-size: 1.8rem;
  font-weight: 600;
}

p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-gray);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
  border-bottom: 2px solid var(--accent-red);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.logo {
  font-family: 'Orbitron', monospace;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent-red);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
}

.logo img {
  height: 80px;
  width: auto;
  transition: all 0.3s ease;
}

.logo:hover img {
  transform: scale(1.05);
}

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

.nav-links a {
  color: var(--primary-white);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  position: relative;
}

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

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--accent-red);
}

/* Mobile Menu */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--primary-white);
  transition: all 0.3s ease;
}

/* Hero Section */
.hero {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-black) 0%, var(--secondary-black) 100%);
  position: relative;
  overflow: hidden;
  padding-top: 120px; /* offset fixed navbar + tall logos */
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23dc2626" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(10px, 10px); }
}

.hero-content {
  text-align: center;
  z-index: 2;
  position: relative;
}

.hero h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, var(--primary-white), var(--accent-red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 20px var(--accent-red); }
  to { text-shadow: 0 0 30px var(--accent-red), 0 0 40px var(--accent-red); }
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  color: var(--text-gray);
}

.cta-button {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--accent-red);
  color: var(--primary-white);
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.cta-button:hover::before {
  left: 100%;
}

.cta-button:hover {
  background: var(--light-red);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(220, 38, 38, 0.3);
}

/* Racing Banner Animation */
.racing-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: linear-gradient(90deg, var(--accent-red), var(--light-red), var(--accent-red));
  animation: racingMove 3s linear infinite;
  opacity: 0.1;
}

@keyframes racingMove {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Section Styles */
.section {
  padding: 5rem 0;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: var(--accent-red);
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 2rem;
}

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

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Cards */
.card {
  background: var(--secondary-black);
  border: 1px solid var(--border-gray);
  border-radius: 10px;
  padding: 2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-red);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.2);
  border-color: var(--accent-red);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--primary-white);
}

.form-control {
  width: 100%;
  padding: 1rem;
  background: var(--secondary-black);
  border: 1px solid var(--border-gray);
  border-radius: 5px;
  color: var(--primary-white);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
}

.form-control::placeholder {
  color: var(--text-gray);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--accent-red);
  color: var(--primary-white);
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 1rem;
}

.btn:hover {
  background: var(--light-red);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(220, 38, 38, 0.3);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--accent-red);
  color: var(--accent-red);
}

.btn-secondary:hover {
  background: var(--accent-red);
  color: var(--primary-white);
}

/* Sponsors Grid */
.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.sponsor-card {
  background: var(--secondary-black);
  border: 1px solid var(--border-gray);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.sponsor-card img {
  margin-bottom: 1rem;
}

.sponsor-card h3,
.sponsor-card p {
  text-align: center;
  width: 100%;
}

.sponsor-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(220, 38, 38, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sponsor-card:hover::before {
  opacity: 1;
}

.sponsor-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
  border-color: var(--accent-red);
}

.sponsor-logo {
  max-width: 100%;
  width: auto;
  max-height: 100px;
  height: auto;
  object-fit: contain;
  margin: 0 auto 1rem;
  display: block;
  transition: all 0.3s ease;
  background: transparent;
  filter: none !important;
  flex-shrink: 0;
}

.sponsor-card:hover .sponsor-logo {
  transform: scale(1.1);
  opacity: 0.9;
}

.sponsor-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.5rem 0;
  color: var(--primary-white);
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.5;
  width: 100%;
  padding: 0 0.5rem;
}

.sponsor-tagline {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin-top: 0.5rem;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
  width: 100%;
  padding: 0 0.5rem;
  box-sizing: border-box;
}

.sponsor-website {
  color: var(--accent-red);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.sponsor-website:hover {
  color: var(--light-red);
}

/* Infinite Sponsors Carousel */
.sponsors-carousel-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  margin: 3rem 0;
  padding: 2rem 0;
  background: var(--secondary-black);
  border-radius: 15px;
  border: 2px solid var(--border-gray);
}

.sponsors-carousel {
  display: flex;
  animation: scrollSponsors 30s linear infinite;
  gap: 3rem;
  align-items: center;
}

.sponsor-slide {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid var(--border-gray);
  transition: all 0.3s ease;
  min-width: 220px;
  height: 140px;
}

.sponsor-slide:hover {
  border-color: var(--accent-red);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

.sponsor-logo-carousel {
  max-width: 200px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: none !important;
  transition: all 0.3s ease;
}

.sponsor-slide:hover .sponsor-logo-carousel {
  transform: scale(1.1);
  opacity: 0.9;
}

@keyframes scrollSponsors {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Responsive adjustments for carousel */
@media (max-width: 768px) {
  .sponsor-slide {
    min-width: 180px;
    height: 120px;
    padding: 1rem 2rem;
  }
  
  .sponsor-logo-carousel {
    max-width: 160px;
    max-height: 100px;
  }
  
  .sponsors-carousel {
    gap: 2rem;
  }
  
  .grid-4 .card-modern {
    min-height: auto;
  }
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  aspect-ratio: 16/9;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid var(--border-gray);
}

.gallery-item:hover {
  border-color: var(--accent-red);
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(220, 38, 38, 0.3), rgba(0, 0, 0, 0.3));
  opacity: 1;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-white);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gallery-item:hover .gallery-overlay {
  background: linear-gradient(45deg, rgba(220, 38, 38, 0.8), rgba(0, 0, 0, 0.8));
  opacity: 1;
}

/* Hierarchical Gallery Styles */
.leadership-card {
  background: linear-gradient(135deg, var(--accent-red), #b91c1c);
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3);
}

.leadership-item {
  border: 3px solid var(--accent-red);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.2);
}

.leadership-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.4);
}

.department-head {
  border: 2px solid var(--accent-red);
  position: relative;
  overflow: hidden;
}

.department-head::before {
  content: "👆";
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5rem;
  z-index: 10;
  opacity: 0;
  transition: all 0.3s ease;
}

.department-head:hover::before {
  opacity: 1;
  transform: scale(1.2);
}

.department-head:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 10px 25px rgba(220, 38, 38, 0.4);
}

.team-member {
  transition: all 0.3s ease;
}

.team-member:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
}

.department-header {
  background: linear-gradient(135deg, var(--secondary-black), var(--accent-red));
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Breadcrumb Styles */
#breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

#breadcrumb button {
  background: linear-gradient(135deg, var(--accent-red), #b91c1c);
  border: none;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

#breadcrumb button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

#back-button button {
  background: transparent;
  border: 2px solid var(--accent-red);
  color: var(--accent-red);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

#back-button button:hover {
  background: var(--accent-red);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

/* Footer */
.footer {
  background: var(--secondary-black);
  border-top: 2px solid var(--accent-red);
  padding: 3rem 0 1rem;
  margin-top: 5rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--accent-red);
  margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
  color: var(--text-gray);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--accent-red);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-gray);
  color: var(--text-gray);
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border-gray);
  border-radius: 50%;
  border-top-color: var(--accent-red);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero {
    padding-top: 100px;
    min-height: calc(100vh - 100px);
  }
  h1 {
    font-size: 3rem;
    line-height: 1.2;
  }
  h2 {
    font-size: 2.2rem;
    line-height: 1.25;
  }
}
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 1.5rem 1rem;
    gap: 0.5rem;
    border-top: 2px solid var(--accent-red);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 1rem;
    width: 100%;
    border-bottom: 1px solid var(--border-gray);
    font-size: 1rem;
  }

  .nav-links a:hover {
    background: rgba(220, 38, 38, 0.1);
    padding-left: 1.5rem;
  }

  .mobile-menu-toggle {
    display: flex;
    z-index: 1001;
  }

  .logo img {
    height: 50px !important;
    max-width: 100%;
  }

  .logo {
    gap: 0.5rem !important;
    flex-wrap: wrap;
  }

  .nav-container {
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
  }

  .hero {
    padding-top: 80px;
    min-height: calc(100vh - 80px);
  }

  .hero h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }

  .hero p {
    font-size: 1.1rem;
    padding: 0 1rem;
  }

  .hero-tagline {
    font-size: 1.1rem;
  }

  h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 2rem;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.5rem;
  }

  .section {
    padding: 3rem 1rem;
  }

  .section-title {
    padding: 0 1rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .sponsors-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

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

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

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

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

  .stat-counter {
    font-size: 3rem;
  }

  .stat-label {
    font-size: 1rem;
  }

  .mission-section {
    padding: 2rem 1rem;
  }

  .card-modern,
  .mission-card,
  .stat-card {
    padding: 1.5rem;
  }

  .cta-button,
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    width: 100%;
    text-align: center;
    display: block;
  }

  .sponsors-carousel-container {
    margin: 2rem 0;
    padding: 1rem 0;
  }

  .sponsor-slide {
    min-width: 150px;
    height: 100px;
    padding: 1rem 1.5rem;
  }

  .sponsor-logo-carousel {
    max-width: 120px;
    max-height: 80px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
    padding: 0 1rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .nav-container {
    padding: 0.5rem 0.75rem;
  }

  .logo img {
    height: 40px !important;
  }

  .section {
    padding: 2rem 0.75rem;
  }

  .section-title h2 {
    font-size: 1.75rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  p {
    font-size: 1rem;
  }

  .stat-counter {
    font-size: 2.5rem;
  }

  .card-modern,
  .mission-card,
  .stat-card {
    padding: 1.25rem;
  }

  .subsystem-icon {
    font-size: 3rem;
  }

  .subsystem-title {
    font-size: 1.3rem;
  }

  .sponsor-slide {
    min-width: 120px;
    height: 90px;
    padding: 0.75rem 1rem;
  }

  .sponsor-logo-carousel {
    max-width: 100px;
    max-height: 70px;
  }

  .footer {
    padding: 2rem 0.75rem 1rem;
  }

  .footer-section h3 {
    font-size: 1.3rem;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .nav-container {
    padding: 0.5rem;
  }

  .logo img {
    height: 35px !important;
  }

  .section {
    padding: 1.5rem 0.5rem;
  }

  .stat-counter {
    font-size: 2rem;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 100px 1rem 2rem;
  }

  .car-page-container {
    padding: 80px 1rem 1rem;
    min-height: auto;
  }
}

/* Prevent text overflow */
@media (max-width: 768px) {
  p, li, span, a {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .nav-links a {
    white-space: nowrap;
  }

  .logo {
    max-width: 100%;
  }
}

/* Fix for tables and wide content */
@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .section {
    overflow-x: hidden;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-red { color: var(--accent-red); }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.hidden { display: none; }
.visible { display: block; }

/* Animation Classes */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.6s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.6s ease;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Modern Statistics Counter */
.stat-counter {
  font-size: 4rem;
  font-weight: 900;
  color: var(--accent-red);
  line-height: 1;
  margin-bottom: 0.5rem;
  font-family: 'Orbitron', monospace;
}

.stat-label {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card {
  text-align: center;
  padding: 2rem;
  background: var(--secondary-black);
  border-radius: 15px;
  border: 2px solid var(--border-gray);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-red), var(--light-red));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-card:hover {
  border-color: var(--accent-red);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

/* Modern Hero with Hashtag */
.hero-tagline {
  font-size: 1.5rem;
  color: var(--accent-red);
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

/* Subsystems/Departments Grid */
.subsystem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.subsystem-card {
  background: var(--secondary-black);
  border: 2px solid var(--border-gray);
  border-radius: 15px;
  padding: 2.5rem;
  text-align: center;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.subsystem-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.subsystem-card:hover::after {
  width: 300px;
  height: 300px;
}

.subsystem-card:hover {
  border-color: var(--accent-red);
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(220, 38, 38, 0.4);
}

.subsystem-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  transition: transform 0.3s ease;
}

.subsystem-card:hover .subsystem-icon {
  transform: scale(1.2) rotate(5deg);
}

.subsystem-title {
  font-size: 1.6rem;
  color: var(--accent-red);
  margin-bottom: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.3;
}

/* Mission Section Modern Style */
.mission-section {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.05), rgba(220, 38, 38, 0.02));
  border-radius: 20px;
  padding: 4rem 2rem;
  margin: 3rem 0;
  border: 2px solid rgba(220, 38, 38, 0.2);
}

.mission-card {
  background: var(--secondary-black);
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--accent-red);
  transition: all 0.3s ease;
}

.mission-card:hover {
  transform: translateX(10px);
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.2);
}

.mission-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

/* Modern Text Effects */
.gradient-text {
  background: linear-gradient(45deg, var(--accent-red), var(--light-red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced Button Styles */
.btn.active {
  background: var(--accent-red);
  color: var(--primary-white);
  border-color: var(--accent-red);
}

/* Modern Section Dividers */
.section-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
  margin: 4rem 0;
  width: 100%;
}

/* Improved Card Hover Effects */
.card-modern {
  background: var(--secondary-black);
  border: 2px solid var(--border-gray);
  border-radius: 15px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Fix tier cards alignment */
.grid-4 .card-modern {
  min-height: 400px;
}

.mascot-tier {
  border-width: 3px !important;
}

.card-modern::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card-modern:hover::before {
  opacity: 1;
}

.card-modern:hover {
  border-color: var(--accent-red);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(220, 38, 38, 0.3);
}

/* Ensure tier cards maintain alignment on hover */
.grid-4 .card-modern:hover {
  transform: translateY(-8px);
}

/* 3D Car Viewer Section */
.car-viewer-container {
  width: 100%;
  max-width: 1200px;
  margin: 3rem auto;
  background: var(--secondary-black);
  border-radius: 20px;
  padding: 2rem;
  border: 2px solid var(--border-gray);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.car-viewer-container:hover {
  border-color: var(--accent-red);
  box-shadow: 0 15px 50px rgba(220, 38, 38, 0.3);
}

.car-viewer-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: 15px;
  background: var(--primary-black);
}

.car-viewer-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 15px;
}

.car-viewer-title {
  text-align: center;
  margin-bottom: 2rem;
}

.car-viewer-title h2 {
  font-size: 2.5rem;
  color: var(--primary-white);
  margin-bottom: 0.5rem;
}

.car-viewer-title p {
  color: var(--text-gray);
  font-size: 1.1rem;
}

/* Alternative: Fixed Height Viewer */
.car-viewer-fixed {
  width: 100%;
  height: 600px;
  border-radius: 15px;
  overflow: hidden;
  background: var(--primary-black);
  border: 2px solid var(--border-gray);
}

.car-viewer-fixed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Responsive adjustments for car viewer */
@media (max-width: 768px) {
  .car-viewer-container {
    padding: 1rem;
  }
  
  .car-viewer-wrapper {
    padding-bottom: 75%; /* Taller aspect ratio on mobile */
  }
  
  .car-viewer-fixed {
    height: 400px;
  }
  
  .car-viewer-title h2 {
    font-size: 2rem;
  }
}

/* Responsive adjustments for stats */
@media (max-width: 768px) {
  .stat-counter {
    font-size: 2.5rem;
  }
  
  .subsystem-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-tagline {
    font-size: 1.2rem;
  }
}