/* Archivo generado al dividir styles.css en bloques. */

/* =========================================================
   CBAT APP
   BLOQUE 7 — ESTADOS
   - loading
   - empty
   - error
   ========================================================= */

/* ===== CONTENEDORES DE ESTADO ===== */

.loading-state,
.empty-state,
.error-state {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  padding: 28px 20px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.loading-state p,
.empty-state p,
.error-state p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 700;
}

/* ===== LOADING ===== */

.loading-state {
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(244,247,251,0.98) 100%);
  color: var(--blue-strong);
}

.loading-state::before {
  content: "";
  display: block;
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border-radius: 999px;
  border: 4px solid rgba(68, 105, 157, 0.14);
  border-top-color: #44699D;
  animation: cbat-spin 0.9s linear infinite;
}

/* ===== EMPTY ===== */

.empty-state {
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,251,255,0.98) 100%);
  color: var(--text-soft);
}

.empty-state::before {
  content: "🏀";
  display: block;
  font-size: 30px;
  line-height: 1;
  margin-bottom: 12px;
}

/* ===== ERROR ===== */

.error-state {
  background: linear-gradient(180deg, rgba(255,250,250,0.98) 0%, rgba(255,243,243,0.98) 100%);
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.14);
}

.error-state::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(180, 35, 24, 0.10);
  color: #B42318;
  font-size: 24px;
  font-weight: 900;
}

/* ===== PLACEHOLDER LISTAS ===== */

.matches-list:empty,
#partidos-list:empty,
#equipo-partidos-list:empty {
  min-height: 120px;
}

/* ===== ANIMACIÓN ===== */

@keyframes cbat-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 640px) {
  .loading-state,
  .empty-state,
  .error-state {
    border-radius: 18px;
    padding: 24px 16px;
  }

  .loading-state p,
  .empty-state p,
  .error-state p {
    font-size: 14px;
  }

  .loading-state::before,
  .error-state::before {
    width: 38px;
    height: 38px;
    margin-bottom: 12px;
  }

  .empty-state::before {
    font-size: 26px;
    margin-bottom: 10px;
  }

}


/* ===== OVERLAY GLOBAL DE CARGA ===== */

body.is-app-loading {
  overflow: hidden;
}

.app-loading-overlay[hidden] {
  display: none !important;
}

.app-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(238,243,248,0.96) 0%, rgba(247,249,252,0.98) 100%);
  backdrop-filter: blur(6px);
}

.app-loading-overlay__box {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,251,255,0.98) 100%);
  box-shadow: var(--shadow-lg);
}

.app-loading-overlay__logo-wrap {
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(253,224,127,0.24), rgba(68,105,157,0.08));
}

.app-loading-overlay__logo {
  width: 112px;
  height: 112px;
  object-fit: contain;
  display: block;
}

.app-loading-overlay__title {
  margin: 0;
  color: var(--blue-strong);
  font-size: 24px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.app-loading-overlay__text {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.5;
  max-width: 28ch;
}

.app-loading-overlay__spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid rgba(68, 105, 157, 0.14);
  border-top-color: #44699D;
  animation: cbat-spin 0.9s linear infinite;
}


@media (max-width: 640px) {
  .app-loading-overlay {
    padding: 18px;
  }

  .app-loading-overlay__box {
    width: 100%;
    border-radius: 24px;
    padding: 24px 18px;
    gap: 12px;
  }

  .app-loading-overlay__logo-wrap {
    width: 112px;
    height: 112px;
  }

  .app-loading-overlay__logo {
    width: 88px;
    height: 88px;
  }

  .app-loading-overlay__title {
    font-size: 21px;
  }

  .app-loading-overlay__text {
    font-size: 15px;
  }
}

/* =========================================================
   CBAT APP
   BLOQUE 8 — RESPONSIVE FINAL / AJUSTES GLOBALES
   ========================================================= */

/* ===== IMÁGENES Y MEDIA ===== */

img,
svg,
canvas {
  max-width: 100%;
}

img {
  height: auto;
}

/* ===== SCROLL SUAVE INTERNO ===== */

html {
  scroll-behavior: smooth;
}

/* ===== SELECCIÓN DE TEXTO ===== */

button,
select,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

/* ===== VISTAS / PANELES ===== */

.view-section,
.tab-panel {
  width: 100%;
}

.tab-panel {
  animation: cbat-fade-in 0.2s ease;
}

/* ===== ANIMACIÓN SUAVE ===== */

@keyframes cbat-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ESPACIADOS GENERALES ===== */

.panel + .panel {
  margin-top: 16px;
}

.site-header + .main-content {
  padding-top: 14px;
}

/* ===== CONTENEDORES LARGOS ===== */

.panel,
.match-card,
.loading-state,
.empty-state,
.error-state,
.stats-card,
.stats-panel,
.counters-card {
  min-width: 0;
}

/* ===== OVERFLOW DEFENSIVO ===== */

.panel *,
.match-card *,
.stats-card *,
.stats-panel *,
.counters-card * {
  min-width: 0;
}

/* ===== DESKTOP GRANDE ===== */

@media (min-width: 1200px) {
  .main-content {
    max-width: 1180px;
  }
}

/* ===== TABLET ===== */

@media (max-width: 900px) {
  .main-content {
    padding: 14px;
    padding-bottom: 92px;
  }

  .panel + .panel {
    margin-top: 14px;
  }
}

/* ===== MÓVIL ===== */

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .main-content {
    padding: 12px;
    padding-bottom: 94px;
  }

  .panel {
    border-radius: 18px;
    padding: 15px;
    margin-bottom: 14px;
  }

  .panel-header {
    margin-bottom: 10px;
  }

  .panel-header h2 {
    font-size: 17px;
  }

  .site-header + .main-content {
    padding-top: 10px;
  }
}

/* ===== MÓVIL PEQUEÑO ===== */

@media (max-width: 420px) {
  .main-content {
    padding: 10px;
    padding-bottom: 96px;
  }

  .panel {
    padding: 12px;
    border-radius: 16px;
  }

  .panel-header h2 {
    font-size: 16px;
  }
}

/* =========================================================
   B13 — BOTONES JORNADA EN UNA MISMA FILA
   ========================================================= */

.share-box__actions--jornada {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.share-box__actions--jornada .btn {
  width: 100%;
  min-width: 0;
  min-height: 72px;
  padding: 14px 16px;
  margin: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  line-height: 1.15;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;

  font-size: 16px;
}

#btn-compartir,
#btn-imagen-jornada {
  width: 100%;
}
/* Más separación entre último partido y bloque de acciones */
.section-block.share-box {
  margin-top: 20px;
}

