/* MATCH_CARDS.CSS - ScorePulse V9.5 Dark Glass */

/* VIEWS */
.view { display: flex; flex-direction: column; gap: 16px; }
.view.hidden { display: none; }

/* VIEW HEADER */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.view-title {
  font-family: var(--font-tactical);
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-title-icon { font-size: 15px; }

.view-title-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--green-bright);
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 10px;
  padding: 2px 8px;
}

/* VIEW PLACEHOLDER */
.view-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 12px;
}

.placeholder-icon { font-size: 40px; opacity: 0.3; }

.placeholder-text {
  font-family: var(--font-tactical);
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.placeholder-sub {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  max-width: 320px;
  line-height: 1.6;
}

.section-title {
  font-family: var(--font-tactical);
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 14px;
  background: linear-gradient(180deg, var(--purple-bright), var(--purple));
  box-shadow: 0 0 10px var(--purple);
  border-radius: 2px;
}

.btn-reboot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: var(--radius);
  color: var(--purple-bright);
  font-size: 10px;
  font-family: var(--font-tactical);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: var(--transition);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.btn-reboot:hover {
  background: rgba(139,92,246,0.16);
  border-color: var(--purple);
  box-shadow: 0 0 20px rgba(139,92,246,0.2);
}

.btn-reboot.spinning .reboot-icon { animation: spin 0.6s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

/* MATCH GRID — agora é container de secções de liga */
.match-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* LEAGUE SECTION */
.league-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.league-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}

.league-section-header:hover {
  background: rgba(255,255,255,0.055);
}

.league-section-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.league-flag {
  font-size: 14px;
  line-height: 1;
}

.league-section-logo {
  width: 20px; height: 20px;
  object-fit: contain;
  opacity: 0.85;
}

.league-section-name {
  font-family: var(--font-tactical);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
}

.league-section-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.league-section-count {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--green-bright);
  letter-spacing: 0.5px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 10px;
  padding: 2px 8px;
}

.league-section-chevron {
  font-size: 11px;
  color: var(--text-dim);
  transition: transform var(--transition);
}

.league-section.collapsed .league-section-chevron {
  transform: rotate(-90deg);
}

.league-section.collapsed .league-section-grid {
  display: none;
}

/* GRID INTERNO DE CARDS */
.league-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* MARKET PILLS */
.card-markets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 8px;
  margin-top: 6px;
  border-top: 1px solid var(--glass-border);
}

.market-pill {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid transparent;
}

.market-pill.off {
  color: var(--text-dim);
  border-color: rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  opacity: 0.5;
}

.market-pill.watch {
  color: var(--purple-bright);
  border-color: rgba(139,92,246,0.3);
  background: rgba(139,92,246,0.08);
}

.market-pill.signal {
  color: #000;
  background: var(--green-bright);
  border-color: var(--green-bright);
  animation: pill-pulse 1.5s ease-in-out infinite;
}

@keyframes pill-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.4); }
  50%       { box-shadow: 0 0 8px 3px rgba(52,211,153,0.2); }
}

/* MATCH CARD */
.match-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  min-height: 128px;
  animation: card-in 0.4s ease both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.match-card:hover {
  border-color: rgba(139,92,246,0.25);
  background: var(--bg-card-hover);
  box-shadow: 0 4px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(139,92,246,0.1);
}

/* Linha colorida esquerda por intensidade */
.match-card::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--purple), var(--green));
  opacity: 0.5;
}

/* CARD HEADER ROW */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* TIME BADGE */
.card-time {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 4px;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--green-bright);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* LEAGUE LOGO */
.card-league {
  display: flex;
  align-items: center;
}
.league-logo {
  width: 18px; height: 18px;
  object-fit: contain;
  opacity: 0.7;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

/* RED CARD BADGE */
.card-rc {
  font-size: 8px;
  line-height: 1;
  display: block;
  margin-top: 2px;
}

/* CARD BODY */
.card-body {
  display: grid;
  grid-template-columns: 1fr 80px 58px 110px 36px;
  align-items: center;
  gap: 12px;
}

/* TEAMS + SCORE */
.card-teams-score {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.team-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 58px;
  max-width: 68px;
}

.team-logo {
  width: 32px; height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.team-logo-placeholder {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-dim);
}

.team-name {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

.card-score {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--green-bright);
  text-shadow: 0 0 24px rgba(52,211,153,0.5);
  letter-spacing: 2px;
  flex-shrink: 0;
  text-align: center;
  min-width: 52px;
}

/* PRESSURE — zona compacta, largura fixa */
.card-pressure {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 80px;
  flex-shrink: 0;
}

.pressure-label {
  font-size: 7px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-family: var(--font-mono);
  opacity: 0.6;
}

.pressure-map {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 20px;
}

.p-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
}

