/**
 * Legacy Adapter
 * Adapts existing styles to work with modern design system
 * Overrides old hardcoded colors with CSS Variables
 */

/* ========================================
   BODY & CONTAINER - Mobile First
   ======================================== */

body {
  /* Soft Mesh Gradient Background */
  background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
  background-attachment: fixed;
  color: var(--color-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-width: 320px; /* Minimum mobile width */
}

/* Subtle football pitch pattern overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 100%;
  margin: 0;
  padding: 0 0 16px 0; /* No side padding on mobile - full width */
  background-color: var(--color-bg-primary);
  border-radius: 0;
  box-shadow: none;
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
    margin: 24px auto;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
    margin: 40px auto;
  }
}

/* ========================================
   HEADER - Glass Effect
   ======================================== */

/* ========================================
   HEADER - Animated Mesh Gradient
   ======================================== */
.header {
  text-align: center;
  margin-bottom: 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 24px 20px;
  padding-top: calc(24px + env(safe-area-inset-top));
  /* Animated Mesh Gradient - more dramatic colors */
  background: linear-gradient(
    -45deg, 
    #1e3a8a 0%,      /* Dark blue */
    #2563eb 25%,     /* Blue */
    #3b82f6 50%,     /* Light blue */
    #1d4ed8 75%,     /* Medium blue */
    #1e40af 100%     /* Navy */
  );
  background-size: 400% 400%;
  animation: gradientMove 6s ease infinite;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: white;
  border-radius: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  /* Multi-layered shadow for depth */
  box-shadow: 
    0 4px 20px rgba(30, 64, 175, 0.35),
    0 8px 40px rgba(59, 130, 246, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  overflow: visible;
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  25% { background-position: 50% 100%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 0%; }
  100% { background-position: 0% 50%; }
}

/* Header content - with depth layers */
.header-content {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding: 0 10px;
  box-sizing: border-box;
  z-index: 2;
}

/* Depth Orbs - glow behind text */
.header-content::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 100px;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  filter: blur(20px);
  z-index: -1;
  pointer-events: none;
}

.header-content p {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Auth controls - Glass floating button */
.auth-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 10;
}

.auth-controls button,
.auth-controls .btn-login {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 20px !important;
  color: white !important;
  padding: 8px 16px !important;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.auth-controls button:hover,
.auth-controls .btn-login:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-2px);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Header action buttons (Subscriptions, My Calendar) */
#favoritesHeaderAction {
  margin-top: 12px;
}

#favoritesHeaderAction > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

#favoritesHeaderAction .auth-btn {
  padding: 8px 14px !important;
  font-size: 0.85rem !important;
  min-width: auto;
  white-space: nowrap;
}

