/* =====================================================
   FLOTANTES.CSS - BOTONES Y ELEMENTOS FLOTANTES
   Buscador + Acciones + Ticker + Merlin TV
   ===================================================== */

/* ===== BARRA DE BÚSQUEDA SUPERIOR ===== */
#search-bar-header { 
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1010 !important;
    background: linear-gradient(to bottom, rgba(17, 24, 39, 0.98), rgba(17, 24, 39, 0.92));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.65rem 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#search-bar-header > div,
#search-bar-header .flex {
    display: flex !important;
    align-items: center;
    gap: 0.625rem;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
}

/* Input de búsqueda */
#search-bar-header .flex-grow,
#search-bar-header > div > div:first-child {
    position: relative;
    flex: 1 1 280px;
    min-width: 280px;
}

#search-bar-header i.fa-search {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    z-index: 10;
}

#text-search,
input[type="search"] {
    width: 100% !important;
    background: rgba(31, 41, 55, 0.95) !important;
    border: 2px solid #374151 !important;
    color: #f3f4f6 !important;
    padding: 0.625rem 0.875rem !important;
    padding-left: 2.5rem !important;
    border-radius: 0.625rem !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease !important;
    outline: none !important;
}

#text-search:focus {
    border-color: #3b82f6 !important;
    background: rgba(31, 41, 55, 1) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* Selectores (Desktop) */
#category-filter-pc,
#location-filter-pc,
#ccz-filter-pc,
select {
    background: rgba(31, 41, 55, 0.95) !important;
    border: 2px solid #374151 !important;
    color: #f3f4f6 !important;
    padding: 0.625rem 0.875rem !important;
    padding-right: 2.25rem !important;
    border-radius: 0.625rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    outline: none !important;
    min-width: 140px !important;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f3f4f6' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.625rem center !important;
}

select:hover {
    border-color: #3b82f6 !important;
}

select option {
    background: #1f2937 !important;
    color: #f3f4f6 !important;
}

/* ===== BARRA DE ACCIONES FLOTANTES (ABAJO) ===== */
#floating-actions-bar { 
    position: fixed !important;
    bottom: 1.5rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 1000 !important;
    pointer-events: none;
}

#floating-actions-bar > div {
    pointer-events: auto;
}

.glass-slider {
    display: flex;
    gap: 0.875rem;
    justify-content: center;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(16px);
    border-radius: 3rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow-x: auto;
    scrollbar-width: none;
}

.glass-slider::-webkit-scrollbar {
    display: none;
}

/* ===== BOTONES CIRCULARES FLOTANTES ===== */
.float-btn,
.category-icon,
.share-button { 
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white !important;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    flex-shrink: 0;
}

.float-btn:hover,
.category-icon:hover,
.share-button:hover { 
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

/* Colores específicos de botones */
.btn-sci,
#ztv-button { 
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    font-weight: 900;
}

.btn-wa,
.share-whatsapp { 
    background: linear-gradient(135deg, #25D366, #128C7E) !important;
}

.btn-fb,
.share-facebook { 
    background: linear-gradient(135deg, #1877F2, #166FE5) !important;
}

.btn-twitter,
.share-twitter { 
    background: linear-gradient(135deg, #000000, #333333) !important;
}

.share-telegram { 
    background: linear-gradient(135deg, #0088cc, #0077b5) !important;
}

.share-instagram { 
    background: linear-gradient(135deg, #E4405F, #C13584, #F56040) !important;
}

.btn-store { 
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

.btn-bag { 
    background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
}

.btn-music { 
    background: linear-gradient(135deg, #ec4899, #db2777) !important;
}

.float-btn[href*="unete"] { 
    background: linear-gradient(45deg, #FFD700, #FFA500) !important;
    font-weight: bold;
}

/* ===== TICKER DE NOTICIAS (ABAJO) ===== */
#news-ticker-bar { 
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background-color: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(8px);
    overflow: hidden;
    color: white;
    display: flex;
    align-items: center;
    height: 40px;
    z-index: 1000 !important;
}

#news-ticker-content { 
    display: inline-block;
    animation: ticker-scroll 120s linear infinite;
    white-space: nowrap;
    padding-left: 100%;
}

#news-ticker-bar:hover #news-ticker-content { 
    animation-play-state: paused;
}

@keyframes ticker-scroll { 
    from { transform: translateX(0%); }
    to { transform: translateX(-100%); }
}

/* ===== MERLIN TV FLOTANTE ===== */
#merlin-stage {
    position: fixed !important;
    bottom: 100px !important;
    right: 20px !important;
    width: 320px !important;
    height: 180px !important;
    background-color: #000;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    z-index: 999999 !important;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 1;
    visibility: visible;
    display: block;
}

#video-wrapper {
    width: 100%; 
    height: 100%; 
    pointer-events: none;
}

#merlin-yt-player { 
    width: 100%; 
    height: 100%; 
}

/* Overlay de controles Netflix */
.netflix-overlay {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
}

#merlin-stage:hover .netflix-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* Badge LIVE */
.badge-live {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff0000;
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* Controles del reproductor */
.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.btn-audio {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-audio:hover { 
    background: white; 
    color: black; 
}

.btn-audio.active {
    background: #10b981;
    border-color: #10b981;
    color: white;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.tools-group {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 32px; 
    height: 32px;
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover { 
    background: white; 
    color: black; 
    transform: scale(1.1); 
}

/* Lanzador (Orbe azul) */
.merlin-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #3b82f6;
    border-radius: 50%;
    z-index: 999998;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.6);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.merlin-launcher:hover { 
    transform: scale(1.1) rotate(10deg); 
}

.merlin-launcher.hidden {
    display: none !important;
}

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 768px) {
    /* Barra de búsqueda en una línea */
    #search-bar-header > div,
    #search-bar-header .flex {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 6px !important;
        width: 100% !important;
        margin: 0 !important;
    }

    #search-bar-header {
        padding: 8px !important;
        height: auto !important;
        min-height: 56px !important;
    }

    /* Input elástico */
    #search-bar-header .flex-grow,
    #search-bar-header > div > div:first-child {
        flex: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    #text-search {
        width: 100% !important;
        height: 40px !important;
        font-size: 15px !important;
        padding-left: 36px !important;
        padding-right: 5px !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #search-bar-header i.fa-search {
        left: 10px !important;
        font-size: 14px !important;
    }

    /* Selectores como botones cuadrados */
    #category-filter-pc,
    #location-filter-pc,
    #ccz-filter-pc,
    select {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        flex: 0 0 auto !important;
        padding: 0 !important;
        border-radius: 8px !important;
        color: transparent !important;
        background-position: center !important;
        background-size: 12px !important;
        border: 1px solid rgba(255,255,255,0.2) !important;
    }

    /* Botones flotantes más pequeños */
    #floating-actions-bar {
        bottom: 15px !important;
        width: 95% !important;
        left: 2.5% !important;
        transform: none !important;
    }

    .float-btn,
    .category-icon,
    .share-button {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    /* Merlin TV más pequeño en móvil */
    #merlin-stage {
        width: 240px !important;
        height: 135px !important;
        bottom: 90px !important;
    }
}

@media (max-width: 370px) {
    #text-search {
        font-size: 13px !important;
        padding-left: 30px !important;
    }

    select {
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
    }
}

/* ===== MOSTRAR ELEMENTOS OCULTOS EN DESKTOP ===== */
@media (min-width: 768px) {
    #search-bar-header .hidden.md\:block {
        display: block !important;
    }
}
