/* ============================================================
   COMPONENTS.CSS — COMPONENTES DE INTERFAZ UNIFICADOS
   Estándar de diseño: Dark Glassmorphism (Referencia: Minivoley)
   ============================================================ */

/* ===== BOTONES GENERALES ===== */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  font-family: var(--font-body, 'Outfit', sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #8e44ad, #9b59b6);
  color: #ffffff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: var(--c-muted, rgba(240, 244, 255, 0.7));
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.btn-success {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: #ffffff;
}

.btn-warning {
  background: linear-gradient(135deg, #e67e22, #f39c12);
  color: #ffffff;
}

.btn-danger {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  color: #ffffff;
}

/* ===== BOTONES DE PUNTUACIÓN (+/−) (ESTILO PÍLDORA) ===== */
.score-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
}

.score-controls .btn,
.btn-score {
  flex: 1;
  max-width: 120px;
  padding: 11px 10px;
  border-radius: 50px !important;
  font-family: var(--font-body, 'Outfit', sans-serif);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.score-controls .btn:hover,
.btn-score:hover {
  transform: scale(1.06);
}

.score-controls .btn:active,
.btn-score:active {
  transform: scale(0.96);
}

/* Botones para sumar punto del Equipo 1 (Local) */
#team1 .score-controls .btn-primary,
.team-local .score-controls .btn-primary,
.team-score:first-child .score-controls .btn-primary,
.btn-score.add.team-local {
  background: linear-gradient(135deg, #ff4757, #c0392b) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(255, 71, 87, 0.4) !important;
}

/* Botones para sumar punto del Equipo 2 (Visitante) */
#team2 .score-controls .btn-primary,
.team-visitor .score-controls .btn-primary,
.team-score:last-child .score-controls .btn-primary,
.btn-score.add.team-visitor {
  background: linear-gradient(135deg, #1e90ff, #0062d0) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(30, 144, 255, 0.4) !important;
}

/* Botones para restar punto (Ambos equipos) */
.score-controls .btn-secondary,
.btn-score.sub {
  background: rgba(255, 255, 255, 0.07) !important;
  color: var(--c-muted, rgba(240, 244, 255, 0.6)) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
}

.score-controls .btn-secondary:hover,
.btn-score.sub:hover {
  background: rgba(255, 255, 255, 0.13) !important;
  color: #ffffff !important;
}

/* ===== GRUPOS Y SECCIONES DE CONTROL ===== */
.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  backdrop-filter: none;
}

.control-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-muted2, rgba(240, 244, 255, 0.35));
  background: none;
  padding: 0 0 10px;
  width: auto;
  border-radius: 0;
  margin-bottom: 0;
}

.match-controls,
.export-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
  width: 100%;
}

.control-separator {
  width: 90%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  margin: 14px auto;
}

/* ===== BOTONES DE ACCIÓN (.btn-icon — ESTÁNDAR MINIVOLEY) ===== */
.btn-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  height: 80px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  color: #ffffff;
  font-family: var(--font-body, 'Outfit', sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  gap: 7px;
  position: relative;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.btn-icon i {
  font-size: 1.5rem;
  margin: 0;
}

.btn-icon:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.btn-icon:active {
  transform: scale(0.97);
}

.btn-icon::after {
  display: none !important; /* Desactivar tooltips obsoletos que molestan en móvil */
}

/* Colores de identidad según acción */
.btn-new-set,
#btn-new-set {
  background: linear-gradient(145deg, #1a7a4a, #27ae60) !important;
  box-shadow: 0 4px 14px rgba(39, 174, 96, 0.35) !important;
}

.btn-reset,
#reset-match,
#reset-all,
#btn-reset {
  background: linear-gradient(145deg, #922b21, #e74c3c) !important;
  box-shadow: 0 4px 14px rgba(231, 76, 60, 0.3) !important;
}

.btn-save,
#save-match,
#save-game,
#btn-save {
  background: linear-gradient(145deg, #1a5276, #2980b9) !important;
  box-shadow: 0 4px 14px rgba(41, 128, 185, 0.3) !important;
}

.btn-whatsapp,
#share-whatsapp,
#btn-whatsapp {
  background: linear-gradient(145deg, #0e7736, #25d366) !important;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3) !important;
}

.btn-share-current,
#share-score,
#share-current,
#btn-share {
  background: linear-gradient(145deg, #6c3483, #9b59b6) !important;
  box-shadow: 0 4px 14px rgba(155, 89, 182, 0.3) !important;
}

.btn-share-history,
#share-history {
  background: linear-gradient(145deg, #1c2833, #34495e) !important;
  box-shadow: 0 4px 14px rgba(52, 73, 94, 0.3) !important;
}

.btn-broadcast,
#broadcast-btn,
#start-broadcast,
#btn-broadcast {
  background: linear-gradient(145deg, #a04000, #e67e22) !important;
  box-shadow: 0 4px 14px rgba(230, 126, 34, 0.35) !important;
}

/* ===== BARRA DE TRANSMISIÓN EN DIRECTO ===== */
.live-status-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, rgba(200, 60, 40, 0.85), rgba(180, 40, 20, 0.85));
  border-radius: 12px;
  border: 1px solid rgba(255, 100, 80, 0.3);
  backdrop-filter: blur(10px);
  padding: 8px 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(200, 50, 30, 0.25);
  animation: slideDown 0.3s ease;
}

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