/* Mobile header fixes */
@media (max-width: 768px) {
  .header {
    display: block !important;
    text-align: center;
    padding: 12px 16px 8px;
    padding-top: calc(12px + env(safe-area-inset-top));
    margin-bottom: 0 !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    /* Keep animated gradient on mobile - more dramatic */
    background: linear-gradient(
      -45deg, 
      #1e3a8a 0%,
      #2563eb 25%,
      #3b82f6 50%,
      #1d4ed8 75%,
      #1e40af 100%
    ) !important;
    background-size: 400% 400% !important;
    animation: gradientMove 6s ease infinite !important;
  }
  
  .header h1 {
    font-size: 1.4rem !important;
    margin: 0 0 4px 0 !important;
    line-height: 1.2 !important;
    /* Keep glow on mobile */
    text-shadow: 
      0 0 15px rgba(255, 255, 255, 0.4),
      0 0 30px rgba(147, 197, 253, 0.25),
      0 1px 2px rgba(0, 0, 0, 0.2) !important;
  }
  
  .header p {
    font-size: 0.9rem !important;
    margin: 2px 0 !important;
    line-height: 1.3 !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.25) !important;
  }
  
  .header .sub-header {
    display: none !important;
  }
  
  /* Content starts right after header with NO gap */
  .explorer-section {
    margin-top: calc(76px + env(safe-area-inset-top)) !important;
    padding: 0 !important;
    width: 100% !important;
  }
  
  /* Cards grid - full width, centered */
  .cards-grid {
    width: 100% !important;
    padding: 8px 12px !important;
    margin-top: 16px !important;
    box-sizing: border-box !important;
  }
  
  .tabs-nav {
    margin: 8px 8px 0 8px !important;
    padding: 12px !important;
    align-items: stretch !important;
    width: calc(100% - 16px) !important;
    gap: 4px !important;
  }
  
  .tab-btn {
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 16px 12px 20px !important;
    min-height: 44px !important;
    border-radius: 10px !important;
  }
  
  /* Hide filters section on mobile when empty */
  .filters-section {
    display: none !important;
  }
  
  /* Hide fixtures section empty state background on mobile */
  .fixtures-section {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .fixtures-grid {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .empty-state {
    background: transparent !important;
    border: none !important;
    padding: 8px !important;
    margin: 0 !important;
  }
  
  /* Tabs - consistent 8px grid */
  .tab-btn {
    padding: 12px 16px 12px 20px !important;
    min-height: 48px !important;
    font-size: 0.875rem !important;
  }
  
  /* Remove any extra spacing from explorer section */
  .explorer-section {
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .explorer-step {
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* Remove gap between tabs and content */
  .cards-grid {
    margin-top: 4px !important;
    padding-top: 0 !important;
  }
  
  .header-content {
    display: block;
    width: 100%;
  }
  
  /* Move auth controls below header */
  .auth-controls {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 6px;
  }
  
  /* Hide help button inside header, show fixed at bottom */
  .header .help-fab {
    display: none;
  }
  
  /* Hide header action buttons on mobile - we have the subscriptions tab now */
  #favoritesHeaderAction {
    display: none;
  }
}

@media (max-width: 380px) {
  .header h1 {
    font-size: 1.4rem;
  }
  
  .header p {
    font-size: 0.9rem;
  }
}

@media (min-width: 768px) {
  .header {
    border-radius: 0 0 16px 16px;
    margin-bottom: 30px;
  }
}

/* Title with Glow Effect */
.header h1 {
  font-size: 1.75rem;
  color: white;
  margin: 0 0 12px 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  /* Text glow */
  text-shadow: 
    0 0 20px rgba(255, 255, 255, 0.5),
    0 0 40px rgba(147, 197, 253, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
  .header h1 {
    font-size: 2.25rem;
  }
}

.header p {
  color: rgba(255, 255, 255, 0.95);
  margin: 8px 0;
  font-size: 1rem;
  /* Subtle glow */
  text-shadow: 
    0 0 10px rgba(255, 255, 255, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.15);
}

.header .sub-header {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ========================================
   BUTTONS - Touch Optimized
   ======================================== */

button, .btn, .btn-primary {
  min-height: 44px;
  min-width: 44px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Back Button - visible on all screens when not hidden */
/* z-index 2000 is below modals (2100-4000) so dialogs cover the back button */
#mobileBackBtn {
  display: flex;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 2000;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
}

#mobileBackBtn.hidden {
  display: none !important;
}

/* Back Button */
.back-btn {
  min-height: 44px;
  padding: 10px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.back-btn:hover {
  background: var(--glass-bg-light);
  transform: translateX(-2px);
}

/* ========================================
   CARDS - Glass Effect
   ======================================== */

.card, 
.country-card,
.league-card,
.team-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 80px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Enhanced shadow for depth */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card:hover,
.country-card:hover,
.league-card:hover,
.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

.card:active {
  transform: translateY(-2px);
}

/* ========================================
   CARDS GRID - Responsive (overrides styles.css)
   ======================================== */

.cards-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px 12px !important; /* Equal vertical and horizontal gap */
  margin-top: 12px;
  max-height: none !important;
  overflow: visible !important;
  padding: 8px 12px !important;
}

/* Country mode - 3 columns on mobile */
.cards-grid.country-mode {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px 10px !important; /* Equal vertical and horizontal gap */
  padding: 0 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* All cards SAME SIZE - fixed dimensions */
@media (max-width: 768px) {
  /* Standard card size for ALL cards */
  .grid-card {
    position: relative !important;
    padding: 10px 6px !important;
    font-size: 0.65rem !important;
    width: 100% !important;
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    /* Enhanced glass effect */
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  
  .grid-card:active {
    transform: scale(0.96) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  }

  .grid-card img {
    width: 44px !important;
    height: 44px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
  }

  .grid-card span,
  .grid-card .league-name,
  .grid-card .country-name {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
    max-width: 100%;
    text-align: center;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    color: #1e293b !important;
    padding: 0 4px !important;
  }
  
  /* Country mode - same size, just 3 columns */
  .country-mode .grid-card {
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
  }

  .country-mode .grid-card img {
    width: 40px !important;
    height: 40px !important;
  }

  .country-mode .grid-card span {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
  }
  
  /* Gold/winner cards - same size as others */
  .grid-card .card-content {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
  }
  
  .grid-card .card-content span {
    font-size: inherit !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
    max-width: 100%;
  }
}

/* Subscriptions grid - 2 columns */
.subscriptions-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px;
}

.subscription-card {
  padding: 12px !important;
}

.subscription-card img {
  width: 32px !important;
  height: 32px !important;
}

.subscription-card .sub-team-name {
  font-size: 0.9rem !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  
  .subscriptions-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (min-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ========================================
   INPUT FIELDS - Touch Friendly
   ======================================== */

.filter-input,
input[type="text"],
input[type="search"] {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
  font-family: inherit;
}

.filter-input:focus,
input[type="text"]:focus,
input[type="search"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* ========================================
   TABS - Deep Glassmorphism Navigation
   ======================================== */

/* Background Glow Orbs for Depth */
.bg-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(60px);
  z-index: -1;
  pointer-events: none;
}

.bg-glow-1 {
  top: 10%;
  left: -5%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
}

.bg-glow-2 {
  top: 40%;
  right: -10%;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.1) 0%, transparent 70%);
}

.tabs-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
  padding: 12px;
  /* Deep Glassmorphism - more transparency */
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  /* Multi-layered shadows for depth: outer + inset highlight */
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 0 15px rgba(255, 255, 255, 0.5),
    0 1px 1px rgba(0, 0, 0, 0.05);
  overflow: visible;
  width: 100%;
}

/* Sub-tabs (Country Hub / Continent Hub) - same styling */
.tabs-nav.sub-tabs {
  margin-top: 0;
  margin-bottom: 16px;
}

.tab-btn {
  position: relative;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px 12px 24px;
  background: transparent !important;
  border: none !important;
  border-bottom: none !important; /* Override styles.css */
  border-radius: 12px !important;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  color: #475569 !important;
  cursor: pointer;
  /* Bouncy luxurious transition */
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Vertical Blue Line with Gradient & Glow */
.tab-btn::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 0 !important; /* Override styles.css */
  background: linear-gradient(180deg, #3b82f6, #2563eb) !important;
  border-radius: 4px;
  transition: all 0.3s ease;
  box-shadow: 0 0 0 rgba(59, 130, 246, 0);
}

.tab-text {
  flex: 1;
  text-align: left;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #1e293b;
}

.tab-icon {
  font-size: 1.3rem;
  margin-left: 16px;
  opacity: 0.7;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hide step indicator on mobile */
@media (max-width: 768px) {
  .navigation-header #stepIndicator {
    display: none;
  }
  
  /* Hide default navigation header on mobile */
  .navigation-header {
    display: none !important;
  }
  
  /* Mobile floating back button - visible */
  /* z-index 2000 is below modals so dialogs cover the back button */
  #mobileBackBtn {
    display: flex !important;
    position: fixed;
    top: calc(16px + env(safe-area-inset-top));
    left: 16px;
    z-index: 2000;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: bold;
  }
  
  #mobileBackBtn:active {
    transform: scale(0.9);
    background: #2563eb;
  }
  
  #mobileBackBtn.hidden {
    display: none !important;
  }
  
  /* No extra padding needed since nav is hidden */
  .explorer-section {
    padding-top: 0;
  }
  
  /* Glassmorphism tabs on mobile */
  .tabs-nav {
    margin: 8px 8px 16px 8px !important;
    padding: 12px !important;
  }
  
  .explorer-step {
    padding: 0 !important;
  }
  
  .explorer-section {
    padding: 0 !important;
    margin-bottom: 0 !important;
  }
  
  /* Hide any filter inputs on mobile */
  .filter-input {
    display: none !important;
  }
  
  /* Style back button on mobile */
  .navigation-header .back-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
  }
  
  /* Hide table headers on mobile */
  .teams-table thead,
  .fixtures-table thead {
    display: none;
  }
  
  /* Hide country search input on mobile */
  #countrySearch {
    display: none;
  }
}

