/* ============================================================
   VALMUR MUNDIALISTA 2026 - Estilos Personalizados
   Archivo: assets/css/custom.css
   Complementa Tailwind con estilos específicos del design system
   ============================================================ */

/* ----- Tipografía Material Symbols ----- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ----- Glassmorphism (paneles translúcidos) ----- */
.glass-panel,
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Variante más opaca para cards de leaderboard */
.glass-card {
    background: rgba(50, 53, 54, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* ----- Gradientes de fondo ----- */
.stadium-gradient {
    background: radial-gradient(circle at top center, #1a237e 0%, #111415 100%);
}

.pitch-gradient {
    background: radial-gradient(circle at center, #1b6d24 0%, #111415 70%);
}

.broadcast-overlay {
    background: linear-gradient(180deg, rgba(29, 32, 33, 0.8) 0%, rgba(12, 15, 16, 0.95) 100%);
}

/* ----- Live / Pulse animations ----- */
.pulse-live {
    animation: pulse-live-anim 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-live-anim {
    0%, 100% { opacity: 1; }
    50%      { opacity: .5; }
}

/* ----- Gold glow (para ganadores y trofeo) ----- */
.gold-glow {
    box-shadow: 0 0 15px rgba(248, 189, 42, 0.2);
}

/* ----- Active glow (bracket ganador vivo) ----- */
.active-glow {
    box-shadow: 0 0 25px rgba(46, 125, 50, 0.3);
}

/* ----- Animación de pulso dorado (live draw) ----- */
@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248, 189, 42, 0.4); }
    50%      { box-shadow: 0 0 20px 10px rgba(248, 189, 42, 0.2); }
}

.animate-draw-pulse {
    animation: pulse-gold 2s infinite;
}

/* ----- Spin de la pelota (live draw) ----- */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.ball-spin {
    animation: spin 3s linear infinite;
}

/* ----- Balon 2D plano (gira como una moneda) -----
   Rotacion 2D (rotateZ) en lugar de 3D, porque la imagen es
   plana (PNG). Sin perspective, sin scaleX, sin distorsion. */
.ball-spin-flat {
    transform-origin: 50% 50%;
    animation: ball-flat-spin 6s linear infinite;
    filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.5));
    will-change: transform;
}

@keyframes ball-flat-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ----- Scrollbar personalizado (bracket horizontal) ----- */
.tournament-scroll::-webkit-scrollbar {
    height: 8px;
}
.tournament-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}
.tournament-scroll::-webkit-scrollbar-thumb {
    background: #2e7d32;
    border-radius: 4px;
}

/* ----- Connector lines (bracket) ----- */
.connector-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
}

/* ----- Toasts (notificaciones UI) ----- */
.toast-container {
    position: fixed;
    top: 100px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: rgba(29, 32, 33, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid #88d982;
    color: #e1e3e4;
    padding: 14px 20px;
    border-radius: 12px;
    min-width: 280px;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    animation: toast-slide-in 0.3s ease-out;
}

.toast.toast-error  { border-left-color: #ffb4ab; }
.toast.toast-warning { border-left-color: #f8bd2a; }
.toast.toast-info    { border-left-color: #bdc2ff; }

@keyframes toast-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

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

@keyframes toast-fade-out {
    to { transform: translateX(100%); opacity: 0; }
}

/* ----- Modal genérico ----- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-content {
    background: #1d2021;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    max-width: 480px;
    width: 100%;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ----- Botones con feedback táctil ----- */
button:not(:disabled) {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

/* ----- Utilidad: truncar texto con ellipsis ----- */
.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ----- Highlight de nuevo registro (live-display) ----- */
@keyframes newRowPulse {
    0% {
        background-color: rgba(136, 217, 130, 0.35);
        box-shadow: inset 0 0 30px rgba(136, 217, 130, 0.3);
    }
    100% {
        background-color: transparent;
        box-shadow: inset 0 0 0 rgba(136, 217, 130, 0);
    }
}

.new-row-highlight {
    animation: newRowPulse 2.5s ease-out;
}

/* ----- Skeleton (loading shimmer) ----- */
@keyframes shimmer {
    0%   { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 100%);
    background-size: 1000px 100%;
    animation: shimmer 1.8s linear infinite;
    border-radius: 0.5rem;
}

/* ----- Smooth transitions para cards dinámicas ----- */
.fade-in {
    animation: fade-in 0.3s ease-out;
}

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

/* ----- Scrollbar global ----- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #111415;
}
::-webkit-scrollbar-thumb {
    background: #323536;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #40493d;
}
