/* ============================================================================
   VALESANITO STANDALONE WEB APP - STYLESHEET (DARK APP THEME)
   ============================================================================ */

:root {
  --color-primary: #E31A22;
  --color-primary-glow: rgba(227, 26, 34, 0.25);
  --color-accent: #00E676;
  --color-star: #FFD700;
  
  --color-bg: #121216;
  --color-surface: #1C1C22;
  --color-card: #25252E;
  --color-border: #32323E;
  
  --color-text-main: #FFFFFF;
  --color-text-muted: #A0A0B0;
  --color-text-sub: #727282;

  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--color-bg);
  color: var(--color-text-main);
  font-family: var(--font-family);
  font-size: 15px;
  overflow: hidden;
  user-select: none;
}

/* APP ROOT & LAYOUT */
#app-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* Adaptación dinámica a navegadores móviles iOS/Android */
  width: 100%;
  max-width: 600px; /* Sensación de App en Desktop */
  margin: 0 auto;
  position: relative;
  background-color: var(--color-bg);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* HEADER SUPERIOR CON BREADCRUMBS Y BOTÓN VOLVER */
.app-header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 16px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 100;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-back-btn {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 0 10px var(--color-primary-glow);
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.home-banner-logo {
  max-height: 75px;
  max-width: 200px;
  object-fit: contain;
  margin: 0 auto 10px auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.home-banner-emoji {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 8px;
  display: inline-block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-name span {
  color: var(--color-primary);
}

.brand-edition {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  color: var(--color-star);
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* BREADCRUMBS DE PROFUNDIDAD (OCULTOS SEGÚN SOLICITUD DE DISEÑO) */
.app-breadcrumbs-bar {
  display: none !important;
}

/* VIEWPORT CONTENT */
.app-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
  -webkit-overflow-scrolling: touch;
}

/* LOADING SPINNER */
.app-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 250px;
  gap: 12px;
  color: var(--color-text-muted);
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* BARRA INFERIOR DE NAVEGACIÓN (BOTTOM APP BAR ADAPTABLE A TODOS LOS NAVEGADORES) */
.bottom-nav {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  min-height: 64px;
  padding-top: 6px;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  height: 100%;
  transition: color 0.2s ease;
}

.nav-item .nav-icon {
  font-size: 1.25rem;
}

.nav-item.active {
  color: var(--color-primary);
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
}

/* CARDS & COMPONENTES */
.home-banner {
  background: linear-gradient(135deg, rgba(227,26,34,0.15) 0%, rgba(28,28,34,0.9) 100%);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.home-banner h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.home-banner p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* SPONSORS SLIDER / GRID */
.section-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* SPONSORS CAROUSEL (GRANDES SIN TEXTO) */
.sponsors-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 4px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.sponsors-carousel::-webkit-scrollbar {
  display: none;
}

.sponsor-carousel-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  background: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
  width: 180px;
  height: 80px;
  overflow: hidden;
  box-sizing: border-box;
}

.sponsor-carousel-item:active {
  transform: scale(0.96);
}

.sponsor-carousel-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.sponsor-fallback-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #18181C;
  line-height: 1.2;
  padding: 4px 8px;
}

/* BUSCADOR Y DIRECTORIO DE CLUBES */
.club-search-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-main);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.club-search-input:focus {
  border-color: var(--color-primary);
}

.clubes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.club-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.club-card:active {
  transform: scale(0.98);
}

.club-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.club-shield-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 6px;
}

.club-shield-fallback {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-primary);
}

.club-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--color-text-main);
}

.club-meta {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.shield-fav-btn {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 1rem;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.shield-fav-btn.is-fav {
  background: rgba(227, 26, 34, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 800;
}

/* DOCUMENTOS DESCARGABLES */
.docs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.doc-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-icon {
  font-size: 1.5rem;
}

.doc-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text-main);
}

.doc-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* BARRA Y NAVEGACIÓN DE FECHAS (DATES NAV BAR) */
.dates-nav-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  padding: 10px 6px 14px 6px;
  margin-bottom: 12px;
  min-height: 60px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.dates-nav-bar::-webkit-scrollbar {
  display: none;
}

.date-pill {
  min-width: auto;
  height: 40px;
  padding: 0 18px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  flex-shrink: 0;
  white-space: nowrap;
  box-sizing: border-box;
  touch-action: manipulation;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.date-pill .pill-top {
  display: none !important;
}

.date-pill .pill-bottom {
  font-size: 0.88rem;
  font-weight: 800;
  margin-top: 0;
  color: var(--color-text-main);
  white-space: nowrap;
}

.date-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(227, 26, 34, 0.6);
  transform: scale(1.02);
}

.date-pill.active .pill-bottom {
  color: #FFFFFF !important;
}

/* CATEGORÍAS GRID */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:active {
  transform: scale(0.97);
}

.category-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-text-main);
}

.category-card span {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* CANCHAS GRID & CARDS */
.canchas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 480px) {
  .canchas-grid {
    grid-template-columns: 1fr;
  }
}

.cancha-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.cancha-card:active {
  transform: scale(0.98);
}

.cancha-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cancha-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(227, 26, 34, 0.1);
  border: 1px solid rgba(227, 26, 34, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.cancha-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-text-main);
  margin-bottom: 2px;
}

.cancha-meta {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* SUBTABS & PILLS */
.subtabs-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.pills-scroll-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.pills-scroll-row::-webkit-scrollbar {
  display: none;
}

.pill-item {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.pill-item.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #FFF;
}

/* MATCH CARDS */
.match-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 6px;
}

.match-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.7rem;
}

.status-jugado {
  background: rgba(0, 230, 118, 0.15);
  color: var(--color-accent);
}

.status-pendiente {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
}

.match-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.match-time-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 45px;
  border-right: 1px solid var(--color-border);
  padding-right: 8px;
}

.match-time {
  font-weight: 700;
  font-size: 0.85rem;
}

.match-turn {
  font-size: 0.7rem;
  color: var(--color-text-sub);
}

.match-teams-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.team-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-shield {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: contain;
  background: transparent;
  flex-shrink: 0;
}

.team-shield-fallback {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--color-text-main);
  flex-shrink: 0;
}

.team-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.team-score {
  font-size: 1rem;
  font-weight: 800;
  width: 24px;
  text-align: center;
}

.team-score.winner {
  color: var(--color-accent);
}

.match-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--color-text-sub);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 6px;
}

/* STANDINGS TABLE */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.standings-table th {
  background: var(--color-surface);
  color: var(--color-text-muted);
  text-align: center;
  padding: 8px 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.standings-table th.th-team {
  text-align: left;
  padding-left: 8px;
}

.standings-table td {
  padding: 10px 4px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.standings-table td.td-team {
  text-align: left;
  font-weight: 600;
  padding-left: 8px;
  cursor: pointer;
}

.standings-table td.td-pts {
  font-weight: 800;
  color: var(--color-primary);
}

/* EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-muted);
  gap: 10px;
}

.empty-state-icon {
  font-size: 2.5rem;
}

/* MODAL SHEET */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: var(--color-surface);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
  position: relative;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--color-card);
  border: none;
  color: var(--color-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
}