/* Desktop: Horizontal tabs */
@media (min-width: 768px) {
  .tabs-nav {
    flex-direction: row;
  }
  
  .tab-btn {
    flex: 1;
    width: auto;
    justify-content: center;
    text-align: center;
  }
  
  .tab-text {
    text-align: center;
  }
  
  .tab-icon {
    margin-left: 8px;
  }
}

/* Hover State - initial growth and slide */
.tab-btn:hover {
  background: rgba(59, 130, 246, 0.08);
  color: #1e40af;
  transform: translateX(6px);
}

.tab-btn:hover::before {
  height: 24px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.tab-btn:hover .tab-icon {
  opacity: 1;
  transform: scale(1.15);
}

/* Active State - full height indicator with deep glow */
.tab-btn.active {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #1d4ed8 !important;
  font-weight: 700 !important;
  transform: translateX(4px);
  border: none !important; /* Override styles.css */
  border-bottom: none !important; /* Override styles.css */
}

.tab-btn.active .tab-text {
  font-weight: 700 !important;
  color: #1d4ed8 !important;
}

.tab-btn.active::before {
  height: 32px !important;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.tab-btn.active .tab-icon {
  opacity: 1;
  transform: scale(1.05);
}

/* Press State - subtle feedback */
.tab-btn:active {
  transform: scale(0.98) translateX(3px);
  background: rgba(59, 130, 246, 0.15);
  transition: all 0.1s ease;
}

/* My Teams Tab - Same styling as other tabs */
/* No special styling needed - inherits from .tab-btn */

/* Welcome Screen - Fill ENTIRE content area (span all grid columns) */
.welcome-screen {
  grid-column: 1 / -1;  /* Span all columns! */
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  margin: 0;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}

@media (max-width: 768px) {
  .welcome-screen {
    min-height: auto;
    border-radius: 12px;
    margin: 0;
    padding: 12px 12px 20px 12px;
    padding-bottom: 90px; /* Space for nav bar */
  }
}

.welcome-icon {
  font-size: 2.5rem;
  margin-bottom: -6px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.welcome-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e3a8a;
  margin: 0 0 2px 0;
}

.welcome-subtitle {
  font-size: 0.9rem;
  color: #3b82f6;
  margin: 0 0 10px 0;
  font-weight: 500;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 500px;
  margin-bottom: 14px;
}

@media (max-width: 480px) {
  .welcome-features {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-width: 100%;
  }
}

.welcome-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  background: white;
  padding: 10px 8px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.welcome-feature .feature-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.welcome-feature .feature-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.welcome-feature .feature-text strong {
  font-size: 0.75rem;
  color: #1e293b;
}

.welcome-feature .feature-text span {
  font-size: 0.65rem;
  color: #64748b;
}

.welcome-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  padding: 10px 28px;
  border-radius: 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.welcome-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.welcome-btn:active {
  transform: translateY(0);
}

.welcome-counter {
  margin-top: 12px;
  font-size: 0.85rem;
  color: #059669;
  font-weight: 500;
}

.welcome-counter span {
  font-weight: 700;
  color: #dc2626;
}

.info-btn-circle {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.65rem;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 6px;
  padding: 0;
  line-height: 1;
  color: white;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.info-btn-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.4);
}

/* Highlighted info button with yellow glow */
.info-btn-highlight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  margin-left: 8px;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
}

