/**
 * vNext: Mobile Responsiveness Fixes
 * Addresses header overlap, tap targets, and viewport issues
 */

/* Mobile Base Styles */
@media (max-width: 768px) {
  /* Ensure header doesn't overlap content */
  .main-header {
    position: relative;
    z-index: 100;
    padding: 12px 16px;
    min-height: 60px;
  }
  
  .header-container {
    width: 100%;
    max-width: 100%;
    padding: 0 12px;
  }
  
  .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  /* Fix tap targets - minimum 44px */
  button,
  a.btn,
  .btn,
  input[type="submit"],
  input[type="button"] {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
  
  /* Header buttons */
  .header-top button,
  .btn-multiplayer,
  .btn-leaderboard {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 15px;
  }
  
  /* Navigation links */
  nav a,
  .nav-link {
    min-height: 44px;
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
  }
  
  /* Modal fixes for mobile */
  .modal,
  .overlay {
    padding: 20px 16px;
    max-width: 100vw;
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .modal-content {
    max-width: 100%;
    margin: 0;
    padding: 20px 16px;
  }
  
  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
    width: 100%;
  }
  
  /* Fix font sizes for readability */
  body {
    font-size: 16px;
    line-height: 1.6;
  }
  
  h1 {
    font-size: 2rem;
    line-height: 1.3;
  }
  
  h2 {
    font-size: 1.75rem;
    line-height: 1.3;
  }
  
  h3 {
    font-size: 1.5rem;
    line-height: 1.4;
  }
  
  /* Reduce effects on mobile */
  .matrix-rain,
  .particles {
    opacity: 0.05;
  }
  
  /* Accordion for secondary sections */
  .secondary-section {
    margin-bottom: 20px;
  }
  
  .secondary-section.collapsed .section-content {
    display: none;
  }
  
  .section-toggle {
    width: 100%;
    padding: 16px;
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.2);
    color: #4A90E2;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
  }
  
  .section-toggle::after {
    content: '▼';
    transition: transform 0.3s;
  }
  
  .section-toggle.expanded::after {
    transform: rotate(180deg);
  }
}

/* iPhone specific (390px) */
@media (max-width: 390px) {
  .header-right {
    gap: 6px;
  }
  
  .header-top button {
    padding: 8px 12px;
    font-size: 14px;
  }
  
  /* Ensure no cutoff */
  .main-header {
    overflow: visible;
  }
  
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* Android specific (414px) */
@media (min-width: 391px) and (max-width: 414px) {
  .header-container {
    padding: 0 16px;
  }
}

/* Tablet (768px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .header-container {
    max-width: 100%;
    padding: 0 24px;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .matrix-rain,
  .particles {
    display: none;
  }
}

/* Smooth scroll with reduced motion fallback */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* vNext: Improve "Latest Breaking News" visual hierarchy */
.news-section,
#news-section,
.breaking-news-section {
  position: relative;
  z-index: 1;
}

.news-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #4A9EFF, #5BB5FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.news-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  max-width: 600px;
}

/* Ensure news cards are visually dominant */
.article-card,
.feed-post-card {
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover,
.feed-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(74, 144, 226, 0.2);
}

/* Consistent button behavior for news cards */
.article-link,
.article-card button {
  cursor: pointer;
  transition: all 0.2s ease;
}

.article-link:hover,
.article-card button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Hero module (Latest Breaking News) - Make visually dominant */
.hero-module-container {
  position: relative;
  z-index: 2;
  margin-bottom: 2rem;
}

.hero-module-headline {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.hero-module-btn {
  min-height: 44px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.hero-module-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

