/* ============================================
   RESPONSIVE FIXES FOR MOBILE/TABLET
   ============================================ */

/* Force hamburger menu on tablet and below (991px and smaller) */
@media (max-width: 991px) {
  /* Hide desktop navigation */
  #header.u-header .u-nav-container {
    display: none !important;
  }
  
  /* Show hamburger button */
  #header.u-header .menu-collapse {
    display: block !important;
  }
  
  /* Show mobile menu container */
  #header.u-header .u-nav-container-collapse {
    display: flex !important;
  }
  
  /* Adjust header layout for tablet */
  #header.u-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
  }
  
  #header.u-header .header-branding {
    flex: 1 1 auto;
    justify-content: flex-start;
  }
  
  #header.u-header .u-menu {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
  }
  
  /* Reduce logo and title size on tablet */
  #header.u-header .u-logo {
    max-width: 60px;
  }
  
  #header.u-header .header-site-title {
    font-family: "Abril Fatface", cursive !important;
    font-weight: 700 !important;
    font-size: 2.4rem;
    letter-spacing: 0.06em;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.55);
    background: none !important;
    background-image: none !important;
    -webkit-text-fill-color: currentColor !important;
    color: inherit;
  }
}

/* Mobile specific (767px and smaller) */
@media (max-width: 767px) {
  /* Stack header vertically on mobile */
  #header.u-header {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
    gap: 12px;
  }
  
  #header.u-header .header-branding {
    justify-content: center;
    text-align: center;
    width: 100%;
  }
  
  #header.u-header .u-menu {
    width: 100%;
    justify-content: flex-end;
    position: absolute;
    top: 12px;
    right: 16px;
    width: auto;
  }
  
  /* Further reduce title size on mobile */
  #header.u-header .header-site-title {
    font-family: "Abril Fatface", cursive !important;
    font-weight: 700 !important;
    font-size: 2rem;
    letter-spacing: 0.06em;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.55);
    background: none !important;
    background-image: none !important;
    -webkit-text-fill-color: currentColor !important;
    color: inherit;
  }
  
  #header.u-header .u-logo {
    max-width: 50px;
  }
  
  /* Make branding wrap better */
  .header-branding {
    flex-wrap: wrap;
    gap: 0.8em;
  }
}

/* Small mobile (575px and smaller) */
@media (max-width: 575px) {
  #header.u-header .header-site-title {
    font-family: "Abril Fatface", cursive !important;
    font-weight: 700 !important;
    font-size: 1.6rem;
    letter-spacing: 0.06em;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.55);
    background: none !important;
    background-image: none !important;
    -webkit-text-fill-color: currentColor !important;
    color: inherit;
  }
  
  #header.u-header .u-logo {
    max-width: 40px;
  }
  
  .header-branding {
    gap: 0.6em;
  }
}

/* ============================================
   CONTENT LAYOUT RESPONSIVE FIXES
   ============================================ */

/* Hero section responsive */
@media (max-width: 991px) {
  .u-section-1 .u-group-1 {
    padding: 30px 20px;
  }
  
  .u-section-1 .u-text-2 {
    font-size: 2rem;
  }
}

@media (max-width: 767px) {
  .u-section-1 .u-group-1 {
    padding: 20px 15px;
  }
  
  .u-section-1 .u-text-2 {
    font-size: 1.5rem;
  }
  
  #guestHeroMessage {
    font-size: 1.1rem;
  }
}

/* Dashboard roster responsive */
@media (max-width: 991px) {
  .dashboard-roster__container {
    padding: 15px;
  }
  
  .dashboard-roster__grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* Tables responsive - make them scrollable */
@media (max-width: 767px) {
  /* Wrapper becomes the horizontal scroller */
  .u-table,
  .u-table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Table sizes to its content so all columns are reachable */
  .u-table-entity {
    display: table;           /* ensure native table layout */
    width: max-content;       /* expand to fit columns */
    min-width: 900px;         /* wide enough for 6 columns; adjust if needed */
    table-layout: auto;
  }

  /* Avoid colgroup percent squeezing on small screens */
  .u-table-entity colgroup col {
    width: auto;
  }

  /* (No extra overflow on .u-table-1; let .u-table handle scrolling) */
}

/* Game cards/picks responsive */
@media (max-width: 991px) {
  .u-container-style {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}

@media (max-width: 767px) {
  /* Force Spread/O-U cards to stack on phones */
  #betOptions.bet-options {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    max-width: 100% !important;
  }
  #betOptions .bet-group {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  /* Stack columns vertically */
  .u-layout-row {
    flex-direction: column;
  }
  
  .u-layout-cell {
    width: 100% !important;
    min-width: 100% !important;
  }
  
  /* Adjust spacing */
  .u-container-style {
    padding: 15px 10px !important;
  }
  
  /* Make buttons full width on mobile */
  .u-btn {
    width: 100%;
    max-width: none;
  }
}

/* Form inputs responsive */
@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Footer responsive */
@media (max-width: 767px) {
  .u-footer {
    padding: 20px 15px;
  }
  
  .u-social-icons {
    justify-content: center;
  }
}

/* Nav pools dropdown adjustments */
@media (max-width: 991px) {
  .nav-pools__menu {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90vw;
  }
}

/* Ensure mobile menu is properly styled */
.u-sidenav {
  width: 280px;
  max-width: 85vw;
}

.u-nav-2 {
  padding: 20px 0;
}

.u-nav-2 .u-nav-link {
  padding: 12px 20px;
  font-size: 1rem;
}

/* Settings page responsive */
@media (max-width: 767px) {
  .u-section-1 form {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  .u-section-1 label {
    grid-column: 1 !important;
  }
  
  .u-section-1 div[style*="grid-column"] {
    grid-column: 1 !important;
  }
}

/* Admin console responsive */
@media (max-width: 991px) {
  .admin-section {
    padding: 20px 15px;
  }
  
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

/* Utility: Prevent horizontal scroll */
body {
  overflow-x: hidden;
}

.u-body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Utility: Make images responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Utility: Responsive text */
@media (max-width: 767px) {
  h1 {
    font-size: 1.8rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.3rem;
  }
  
  p {
    font-size: 1rem;
  }
}