.info-btn-highlight::before {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.5) 0%, rgba(250, 204, 21, 0) 70%);
  border-radius: 50%;
  animation: pulse-glow 2s ease-in-out infinite;
  z-index: 0;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
}

.info-circle-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.4);
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
}

.info-btn-highlight:hover .info-circle-large {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

.welcome-credit {
  margin-top: 28px;
  margin-bottom: 70px; /* Push above nav bar */
  text-align: center;
}

.welcome-credit .credit-text {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0 0 8px 0;
}

.welcome-credit .sea-creatures {
  font-size: 0.75rem;
  margin: 0;
  letter-spacing: 4px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.welcome-note {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #64748b;
}

.welcome-browse {
  margin-top: 24px;
}

.welcome-browse-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.welcome-browse-btns button {
  background: white;
  border: 1px solid #cbd5e1;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.welcome-browse-btns button:hover {
  background: #f1f5f9;
  border-color: #3b82f6;
}

/* Login invite card (smaller version for other places) */
.login-invite-card {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px dashed #3b82f6;
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  margin: 20px 0;
}

.login-invite-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.login-invite-card h3 {
  margin: 0 0 12px 0;
  color: #1e40af;
  font-size: 1.3rem;
  font-weight: 700;
}

.login-invite-card p {
  margin: 0 0 20px 0;
  color: #475569;
  font-size: 1rem;
  line-height: 1.5;
}

.login-invite-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.login-invite-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Subscriptions Grid */
.subscriptions-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subscription-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.subscription-card:hover {
  background: #f8fafc;
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateX(4px);
}

.subscription-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
}

.subscription-card .sub-team-name {
  flex: 1;
  font-weight: 600;
  color: #1e293b;
  font-size: 1rem;
}

.subscription-card .sub-edit-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

.subscription-card .sub-edit-btn:hover {
  background: #f1f5f9;
}

/* Loading state */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: #64748b;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    /* Frosted Glass Effect */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 4px 4px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
    z-index: 1000;
    justify-content: space-around;
  }
  
  .mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s ease;
    border-radius: 12px;
    position: relative;
  }
  
  /* Active Glass Effect for nav items */
  .mobile-bottom-nav .nav-item.active,
  .mobile-bottom-nav .nav-item:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
  }
  
  .mobile-bottom-nav .nav-item:active {
    transform: scale(0.92);
    background: rgba(59, 130, 246, 0.25);
  }
  
  .mobile-bottom-nav .nav-icon {
    font-size: 1.3rem;
    transition: transform 0.2s ease;
  }
  
  .mobile-bottom-nav .nav-item:hover .nav-icon {
    transform: translateY(-2px);
  }
  
  .mobile-bottom-nav .nav-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
  }
  
  /* Hide desktop footer on mobile */
  .desktop-footer {
    display: none;
  }
  
  /* Add padding to content so it's not hidden behind floating bottom nav */
  .container {
    padding-bottom: 100px;
  }
  
  /* Hide help FAB on mobile - we have it in bottom nav */
  .help-fab {
    display: none !important;
  }
}