.p-bar.home { background: var(--purple-bright); opacity: 0.8; }
.p-bar.away { background: var(--green-bright); opacity: 0.7; }

/* AI RING — SVG animado */
.ai-ring-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 58px;
}

.ai-ring-svg {
  width: 52px; height: 52px;
  transform: rotate(-90deg);
}

.ai-ring-bg {
  fill: none;
  stroke: rgba(139,92,246,0.15);
  stroke-width: 3;
}

.ai-ring-fill {
  fill: none;
  stroke: var(--purple-bright);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 126;
  stroke-dashoffset: 126;
  filter: drop-shadow(0 0 4px var(--purple));
  transition: stroke-dashoffset 1.2s ease;
}

.ai-ring-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ai-ring-container {
  position: relative;
  width: 52px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-ring-container .ai-ring-svg { position: absolute; inset: 0; }

.ai-pct {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-bright);
  line-height: 1;
  position: relative;
  z-index: 1;
}

.ai-label-text {
  font-size: 7px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* STATS */
.card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  row-gap: 8px;
  column-gap: 12px;
  flex-shrink: 0;
}

.stat-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 4px 0;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.stat-lbl {
  font-size: 7.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

/* ACTION BUTTONS */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.btn-action {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 12px;
  transition: var(--transition);
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(4px);
  text-decoration: none;
}

.btn-action:hover {
  border-color: var(--green);
  color: var(--green-bright);
  box-shadow: 0 0 10px rgba(16,185,129,0.2);
  background: rgba(16,185,129,0.08);
}

.btn-action.whatsapp:hover {
  border-color: #25d366;
  color: #25d366;
  box-shadow: 0 0 10px rgba(37,211,102,0.2);
  background: rgba(37,211,102,0.06);
}

/* ESTADOS */
.no-games {
  grid-column: 1 / -1;
  text-align: center;
  padding: 70px 20px;
  color: var(--text-dim);
}

.no-games-icon { font-size: 36px; margin-bottom: 14px; opacity: 0.5; }
.no-games-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; }
.no-games-sub  { font-size: 11px; color: var(--text-dim); }

/* LOCK OVERLAY */
.lock-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, #0e0b1a 0%, #050508 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}

.lock-overlay.hidden { opacity: 0; pointer-events: none; }

.pin-terminal {
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 14px;
  padding: 40px 48px;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(24px);
  box-shadow: 0 0 80px rgba(139,92,246,0.15), 0 24px 64px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 300px;
}

