/* ============================================================
   REELS - EXPERIENCIA TIKTOK PARA CARTAS BORI
   ACTUALIZADO: MÁS COMPACTO, MEJOR APROVECHAMIENTO DE ESPACIO
   ============================================================
   FULLSCREEN - SIN PADDING - FONDO NEGRO FORZADO
   ============================================================ */

/* ============================================================
   OVERLAY PRINCIPAL - PANTALLA COMPLETA
   ============================================================ */
.reels-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: #000000 !important;
    display: none;
    flex-direction: column;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.reels-overlay.active {
    display: flex;
}

/* ============================================================
   HEADER - BARRA SUPERIOR COMPACTA
   ============================================================ */
.reels-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 100%);
    pointer-events: none;
}

.reels-header > * {
    pointer-events: auto;
}

.reels-header .btn-back {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 60px;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.reels-header .btn-back:hover {
    background: rgba(255,255,255,0.2);
}

.reels-header .btn-back i {
    font-size: 0.7rem;
}

.reels-header .reels-title {
    color: white;
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.reels-header .reels-counter {
    color: rgba(255,255,255,0.4);
    font-size: 0.6rem;
    font-weight: 600;
    background: rgba(0,0,0,0.3);
    padding: 2px 8px;
    border-radius: 60px;
    backdrop-filter: blur(4px);
}

/* ============================================================
   CONTAINER - FONDO NEGRO
   ============================================================ */
.reels-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    touch-action: none;
    height: 100%;
    width: 100%;
    background: #000000 !important;
}

.reels-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    touch-action: none;
    background: #000000 !important;
}

.reels-track.dragging {
    transition: none;
}

/* ============================================================
   SLIDE - FULLSCREEN (SIN PADDING)
   ============================================================ */
.reels-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    box-sizing: border-box;
    touch-action: none;
    will-change: transform;
    background: #000000 !important;
}

/* ============================================================
   WRAPPER - FULLSCREEN (SIN MAX-HEIGHT, SIN BORDES)
   ============================================================ */
.reels-slide .card-wrapper-fullscreen {
    width: 100%;
    height: 100%;
    max-height: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0 !important;
    overflow: hidden;
    background: #000000 !important;
    position: relative;
    touch-action: none;
}

.reels-slide .card-wrapper-fullscreen img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    display: block;
    background: #000000 !important;
    touch-action: none;
    pointer-events: none;
}

/* Placeholder cuando no hay imagen */
.reels-slide .card-wrapper-fullscreen .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000000 !important;
    color: #94a3b8;
    font-size: 2rem;
    text-align: center;
}

/* ============================================================
   OVERLAY DE INFORMACIÓN - PIE DE CARTA MÁS COMPACTO
   ============================================================ */
.reels-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 12px 8px 12px;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
    pointer-events: none;
}

.reels-info > * {
    pointer-events: auto;
}