/* Desktop: center text */
@media (min-width: 768px) {
  .tab-btn {
    text-align: center;
    justify-content: center;
  }
  
  .tab-btn:hover,
  .tab-btn.active {
    transform: translateY(-2px);
  }
}

/* ========================================
   STATUS BADGES
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

/* ========================================
   FIXTURES TABLE - Mobile Optimized
   ======================================== */

.fixtures-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.fixtures-table thead {
  background: var(--color-primary);
  color: white;
}

.fixtures-table th {
  padding: 14px 12px;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
}

.fixtures-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
}

.fixtures-table tr:last-child td {
  border-bottom: none;
}

.fixtures-table tr:hover {
  background: var(--color-surface-hover);
}

/* Mobile Table - Stack rows */
@media (max-width: 640px) {
  .fixtures-table {
    font-size: 0.8125rem;
  }
  
  .fixtures-table th,
  .fixtures-table td {
    padding: 12px 8px;
  }
  
  /* Hide less important columns on mobile */
  .fixtures-table .hide-mobile {
    display: none;
  }
}

/* ========================================
   MODAL/DIALOG - Mobile Friendly
   ======================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-2xl);
  animation: modal-slide-up 0.3s ease-out;
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   TOAST NOTIFICATIONS - Mobile Friendly
   ======================================== */

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  min-width: 280px;
  max-width: calc(100% - 32px);
  padding: 16px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-tooltip);
  transition: transform var(--transition-slow);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 768px) {
  .toast {
    bottom: 20px;
  }
}

