/* Estilos para el reproductor de video en streaming - Versión Compacta */
.video-stream-container {
    width: 100%;
    max-width: 500px; /* Más compacto */
    margin: 5px auto; /* Menos margen */
    background: #1a1a1a;
    border-radius: 6px; /* Borde más sutil */
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.2s ease;
}

.video-player {
    width: 100%;
    position: relative;
    padding-top: 42.25%; /* Relación de aspecto más compacta (casi 21:9) */
    background-color: #000;
}

.video-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-controls {
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px; /* Aún más compacto */
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: all 0.2s ease;
    opacity: 0.9; /* Menos transparente para mejor visibilidad */
    height: 36px; /* Altura fija para controles */
}

.video-player:hover .video-controls {
    opacity: 1; /* Más opaco al hacer hover */
}

.video-player:hover .video-controls {
    opacity: 1;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1em; /* Tamaño de fuente reducido */
    cursor: pointer;
    padding: 4px 6px;
    margin: 0 1px;
    border-radius: 2px;
    transition: all 0.15s;
    line-height: 1;
    min-width: 28px; /* Ancho mínimo para mejor toque */
}

.control-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.progress-container {
    flex-grow: 1;
    height: 3px; /* Más delgada */
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 0 8px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s ease;
}

.progress-container:hover {
    height: 5px; /* Se hace un poco más gruesa al pasar el mouse */
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff3a3a, #ff6b6b);
    border-radius: 2px;
    width: 0;
    position: relative;
    transition: width 0.1s linear;
}

.time-tooltip {
    position: absolute;
    bottom: 15px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75em;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-container:hover .time-tooltip {
    opacity: 1;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    opacity: 0;
    transition: opacity 0.3s;
    margin: 0;
}

.volume-control:hover .volume-slider {
    opacity: 1;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff4d4d;
    cursor: pointer;
}

.fullscreen-btn {
    margin-left: 10px;
}

/* Indicador de carga */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Estilos para pantalla completa */
:-webkit-full-screen .video-player {
    width: 100%;
    height: 100%;
    max-width: 100%;
}

:-webkit-full-screen .video-player video {
    height: 100%;
}

/* Clase para expandir el reproductor */
.video-stream-container.expanded {
    max-width: 100%;
    margin: 15px auto;
    border-radius: 0;
    box-shadow: none;
}

/* Clase para modo compacto */
.video-stream-container.compact .video-controls {
    padding: 4px 8px;
}

.video-stream-container.compact .control-btn {
    font-size: 12px;
    padding: 2px 5px;
    width: 28px;
    height: 24px;
}

.video-stream-container.compact .time-display {
    font-size: 10px;
    min-width: 70px;
}

/* Botón de expansión */
.expand-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-stream-container:hover .expand-btn {
    opacity: 1;
}

/* Ajustes para móviles */
@media (max-width: 768px) {
    .video-stream-container {
        max-width: 100%;
        margin: 0 auto;
        border-radius: 0;
        box-shadow: none;
    }
    
    .video-controls {
        padding: 3px 4px;
        height: 32px;
    }
    
    .control-btn {
        font-size: 0.9em;
        padding: 2px 4px;
        min-width: 24px;
    }
    
    .volume-slider {
        width: 50px;
    }
    
    .time-display {
        min-width: 70px;
        font-size: 0.7em;
    }
    
    .progress-container {
        margin: 0 5px;
    }
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .video-stream-container {
        margin: 10px auto;
        border-radius: 5px;
    }
    
    .control-btn {
        font-size: 14px;
        padding: 4px 8px;
    }
    
    .time-display {
        min-width: 80px;
        font-size: 11px;
    }
    
    .volume-slider {
        width: 60px;
    }
    
    .volume-control .volume-slider {
        display: none;
    }
    
    .volume-control:hover .volume-slider {
        display: block;
        position: absolute;
        bottom: 40px;
        right: 10px;
        width: 80px;
        height: 5px;
        transform: rotate(-90deg);
        transform-origin: right bottom;
    }
}