.reels-info .reels-team {
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reels-info .reels-fixture {
    color: rgba(255,255,255,0.5);
    font-size: 0.6rem;
    font-weight: 400;
    margin-top: 1px;
}

.reels-info .reels-player {
    color: rgba(255,255,255,0.3);
    font-size: 0.55rem;
    font-weight: 300;
    margin-top: 1px;
}

.reels-info .reels-user {
    font-size: 0.45rem;
    color: rgba(255,255,255,0.2);
    margin-top: 1px;
}

/* ============================================================
   ACCIONES FLOTANTES - LATERAL DERECHO MÁS COMPACTO
   ============================================================ */
.reels-actions {
    position: absolute;
    right: 10px;
    bottom: 90px;
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.reels-actions > * {
    pointer-events: auto;
}

.reels-actions .btn-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.reels-actions .btn-action:hover {
    transform: scale(1.08);
    background: rgba(255,255,255,0.2);
}

.reels-actions .btn-action:active {
    transform: scale(0.92);
}

.reels-actions .btn-action.btn-share {
    background: rgba(139, 92, 246, 0.5);
}

.reels-actions .btn-action.btn-share:hover {
    background: rgba(139, 92, 246, 0.7);
}

.reels-actions .btn-action.btn-duel {
    background: rgba(34, 197, 94, 0.5);
}

.reels-actions .btn-action.btn-duel:hover {
    background: rgba(34, 197, 94, 0.7);
}

.reels-actions .btn-action.btn-download {
    background: rgba(0, 102, 204, 0.5);
}

.reels-actions .btn-action.btn-download:hover {
    background: rgba(0, 102, 204, 0.7);
}

.reels-actions .btn-action.btn-delete {
    background: rgba(239, 68, 68, 0.5);
}

.reels-actions .btn-action.btn-delete:hover {
    background: rgba(239, 68, 68, 0.7);
}

.reels-actions .btn-action .tooltip {
    position: absolute;
    right: 48px;
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 0.5rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.reels-actions .btn-action:hover .tooltip {
    opacity: 1;
}

/* ============================================================
   INDICADOR DE PROGRESO (PUNTOS)
   ============================================================ */
.reels-progress {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 12;
    display: flex;
    flex-direction: column;
    gap: 3px;
    pointer-events: none;
}

.reels-progress .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all 0.3s;
}

.reels-progress .dot.active {
    background: white;
    height: 14px;
    border-radius: 3px;
    width: 3px;
}

.reels-progress .dot.visited {
    background: rgba(255,255,255,0.5);
}

/* ============================================================
   INDICADOR DE SWIPE MÁS COMPACTO
   ============================================================ */
.reels-swipe-indicator {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: rgba(255,255,255,0.15);
    font-size: 0.5rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: pulseOpacity 2s ease-in-out infinite;
    pointer-events: none;
}

.reels-swipe-indicator i {
    font-size: 0.7rem;
}

@keyframes pulseOpacity {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.5; }
}

/* ============================================================
   ESTADO DE CARGA
   ============================================================ */
.reels-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    text-align: center;
    color: rgba(255,255,255,0.5);
}

.reels-loading .spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.05);
    border-top: 3px solid #f59e0b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.reels-loading p {
    margin-top: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.reels-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    text-align: center;
    color: rgba(255,255,255,0.3);
}

.reels-empty .icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 12px;
}

.reels-empty p {
    font-size: 0.9rem;
    font-weight: 500;
}

.reels-empty .sub {
    font-size: 0.7rem;
    font-weight: 300;
    margin-top: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .reels-header {
        padding: 6px 10px;
    }
    
    .reels-header .btn-back {
        padding: 3px 8px;
        font-size: 0.55rem;
    }
    
    .reels-header .reels-title {
        font-size: 0.7rem;
    }
    
    .reels-header .reels-counter {
        font-size: 0.5rem;
        padding: 2px 6px;
    }
    
    .reels-actions {
        right: 6px;
        bottom: 70px;
        gap: 6px;
    }
    
    .reels-actions .btn-action {
        width: 34px;
        height: 34px;
        font-size: 0.8rem;
    }
    
    .reels-info {
        padding: 8px 10px 6px 10px;
    }
    
    .reels-info .reels-team {
        font-size: 0.7rem;
    }
    
    .reels-info .reels-fixture {
        font-size: 0.5rem;
    }
    
    .reels-progress {
        right: 6px;
        gap: 2px;
    }
    
    .reels-progress .dot {
        width: 2px;
        height: 2px;
    }
    
    .reels-progress .dot.active {
        height: 10px;
        width: 2px;
    }
    
    .reels-swipe-indicator {
        bottom: 40px;
        font-size: 0.45rem;
    }
    
    .reels-swipe-indicator i {
        font-size: 0.6rem;
    }
}

/* ============================================================
   ANIMACIONES
   ============================================================ */
.reels-slide-enter {
    animation: slideUpEnter 0.4s ease-out;
}

.reels-slide-exit {
    animation: slideUpExit 0.3s ease-in;
}

@keyframes slideUpEnter {
    from { opacity: 0.5; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideUpExit {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0.5; transform: translateY(-30px) scale(0.95); }
}