/* ========================================
   LOADING SPINNER - Centered
   ======================================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--frosted-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========================================
   HELP FAB - Modernized
   ======================================== */

.help-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  z-index: 100;
}

.help-fab:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.help-fab:active {
  transform: scale(0.95);
}

/* ========================================
   EXPLORER SECTION
   ======================================== */

.explorer-section {
  margin-bottom: 24px;
}

/* ========================================
   NAVIGATION HEADER
   ======================================== */

.navigation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 12px 0;
}

#stepIndicator {
  font-weight: 600;
  color: var(--color-text-secondary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
}

/* ========================================
   STATUS MESSAGE
   ======================================== */

.status-message {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  font-size: 0.875rem;
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid var(--color-info);
}

.status-message.error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border-color: var(--color-error);
}

.status-message.success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border-color: var(--color-success);
}

/* ========================================
   STAR BUTTONS - Touch Friendly
   ======================================== */

.fav-star-btn,
.fav-star {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), color var(--transition-fast);
  color: var(--color-border);
  -webkit-tap-highlight-color: transparent;
}

.fav-star-btn:hover,
.fav-star:hover {
  transform: scale(1.2);
  color: #fbbf24;
}

.fav-star-btn.favorited,
.fav-star.active {
  color: #fbbf24;
  filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.3));
}

.fav-star-btn:active,
.fav-star:active {
  transform: scale(1.1);
}

/* ========================================
   LEAGUE STATUS BADGES
   ======================================== */

.league-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

/* Hide on mobile */
.hide-mobile {
  display: block;
}

@media (max-width: 640px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Show only on mobile */
.show-mobile {
  display: none;
}

@media (max-width: 640px) {
  .show-mobile {
    display: block !important;
  }
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-hover);
}

/* ========================================
   FOCUS STATES - Accessibility
   ======================================== */

*:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

button:focus,
.btn:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Remove outline for mouse users, keep for keyboard */
*:focus:not(:focus-visible) {
  outline: none;
}

/* ========================================
   TABLES - NO HORIZONTAL SCROLL
   ======================================== */

/* Table container - NO horizontal scroll */
.table-container,
.teams-table-container,
.standings-container {
  width: 100%;
  overflow-x: hidden !important;
  overflow: hidden !important;
}

/* All tables - fit within container */
.teams-table,
.fixtures-table,
.group-table,
.playoff-standings-table {
  width: 100%;
  table-layout: fixed;
  overflow: hidden;
}

/* Teams table responsive */
.teams-table {
  width: 100%;
  table-layout: auto;
}

/* Scroll hint removed - no horizontal scroll */
.table-scroll-hint {
  display: none !important;
}

/* ========================================
   MOBILE: Hide columns, show info button
   ======================================== */

