/**
 * Global Stream Control Bar - Estilos CSS
 * Estilos para la barra de control global del stream
 * 
 * @author MrGreen Development Team
 * @version 1.0.0
 * @since 2025-01-08
 */

/* ===== BARRA PRINCIPAL ===== */
#global-stream-control-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-top: 2px solid #00d4ff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.8);
    padding: 12px 20px;
    display: none;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#global-stream-control-bar.active {
    display: flex;
    visibility: visible;
    opacity: 1;
}

/* ===== CONTENIDO DE LA BARRA ===== */
.stream-control-content {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

/* ===== INFORMACIÓN DEL STREAM ===== */
.stream-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.stream-video-container {
    position: relative;
    width: 60px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 2px solid #00d4ff;
    flex-shrink: 0;
}

#stream-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stream-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

#stream-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.stream-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #ccc;
}

#viewer-count {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #00d4ff;
    font-weight: 500;
}

#viewer-count i {
    font-size: 10px;
}

#status-text {
    color: #00ff00;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

/* ===== CONTROLES ===== */
.stream-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.control-btn.active {
    background: #00d4ff;
    border-color: #00d4ff;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
    font-weight: 600;
}

.control-btn.disabled {
    background: #ff4444;
    border-color: #ff4444;
    color: #fff;
    opacity: 0.9;
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(255, 68, 68, 0.3);
}

.control-btn.active::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    border: 2px solid #1a1a1a;
    box-shadow: 0 0 6px rgba(0, 255, 0, 0.6);
}

.control-btn.disabled::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ff0000;
    border-radius: 50%;
    border: 2px solid #1a1a1a;
    box-shadow: 0 0 6px rgba(255, 0, 0, 0.6);
}

/* ===== BOTÓN PRINCIPAL ===== */
#go-to-stream-main {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #000;
    font-weight: 600;
    font-size: 12px;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

#go-to-stream-main:hover {
    background: linear-gradient(135deg, #00b8e6 0%, #0088bb 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
    color: #000;
    text-decoration: none;
}

/* ===== CLASES ADICIONALES PARA BOTONES ===== */
.go-to-stream-btn {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #000;
    font-weight: 600;
    font-size: 12px;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.go-to-stream-btn:hover {
    background: linear-gradient(135deg, #00b8e6 0%, #0088bb 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
    color: #000;
    text-decoration: none;
}

.close-stream-btn {
    background: #ff4444;
    color: #fff;
    font-size: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid #ff6666;
    cursor: pointer;
}

.close-stream-btn:hover {
    background: #ff6666;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
}

/* ===== BOTÓN DE CERRAR ===== */
#close-stream {
    background: #ff4444;
    color: #fff;
    font-size: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid #ff6666;
}

#close-stream:hover {
    background: #ff6666;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    #global-stream-control-bar {
        padding: 8px 15px;
    }
    
    .stream-control-content {
        gap: 12px;
    }
    
    .stream-video-container {
        width: 50px;
        height: 35px;
    }
    
    #stream-title {
        font-size: 12px;
        max-width: 150px;
    }
    
    .stream-meta {
        font-size: 10px;
        gap: 8px;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    #go-to-stream-main {
        font-size: 10px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .stream-info {
        gap: 10px;
    }
    
    .stream-details {
        min-width: 0;
    }
    
    #stream-title {
        max-width: 120px;
    }
    
    .stream-controls {
        gap: 8px;
    }
    
    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.control-btn.pulse {
    animation: pulse 1s infinite;
}

/* ===== ESTADOS ESPECIALES ===== */
#global-stream-control-bar.minimized {
    padding: 6px 20px;
    transform: translateY(-50%);
}

#global-stream-control-bar.minimized .stream-video-container {
    width: 40px;
    height: 30px;
}

#global-stream-control-bar.minimized .stream-details {
    display: none;
}

#global-stream-control-bar.minimized .stream-controls {
    gap: 8px;
}

/* ===== TOOLTIPS ===== */
.control-btn[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 10000;
    pointer-events: none;
}

.control-btn[title]:hover::after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    pointer-events: none;
}

/* ===== ESTILOS PARA POSICIONAMIENTO INFERIOR ===== */
body {
    padding-bottom: 80px; /* Espacio para la barra inferior */
}

/* Asegurar que la barra no interfiera con el contenido */
#global-stream-control-bar {
    max-height: 80px;
    overflow: hidden;
}

/* Animación de entrada desde abajo */
#global-stream-control-bar.show {
    transform: translateY(0);
}

#global-stream-control-bar.hide {
    transform: translateY(100%);
}

/* Estilos para dispositivos móviles con barra inferior */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }
    
    #global-stream-control-bar {
        max-height: 70px;
        padding: 8px 15px;
    }
    
    .control-btn[title]:hover::before {
        bottom: 35px; /* Ajustar tooltips para barra inferior */
    }
    
    .control-btn[title]:hover::after {
        bottom: 25px; /* Ajustar tooltips para barra inferior */
        border-top-color: rgba(0, 0, 0, 0.9);
        border-bottom-color: transparent;
    }
}

/* ===== ESTADOS DE BOTONES ===== */
.control-btn.muted {
    background: #ff4444;
    color: white;
}

.control-btn.muted:hover {
    background: #ff6666;
}

.control-btn.disabled {
    background: #666;
    color: #999;
    cursor: not-allowed;
}

.control-btn.disabled:hover {
    background: #666;
}

.control-btn.active {
    background: #00d4ff;
    color: white;
}

.control-btn.active:hover {
    background: #00b8e6;
}

/* ===== NOTIFICACIONES ===== */
.stream-notification {
    animation: slideInRight 0.3s ease-out;
}

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