.live-status-content {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  flex: 1 1 auto;
}

.live-status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

.live-pulse {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: #ffffff;
}

.live-pulse i {
  color: #ff4757;
  animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 8px #ff4757; }
  50%      { opacity: 0.3; text-shadow: none; }
}

.btn-icon-small {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  color: #ffffff;
  font-size: 0.9rem;
}

.btn-icon-small:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.btn-stop-live {
  background: rgba(231, 76, 60, 0.5);
  border-color: rgba(231, 76, 60, 0.7);
}

/* ===== REGLAS E INFORMACIÓN DEL SET O JUEGO ===== */
.game-rules,
[class*="game-rules-"] {
  color: var(--c-gold, #ffd700);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.current-set-info,
[class*="current-set-info-"] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 9px 14px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.current-set-info strong,
[class*="current-set-info-"] strong {
  color: var(--c-gold, #ffd700);
}

/* ===== TARJETAS Y CONTENEDORES GLASSMORPHISM ===== */
.card {
  background: var(--c-glass, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--c-glass-border, rgba(255, 255, 255, 0.11));
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* ===== ELEMENTOS EDITABLES ===== */
.editable {
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  border-radius: 6px;
}

.editable:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* ===== MODALES (ESTILO DARK GLASSMORPHISM) ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.25s ease;
}

.modal-content {
  background: linear-gradient(160deg, #141030, #0d0a28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 26px 24px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  max-height: 90vh;
  overflow-y: auto;
  color: var(--c-text, #f0f4ff);
  animation: modalScaleUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalScaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
  margin-bottom: 18px;
  text-align: center;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted, rgba(240, 244, 255, 0.6));
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  font-size: 0.92rem;
  font-family: var(--font-body, 'Outfit', sans-serif);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: rgba(155, 89, 182, 0.6);
  box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.35);
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.modal .btn-primary {
  background: linear-gradient(135deg, #8e44ad, #9b59b6);
  border: none;
  border-radius: 50px;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 10px 22px;
}

.modal .btn-primary:hover {
  background: linear-gradient(135deg, #9b59b6, #a569bd);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(155, 89, 182, 0.4);
}

.modal .btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  color: var(--c-muted, rgba(240, 244, 255, 0.7));
  padding: 10px 20px;
}

.modal .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Card dentro de modal */
.modal-content .card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: none;
}

.modal-content .card:hover {
  transform: none;
}

/* ===== NOTIFICACIONES TOAST ===== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  padding: 12px 22px;
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(46, 204, 113, 0.4);
  z-index: 10005;
  display: none;
  align-items: center;
  gap: 10px;
  max-width: 350px;
  font-family: var(--font-body, 'Outfit', sans-serif);
  font-weight: 600;
  font-size: 0.88rem;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

.notification.warning {
  background: linear-gradient(135deg, #d35400, #f39c12);
  box-shadow: 0 8px 24px rgba(243, 156, 18, 0.4);
}

.notification.error {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  box-shadow: 0 8px 24px rgba(231, 76, 60, 0.4);
}

.notification.info {
  background: linear-gradient(135deg, #2980b9, #3498db);
  box-shadow: 0 8px 24px rgba(52, 152, 219, 0.4);
}

/* ===== HISTORIAL ===== */
.history {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 20px;
}

.history h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-muted, rgba(240, 244, 255, 0.6));
  margin-bottom: 14px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

.history h2 i {
  color: var(--c-gold, #ffd700);
}

.history-list {
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 6px;
}

.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.history-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  transition: background 0.2s ease;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.history-score {
  color: var(--c-gold, #ffd700);
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  font-weight: bold;
}

.empty-history {
  color: var(--c-muted, rgba(240, 244, 255, 0.5));
  font-size: 0.9rem;
  text-align: center;
  padding: 15px;
  font-style: italic;
}

/* ===== QR CODE ===== */
.qr-wrapper,
#qrcode-container {
  background: #ffffff;
  padding: 12px;
  border-radius: 14px;
  display: inline-block;
  margin: 12px auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  margin-top: 24px;
  padding: 18px 10px;
  color: var(--c-muted2, rgba(240, 244, 255, 0.25));
  font-size: 0.78rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-links {
  margin-top: 8px;
}

.footer-links a {
  color: var(--c-muted, rgba(240, 244, 255, 0.5));
  text-decoration: none;
  transition: color 0.2s ease;
  margin: 0 8px;
}

.footer-links a:hover {
  color: var(--c-gold, #ffd700);
}

/* ===== RESPONSIVE PARA COMPONENTES (MÓVIL) ===== */
@media (max-width: 600px) {
  .btn-icon {
    min-width: 70px;
    height: 70px;
    font-size: 0.68rem;
    padding: 6px;
    gap: 5px;
  }

  .btn-icon i {
    font-size: 1.35rem;
  }

  .match-controls,
  .export-controls {
    gap: 8px;
  }

  .score-controls .btn,
  .btn-score {
    padding: 9px 8px;
    font-size: 0.78rem;
  }
}

@media (max-width: 400px) {
  .btn-icon {
    min-width: 62px;
    height: 62px;
    font-size: 0.62rem;
    border-radius: 12px;
  }

  .btn-icon i {
    font-size: 1.2rem;
  }
}