@media (max-width: 640px) {
  /* TEAMS TABLE - Mobile simplified */
  .teams-table {
    font-size: 0.85rem;
  }
  
  .teams-table th,
  .teams-table td {
    padding: 10px 6px !important;
  }
  
  /* Hide GP, GD columns on mobile - show via info popup */
  .teams-table .col-gp,
  .teams-table .col-gd,
  .teams-table th.col-gp,
  .teams-table th.col-gd {
    display: none !important;
  }
  
  /* Hide FORM column on mobile - show via info popup */
  .teams-table .col-form,
  .teams-table th.col-form {
    display: none !important;
  }
  
  /* Show info button on mobile */
  .teams-table .col-info {
    display: table-cell !important;
    width: 40px;
    text-align: center;
  }
  
  /* Make team name take more space */
  .teams-table .col-team {
    max-width: none;
  }
  
  /* Smaller logos */
  .teams-table img {
    width: 22px !important;
    height: 22px !important;
  }
  
  /* Points column - bold and visible */
  .teams-table .col-pts {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 40px;
  }
  
  /* FIXTURES TABLE - Mobile simplified */
  .fixtures-table {
    font-size: 0.8rem;
    width: 100%;
  }
  
  .fixtures-table th,
  .fixtures-table td {
    padding: 8px 4px !important;
  }
  
  /* Compact date column */
  .fixtures-table .col-date,
  .fixtures-table td:nth-child(2) {
    font-size: 0.75rem;
    white-space: nowrap;
  }
  
  /* Team columns - more compact */
  .fixtures-table .team-col {
    gap: 4px !important;
    font-size: 0.75rem;
  }
  
  .fixtures-table .team-col img {
    width: 18px !important;
    height: 18px !important;
  }
  
  .fixtures-table .team-col span {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  /* Hide star buttons on mobile fixtures */
  .fixtures-table .fav-star {
    display: none;
  }
  
  /* VS column smaller */
  .fixtures-table .vs-col {
    font-size: 0.7rem;
    color: #94a3b8;
    padding: 0 2px !important;
  }
  
  /* GROUP TABLES - Mobile */
  .group-table {
    font-size: 0.75rem !important;
  }
  
  .group-table th,
  .group-table td {
    padding: 6px 3px !important;
  }
  
  /* Hide W/D/L on mobile - just show P, GD, Pts */
  .group-table th:nth-child(4),
  .group-table th:nth-child(5),
  .group-table th:nth-child(6),
  .group-table td:nth-child(4),
  .group-table td:nth-child(5),
  .group-table td:nth-child(6) {
    display: none !important;
  }
  
  .group-table .team-cell span {
    max-width: 80px;
    font-size: 0.75rem !important;
  }
  
  .group-table .team-cell img {
    width: 16px !important;
    height: 16px !important;
  }
  
  /* PLAYOFF TABLES - Mobile */
  .playoff-standings-table {
    font-size: 0.8rem;
  }
  
  .playoff-standings-table th,
  .playoff-standings-table td {
    padding: 8px 4px !important;
  }
  
  /* Hide W/D/L/GF/GA on mobile - just show P, GD, Pts */
  .playoff-standings-table th:nth-child(4),
  .playoff-standings-table th:nth-child(5),
  .playoff-standings-table th:nth-child(6),
  .playoff-standings-table th:nth-child(7),
  .playoff-standings-table th:nth-child(8),
  .playoff-standings-table td:nth-child(4),
  .playoff-standings-table td:nth-child(5),
  .playoff-standings-table td:nth-child(6),
  .playoff-standings-table td:nth-child(7),
  .playoff-standings-table td:nth-child(8) {
    display: none !important;
  }
}

/* Desktop: Hide info button, show all columns */
@media (min-width: 641px) {
  .teams-table .col-info,
  .teams-table th.col-info {
    display: none !important;
  }
  
  .teams-table .col-gp,
  .teams-table .col-gd,
  .teams-table .col-form,
  .teams-table th.col-gp,
  .teams-table th.col-gd,
  .teams-table th.col-form {
    display: table-cell !important;
  }
}

/* ========================================
   INFO POPUP - Team Details Modal
   ======================================== */

.team-info-popup {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  padding: 20px;
  z-index: 2050; /* Above back button (2000) */
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.team-info-popup.show {
  transform: translateY(0);
}

.team-info-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2040; /* Above back button (2000) */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.team-info-popup-overlay.show {
  opacity: 1;
  visibility: visible;
}

.team-info-popup-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.team-info-popup-header img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.team-info-popup-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.team-info-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-info-popup-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.team-info-popup-stat {
  background: #f8fafc;
  padding: 12px;
  border-radius: 10px;
  text-align: center;
}

.team-info-popup-stat .label {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 4px;
}

.team-info-popup-stat .value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
}

.team-info-popup-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.team-info-popup-form .form-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
}