.terminal-brand {
  font-family: var(--font-tactical);
  font-size: 20px;
  background: linear-gradient(90deg, #fff, var(--purple-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}

.terminal-header {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

#pin-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--purple-bright);
  letter-spacing: 10px;
  text-align: center;
  width: 180px;
  outline: none;
  transition: var(--transition);
}

#pin-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 20px rgba(139,92,246,0.2);
}

.pin-error {
  font-size: 10px;
  color: var(--red);
  letter-spacing: 1px;
  font-family: var(--font-mono);
  opacity: 0;
  transition: opacity 0.3s;
}

.pin-error.visible { opacity: 1; }

/* ─── GOAL ANIMATIONS ───────────────────────────────────────────── */

@keyframes goal-card-flash {
  0%   { border-color: var(--glass-border); box-shadow: none; }
  12%  { border-color: var(--green-bright); box-shadow: 0 0 0 2px rgba(52,211,153,0.4), 0 0 32px rgba(52,211,153,0.5); }
  35%  { border-color: rgba(52,211,153,0.6); box-shadow: 0 0 0 1px rgba(52,211,153,0.2), 0 0 20px rgba(52,211,153,0.3); }
  55%  { border-color: var(--green-bright); box-shadow: 0 0 0 2px rgba(52,211,153,0.35), 0 0 28px rgba(52,211,153,0.4); }
  100% { border-color: var(--glass-border); box-shadow: none; }
}

@keyframes goal-score-pop {
  0%   { color: var(--green-bright); transform: scale(1);    text-shadow: 0 0 24px rgba(52,211,153,0.5); }
  18%  { color: #ffffff;             transform: scale(1.35); text-shadow: 0 0 40px #fff, 0 0 20px rgba(52,211,153,0.9); }
  45%  { color: var(--green-bright); transform: scale(1.18); text-shadow: 0 0 28px rgba(52,211,153,0.7); }
  100% { color: var(--green-bright); transform: scale(1);    text-shadow: 0 0 24px rgba(52,211,153,0.5); }
}

.match-card.goal-flash {
  animation: goal-card-flash 1.8s ease forwards;
}

.match-card.goal-flash .card-score {
  animation: goal-score-pop 1.2s cubic-bezier(0.22,1,0.36,1) forwards;
}

/* ─── GOAL TOAST ────────────────────────────────────────────────── */

#goal-toasts {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.goal-toast {
  background: rgba(8, 10, 20, 0.96);
  border: 1px solid var(--green-bright);
  border-radius: 10px;
  padding: 12px 14px 12px 16px;
  min-width: 270px;
  max-width: 340px;
  box-shadow: 0 0 30px rgba(52,211,153,0.28), 0 8px 32px rgba(0,0,0,0.65);
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: all;
  cursor: pointer;
  animation: toast-slide-in 0.4s cubic-bezier(0.16,1,0.3,1) both;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.goal-toast::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green-bright), var(--purple-bright));
}

.goal-toast.toast-out {
  animation: toast-slide-out 0.3s ease forwards;
}

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(60px) scale(0.93); }
  to   { opacity: 1; transform: translateX(0)    scale(1);    }
}

@keyframes toast-slide-out {
  from { opacity: 1; transform: translateX(0)    scale(1);    max-height: 200px; }
  to   { opacity: 0; transform: translateX(70px) scale(0.93); max-height: 0;     padding-top: 0; padding-bottom: 0; }
}

.toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.toast-goal-badge {
  font-family: var(--font-tactical);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--green-bright);
  display: flex;
  align-items: center;
  gap: 7px;
  text-shadow: 0 0 10px rgba(52,211,153,0.5);
}

.toast-goal-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 8px var(--green-bright);
  animation: pulse-dot 1s ease-in-out infinite;
  flex-shrink: 0;
}

.toast-close {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  transition: var(--transition);
}

.toast-close:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.3);
}

.toast-match {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-teams {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  letter-spacing: 0.3px;
  flex-wrap: nowrap;
}

/* Equipa que marcou — destaque verde */
.toast-scorer {
  color: var(--green-bright);
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(52,211,153,0.45);
}

/* Equipa que não marcou — mais discreta */
.toast-team-dim {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0.75;
}

/* "vs" separador */
.toast-vs {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
  opacity: 0.5;
  flex-shrink: 0;
}

.toast-score {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--green-bright);
  text-shadow: 0 0 16px rgba(52,211,153,0.6);
  letter-spacing: 2px;
  flex-shrink: 0;
}

.toast-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.toast-minute {
  color: var(--green-bright);
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 3px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.toast-league {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--green-bright), var(--purple-bright));
  transform-origin: left center;
  animation: toast-progress-bar 6s linear forwards;
}

@keyframes toast-progress-bar {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ─── SIDEBAR SOUND TOGGLE ───────────────────────────────────────────────── */
.sidebar-sound-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 12px;
  margin-bottom: 8px;
  background: rgba(167,139,250,.07);
  border: 1px solid rgba(167,139,250,.18);
  border-radius: 8px;
  color: var(--text-b);
  font-size: 11px;
  font-family: var(--mono);
  cursor: pointer;
  transition: background .2s, color .2s;
  text-align: left;
}
.sidebar-sound-btn:hover { background: rgba(167,139,250,.14); color: #fff; }
.sidebar-sound-btn.muted { color: var(--text-d); border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.03); }
