/* ======================================================
   🌐 UNIVERSAL RESPONSIVE FIXES
   Works for Mobile (≤600px), Tablet (601–991px), Desktop (≥992px)
====================================================== */

/* ----------- Mobile: up to 600px ----------- */
@media (max-width: 600px) {

  /* General text and spacing */
  body {
    font-size: 0.9rem;
    padding: 0;
    overflow-x: hidden;
  }

  * {
    box-sizing: border-box;
  }

  .container {
    padding: 0 16px;
    max-width: 100%;
  }

  .section {
    padding: 40px 16px;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 20px;
  }

  .bits-title {
    font-size: 2.2rem;
    line-height: 1.2;
  }

  .hero-section {
    min-height: 90vh;
    background-position: center;
    background-attachment: scroll; /* Better performance on mobile */
  }

  .hero-center {
    padding: 24px 16px;
    gap: 16px;
  }

  .hero-text {
    font-size: 1rem;
    line-height: 1.5;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .btn, .btn-ticket {
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    font-size: 1rem;
  }

  /* Event Trailer */
  #eventVideo {
    padding: 0;
    margin: 0;
  }

  .eventTrailer {
    padding: 20px 16px;
  }

  .trailer-inner {
    padding: 0;
  }

  .trailer-inner h2 {
    font-size: 1.6rem;
    margin: 0 0 12px 0;
  }

  .trailer-player {
    max-width: 100%;
    width: 100%;
  }

  .trailer-player video {
    border-radius: 8px;
  }

  /* Mobile Header */
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    border-radius: 0;
    transform: none;
    background: rgba(11, 15, 20, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1200;
  }

  .site-header.compact {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 12px 16px;
    transform: none;
    border-radius: 0;
  }

  .site-header .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .site-header .logo {
    height: 40px;
  }

  .site-header.compact .logo {
    height: 40px;
  }

  /* Hamburger Menu Button */
  .hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1300;
    position: relative;
  }

  .hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
  }

  .hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
  }

  .hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  /* Mobile Navigation */
  .top-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    width: 100%;
    height: 0;
    overflow: hidden;
    flex-direction: column;
    gap: 0;
    background: rgba(11, 15, 20, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    transition: height 0.3s ease;
    z-index: 1100;
  }

  .top-nav.active {
    height: auto;
    padding: 20px 0;
  }

  .top-nav a {
    display: block;
    width: 100%;
    padding: 16px 24px;
    font-size: 1.1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 212, 255, 0.05);
    transition: all 0.3s ease;
  }

  .top-nav a:hover {
    background-color: rgba(0, 212, 255, 0.1);
    padding-left: 32px;
  }

  .top-nav .nav-cta {
    margin: 16px 24px;
    width: calc(100% - 48px);
    text-align: center;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
  }

  /* Hide compact hover effects on mobile */
  .site-header.compact:hover {
    width: 100%;
    left: 0;
    top: 0;
    padding: 12px 16px;
  }

  /* Headliners Section */
  .headliners {
    padding: 40px 16px;
  }

  .headliner-layout {
    flex-direction: column;
    gap: 32px;
  }

  .headliner-title {
    width: 100%;
    text-align: center;
    align-items: center;
    padding: 0;
  }

  .headliner-title .hl-top {
    font-size: 2.4rem !important;
    line-height: 1.2;
    word-break: keep-all;
  }

  .headliner-title .hl-bottom {
    font-size: 1.4rem !important;
    line-height: 1.2;
    word-break: keep-all;
  }

  .headliner-grid {
    width: 100%;
  }

  /* Cards layout → single column */
  .headliner-placeholder {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0;
  }

  .card {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 300px;
  }

  .card-content {
    padding: 16px;
  }

  .card-title {
    font-size: 1.4rem;
  }

  .card-description {
    font-size: 0.9rem;
  }

  /* Side Layout - General fix for all sections */
  .side-layout {
    flex-direction: column !important;
    gap: 24px;
  }

  .side-layout .side-title {
    width: 100% !important;
    text-align: center;
    padding: 0 16px;
  }

  .side-layout .side-content {
    width: 100% !important;
    padding: 0;
  }

  /* About & Reach grids → stacked */
  .about-grid,
  .reach-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }

  .about-text,
  .reach-text {
    font-size: 1rem;
    line-height: 1.6;
    padding: 0;
  }

  .about-image,
  .reach-image {
    max-width: 100%;
    margin: 0 auto;
  }

  /* Experiences Section */
  .experiences {
    padding: 40px 16px;
  }

  .experiences .side-layout {
    flex-direction: column;
    gap: 32px;
  }

  .experiences .side-title {
    width: 100%;
    text-align: center;
    align-items: center;
    padding: 0;
  }

  .experiences .hl-top {
    font-size: 2.2rem !important;
    line-height: 1.2;
    word-break: keep-all;
    white-space: nowrap;
  }

  .experiences .hl-bottom {
    font-size: 1.6rem !important;
    line-height: 1.2;
    word-break: keep-all;
    white-space: nowrap;
  }

  .experiences .side-content {
    width: 100%;
  }

  /* Experiences grid → single column */
  .experiences-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .exp-item {
    height: 220px;
    transform: translateY(0) !important;
    margin: 0 auto;
    width: 100%;
  }

  .exp-content {
    padding: 16px;
  }

  .exp-title {
    font-size: 1.2rem;
  }

  .exp-description {
    font-size: 0.85rem;
  }

  /* Sponsors */
  .sponsors {
    padding: 40px 16px;
  }

  .sponsors .section-title {
    font-size: 2.4rem;
    margin-bottom: 32px;
  }

  .sponsors-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 100%;
    padding: 0;
  }

  .sponsor {
    min-height: 140px;
    padding: 20px;
    width: 100%;
  }

  .sponsor img {
    height: 80px;
    max-width: 100%;
    object-fit: contain;
  }

  /* Footer */
  .footer {
    padding: 32px 16px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .footer-img {
    width: 60%;
    max-width: 200px;
  }

  .footer-links {
    flex-direction: column;
    gap: 12px;
  }

  .footer-text {
    font-size: 0.85rem;
  }

  /* Popups */
  .event-popup {
    padding: 20px;
  }

  .event-popup .popup-content {
    width: 95%;
    max-width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.5rem;
    margin: 0;
  }

  .popup-title {
    font-size: 1.5rem;
  }

  .popup-description {
    font-size: 0.9rem;
  }

  .close-popup {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
  }

  /* Join section */
  .join-section {
    padding: 40px 16px;
  }

  .join-grid {
    flex-direction: column;
    gap: 24px;
    width: 100%;
  }

  .join-card {
    width: 100%;
    padding: 24px;
  }

  .connectlogos {
    height: 32px;
    width: 32px;
  }

  /* Forms */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea,
  select {
    width: 100%;
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px;
  }

  /* Tables */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Images */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Videos */
  video {
    max-width: 100%;
    height: auto;
  }

  /* Prevent horizontal scroll */
  .container,
  .section,
  .grid {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Touch-friendly spacing */
  a, button {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ----------- Tablet: 601px–991px ----------- */
@media (min-width: 601px) and (max-width: 991px) {

  body {
    font-size: 1rem;
  }

  /* Header adjustments for tablet */
  .site-header {
    width: calc(100% - 32px);
    padding: 14px 20px;
  }

  .hamburger-menu {
    display: none;
  }

  .top-nav {
    display: flex;
    flex-direction: row;
    position: relative;
    top: auto;
    gap: 14px;
    height: auto;
    overflow: visible;
    background: transparent;
    padding: 0;
    border: none;
  }

  .top-nav a {
    padding: 8px 10px;
    font-size: 0.9rem;
    border: none;
  }

  .top-nav .nav-cta {
    margin: 0;
    width: auto;
    padding: 8px 14px;
  }

  .hero-section {
    min-height: 100vh;
    background-position: center top;
  }

  .bits-title {
    font-size: 3rem;
  }

  .headliner-placeholder {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid,
  .reach-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .experiences-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .exp-item {
    height: 300px;
  }

  .join-grid {
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
  }

  .footer-img {
    width: 30%;
  }

  .sponsor img {
    width: 140px;
  }
}

/* ----------- Extra Small Mobile: ≤360px ----------- */
@media (max-width: 360px) {
  .bits-title {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .hero-section {
    min-height: 85vh;
  }

  .btn, .btn-ticket {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  .card {
    min-height: 250px;
  }

  .exp-item {
    height: 200px;
  }

  .sponsor img {
    height: 60px;
  }

  .footer-img {
    width: 70%;
  }
}

/* ----------- Large Desktop: ≥1200px ----------- */
@media (min-width: 1200px) {
  .container {
    max-width: 1280px;
  }
}

/* ----------- Landscape Orientation Mobile ----------- */
@media (max-width: 900px) and (orientation: landscape) {
  .hero-section {
    min-height: 100vh;
    padding: 20px 0;
  }

  .hero-center {
    padding: 20px 16px;
  }

  .section {
    padding: 30px 16px;
  }
}

/* ----------- Print Styles ----------- */
@media print {
  .top-nav,
  .site-header,
  .hero-actions,
  .btn,
  .btn-ticket,
  .event-popup {
    display: none;
  }

  body {
    background-color: white;
    color: black;
  }
}
