/* ==============================================
   MOBILE RESPONSIVE FIXES
   Target: iPhone (375px), Android (360px), Tablet (768px)
   ============================================== */

/* === GLOBAL MOBILE RESETS === */
@media (max-width: 768px) {
  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
  }
  
  /* Container padding adjustment */
  .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* === NAVIGATION BAR === */
@media (max-width: 768px) {
  /* Stack navigation vertically */
  header .flex {
    flex-wrap: wrap;
  }
  
  header nav {
    display: none; /* Hide nav links on mobile (TODO: add hamburger) */
  }
  
  /* Logo smaller */
  header a.text-2xl {
    font-size: 1.5rem; /* 24px */
  }
  
  /* Connect Wallet button full width below */
  header button {
    margin-top: 12px;
    width: 100%;
    max-width: 300px;
  }
}

/* === HERO CARD - CRITICAL FIXES === */
@media (max-width: 768px) {
  /* Reduce hero height for mobile */
  section > a > div.relative.h-\[600px\] {
    height: 500px !important;
  }
  
  /* Adjust padding */
  section > a > div .absolute.inset-0.p-12 {
    padding: 20px !important;
  }
  
  /* TITLE - Scale down dramatically */
  section h1.text-6xl {
    font-size: 1.75rem !important; /* 28px (was 60px) */
    line-height: 1.2 !important;
    margin-bottom: 16px !important;
    max-width: 240px !important; /* Leave space for badge */
  }
  
  /* DESCRIPTION - Readable size */
  section p.text-lg {
    font-size: 0.875rem !important; /* 14px (was 18px) */
    line-height: 1.5 !important;
    max-width: 100% !important;
    /* Truncate to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* PROBABILITY BADGE - Smaller, repositioned */
  .absolute.top-8.right-8 {
    top: 12px !important;
    right: 12px !important;
  }
  
  .absolute.top-8.right-8 > div {
    padding: 12px 16px !important;
  }
  
  .absolute.top-8.right-8 .text-5xl {
    font-size: 2rem !important; /* 32px (was 48px) */
  }
  
  .absolute.top-8.right-8 .text-sm {
    font-size: 0.75rem !important; /* 12px */
  }
  
  .absolute.top-8.right-8 .text-lg {
    font-size: 0.875rem !important; /* 14px */
  }
  
  /* BELIEF CURRENTS CHART - Compact */
  section .bg-black\/60.backdrop-blur {
    padding: 16px !important;
    max-width: 100% !important;
  }
  
  section .bg-black\/60 .text-sm {
    font-size: 0.75rem !important;
  }
  
  section .bg-black\/60 .text-2xl {
    font-size: 1.25rem !important; /* 20px (was 24px) */
  }
  
  section .bg-black\/60 .grid-cols-3 {
    gap: 12px !important;
  }
  
  section .bg-black\/60 button {
    font-size: 0.75rem !important;
  }
}

/* Extra small phones (360px and below) */
@media (max-width: 414px) {
  /* Hero even smaller */
  section > a > div.relative.h-\[600px\] {
    height: 400px !important;
  }
  
  section h1.text-6xl {
    font-size: 1.5rem !important; /* 24px */
    max-width: 200px !important;
  }
  
  .absolute.top-8.right-8 .text-5xl {
    font-size: 1.75rem !important; /* 28px */
  }
}

/* === CATEGORY FILTERS === */
@media (max-width: 768px) {
  /* Make scrollable horizontally */
  .flex.items-center.gap-3.mb-8 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 8px;
  }
  
  .flex.items-center.gap-3.mb-8 button {
    flex-shrink: 0;
    font-size: 0.875rem;
    padding: 8px 16px;
  }
  
  /* Hide scrollbar but keep functionality */
  .flex.items-center.gap-3.mb-8::-webkit-scrollbar {
    display: none;
  }
}

/* === GRID CARDS === */
@media (max-width: 768px) {
  /* Force single column */
  section.mb-16 > div.grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  
  /* Card titles readable */
  section.mb-16 h3.text-base {
    font-size: 1rem !important;
    line-height: 1.4 !important;
  }
  
  /* Probability badges on cards */
  section.mb-16 .absolute.top-3.right-3 .text-2xl {
    font-size: 1.5rem !important;
  }
  
  section.mb-16 .absolute.top-3.right-3 {
    padding: 10px 14px !important;
  }
}

/* === TICKER BAR === */
@media (max-width: 768px) {
  .ticker-scroll {
    font-size: 0.875rem;
  }
  
  .ticker-scroll span.text-sm {
    font-size: 0.75rem !important;
  }
}

/* === TOUCH TARGET IMPROVEMENTS === */
@media (max-width: 768px) {
  /* All buttons minimum 44px height (Apple HIG) */
  button {
    min-height: 44px;
  }
  
  /* Increase tap targets for badges */
  .absolute.top-3 {
    padding: 12px !important;
  }
}

/* === FOOTER === */
@media (max-width: 768px) {
  footer {
    padding: 24px 16px;
  }
  
  footer p {
    font-size: 0.75rem;
  }
}