.team-info-popup-form .form-dot.W { background: #22c55e; }
.team-info-popup-form .form-dot.D { background: #f59e0b; }
.team-info-popup-form .form-dot.L { background: #ef4444; }

/* Fix container overflow - NO horizontal scroll anywhere */
.step-content,
.teams-section,
.standings-wrapper,
.explorer-section,
.explorer-step {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100%;
}

/* Card content overflow fix */
.card-content,
.tournament-content {
  overflow-x: hidden !important;
}

/* Body - prevent horizontal scroll */
body {
  overflow-x: hidden;
}

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

/* ========================================
   DESKTOP ONLY / MOBILE ONLY CLASSES
   ======================================== */

@media (max-width: 640px) {
  .desktop-only {
    display: none !important;
  }
}

@media (min-width: 641px) {
  .mobile-only {
    display: none !important;
  }
}

/* ========================================
   INFO BUTTON MOBILE
   ======================================== */

.info-btn-mobile {
  display: none;
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.info-btn-mobile:hover,
.info-btn-mobile:active {
  background: #e2e8f0;
}

@media (max-width: 640px) {
  .info-btn-mobile {
    display: inline-flex;
  }
  
  /* Info button - top left corner like lock on gold cards */
  .league-card .info-btn,
  .tournament-card .info-btn,
  .country-competition-card .info-btn,
  .grid-card .info-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.9);
    border: none;
    cursor: pointer;
    padding: 0;
  }
  
  .info-btn .info-circle {
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    line-height: 1;
  }
}

/* ========================================
   GOLD / FINISHED CARDS (LOCKED)
   ======================================== */

.finished-card {
  background: linear-gradient(135deg, #fffdf7 0%, #fef9e7 100%) !important;
  border: 1.5px solid #d4af37 !important;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2) !important;
}

/* ========================================
   GREEN / ACTIVE WITH CHAMPION CARDS
   ======================================== */

.active-champion-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  cursor: pointer !important;
}

.active-champion-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

.active-champion-card span {
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  color: #475569 !important;
  font-family: inherit !important;
}

/* Override .grid-card span for finished cards - same font for tournament and winner */
.finished-card span {
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  font-family: inherit !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

/* Tournament name - all cards - MUST stay inside card */
.tournament-name {
  font-size: 0.65rem !important;
  font-weight: 600 !important;
  text-align: center !important;
  line-height: 1.15 !important;
  word-wrap: break-word !important;
  max-width: 100% !important;
  padding: 0 4px !important;
}

/* Tournament name - bold for finished */
.finished-card .tournament-name {
  font-weight: 700 !important;
}

/* Trophy emoji - bigger */
.finished-card .trophy-icon {
  font-size: 0.9rem !important;
}

/* Year - bigger */
.finished-card .year-badge {
  font-size: 0.6rem !important;
}

.finished-card-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  height: 100%;
}

.finished-badge-left {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 1rem;
  z-index: 5;
}

.finished-badge-right {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 1rem;
  z-index: 5;
}

.finished-league-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-bottom: 4px;
}

.finished-league-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: #78350f;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .finished-badge-left,
  .finished-badge-right {
    font-size: 0.85rem;
  }
  
  .finished-league-logo {
    width: 28px;
    height: 28px;
  }
  
  .finished-league-name {
    font-size: 0.65rem;
  }
}
