/* Mobile-specific styles for Loser.gay */

/* Desktop layout by default */
.contestant-card .desktop-layout {
  display: flex;
}

.contestant-card .mobile-layout {
  display: none;
}

/* Contestant Show Page Mobile Styles */
@media (max-width: 768px) {
  /* Container adjustments */
  .contestant-container {
    padding: 1rem !important;
  }
  
  .contestant-header {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
  }
  
  .contestant-image {
    width: 150px !important;
    height: 150px !important;
    margin-bottom: 1rem;
  }
  
  .contestant-info h1 {
    font-size: 1.8rem !important;
  }
  
  .contestant-stats {
    flex-direction: column !important;
    gap: 0.5rem !important;
    width: 100%;
  }
  
  .contestant-stats span {
    width: 100%;
    text-align: center;
  }
  
  .vote-buttons {
    flex-direction: column !important;
    width: 100%;
    gap: 0.5rem !important;
  }
  
  .vote-buttons a,
  .vote-buttons button,
  .vote-buttons form {
    width: 100% !important;
    margin: 0 !important;
  }
  
  .vote-buttons button[type="submit"] {
    width: 100% !important;
    white-space: normal !important;
    text-align: center !important;
    font-size: 1rem !important;
    padding: 0.8rem 1rem !important;
  }
  
  /* Fix vote button text overflow */
  .vote-buttons .vote-button {
    font-size: 1rem !important;
    padding: 0.8rem 1rem !important;
    white-space: normal !important;
    min-width: unset !important;
  }
  
  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }
  
  /* Contestant Card Mobile Styles */
  .contestant-card {
    padding: 1rem !important;
  }
  
  .contestant-card-content {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 0.75rem;
  }
  
  .contestant-rank {
    font-size: 1.5rem !important;
    margin-bottom: 0.5rem;
  }
  
  .contestant-photo {
    width: 100px !important;
    height: 100px !important;
    margin: 0 auto;
  }
  
  .contestant-name {
    font-size: 1.2rem !important;
    justify-content: center;
  }
  
  .contestant-meta,
  .contestant-joined {
    font-size: 0.85rem !important;
  }
  
  .vote-count {
    font-size: 2.5rem !important;
  }
  
  .contestant-action {
    margin: 0.5rem 0 0 0 !important;
    width: 100%;
  }
  
  .vote-btn {
    display: block !important;
    width: 100% !important;
    padding: 0.8rem 1.5rem !important;
    font-size: 1rem !important;
  }
  
  /* Stats bar */
  .stats-bar {
    flex-direction: row !important;
    gap: 1rem;
  }
  
  .stats-bar > div {
    flex: 1;
  }
  
  /* Tabs */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  
  .tab-btn {
    font-size: 0.9rem !important;
    padding: 0.75rem 1rem !important;
  }
  
  /* Page header */
  h1 {
    font-size: 2rem !important;
  }
  
  h1 .rainbow-text {
    font-size: inherit !important;
  }
  
  p[style*="font-size: 1.3rem"] {
    font-size: 1rem !important;
  }
  
  /* Form adjustments */
  .form-container {
    padding: 1rem !important;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
  }
}

@media (max-width: 480px) {
  /* Even smaller screens */
  .contestant-image {
    width: 120px !important;
    height: 120px !important;
  }
  
  .contestant-info h1 {
    font-size: 1.5rem !important;
  }
  
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Reduce padding on very small screens */
  .contestant-container,
  .form-container {
    padding: 0.5rem !important;
  }
  
  /* Stack all navigation items */
  .tab-links {
    flex-direction: column !important;
    width: 100%;
  }
  
  .tab-link {
    width: 100%;
    text-align: center;
    margin: 0.25rem 0 !important;
  }
  
  /* Stats bar on very small screens */
  .stats-bar {
    font-size: 0.9rem !important;
  }
  
  .stats-bar > div > div:first-child {
    font-size: 1.5rem !important;
  }
  
  /* Leaderboard item adjustments */
  .leaderboard-item h3 {
    font-size: 1.1rem !important;
  }
  
  .leaderboard-item p {
    font-size: 0.8rem !important;
  }
  
  /* Contestant card adjustments for very small screens */
  .contestant-card {
    padding: 0.75rem !important;
  }
  
  .contestant-photo {
    width: 80px !important;
    height: 80px !important;
  }
  
  .contestant-name {
    font-size: 1.1rem !important;
  }
  
  .vote-count {
    font-size: 2rem !important;
  }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
  /* iOS only styles */
  .navbar {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
}

/* Ensure images don't overflow on mobile */
img {
  max-width: 100%;
  height: auto;
}

/* Better touch targets for mobile */
@media (hover: none) and (pointer: coarse) {
  a, button, .vote-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Fix form button widths on mobile */
@media (max-width: 768px) {
  form[action*="votes"] {
    width: 100%;
  }
  
  form[action*="votes"] button {
    width: 100% !important;
  }
  
  /* Main container padding */
  main .container > div[style*="background: white"] {
    padding: 1rem !important;
  }
  
  /* Fix button overflow in cards */
  .contestant-card {
    overflow: hidden;
  }
  
  /* Prevent horizontal overflow */
  body {
    overflow-x: hidden;
  }
  
  /* Fix tab scrolling */
  .tabs {
    padding-bottom: 0.5rem;
  }
  
  /* Ensure all content respects viewport */
  [style*="max-width"] {
    max-width: 100% !important;
  }
}