/* css/playlist.css */

/* COLA DE REPRODUCCIÓN & TÍTULO TOP */
.cine-top-overlay {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    padding: 20px 25px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%);
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start;
    z-index: 20; 
    opacity: 0; 
    transition: opacity 0.4s ease; 
    pointer-events: none;
}

.cine-container:hover .cine-top-overlay, 
.cine-top-overlay.active { 
    opacity: 1; 
    pointer-events: auto; 
}

.cine-title-group { 
    display: flex; 
    flex-direction: column; 
    gap: 2px; 
}

#cineCurrentTitle { 
    margin: 0; 
    color: white; 
    font-size: 1.25rem; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.8); 
    font-weight: 700; 
    letter-spacing: 0.3px; 
}

#cineTopBadge { 
    font-size: 0.65rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 1.2px; 
    color: var(--accent-electric); 
    opacity: 0.9;
}

/* PANELES LATERALES GLASSMORPHISM */
.playlist-panel, .history-panel {
    position: absolute; 
    top: 0; 
    width: 320px; 
    height: 100%;
    background: rgba(13, 17, 23, 0.8); 
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    z-index: 30;
    display: flex; 
    flex-direction: column; 
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.playlist-panel {
    right: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.05); 
    transform: translateX(100%); 
    box-shadow: -10px 0 50px rgba(0,0,0,0.4);
}

.history-panel {
    left: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05); 
    transform: translateX(-100%); 
    box-shadow: 10px 0 50px rgba(0,0,0,0.4);
}

.playlist-panel.open, .history-panel.open { 
    transform: translateX(0); 
}

.playlist-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px; 
    border-bottom: 1px solid rgba(255,255,255,0.03); 
}

.playlist-header h3 { 
    margin: 0; 
    color: rgba(255,255,255,0.9); 
    font-size: 1rem; 
    font-weight: 700;
    display: flex; 
    align-items: center; 
    gap: 8px;
    letter-spacing: 0.5px;
}

.close-playlist-btn {
    background: rgba(255,255,255,0.05);
    border: none;
    color: rgba(255,255,255,0.5);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-playlist-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: rotate(90deg);
}

.playlist-content { 
    padding: 15px; 
    flex-grow: 1; 
    overflow-y: auto; 
}

.playlist-content::-webkit-scrollbar { width: 4px; }
.playlist-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.playlist-items-container { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}

/* TABS DEL HISTORIAL */
.history-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    background: rgba(255,255,255,0.03);
    padding: 5px;
    border-radius: 10px;
}

.h-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    padding: 8px 0;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.h-tab.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* FORMULARIO AÑADIR/EDITAR */
.playlist-form { 
    background: rgba(0, 0, 0, 0.25); 
    padding: 20px; 
    border-radius: 16px; 
    border: 1px solid rgba(255,255,255,0.03); 
    margin-bottom: 20px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pl-form-title {
    color: white;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 800;
    margin: 0 0 15px 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.8;
}

.pl-input-group { margin-bottom: 12px; }
.pl-input-group label {
    display: block;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 800;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.pl-custom-input {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 10px 15px;
    color: white;
    font-size: 0.85rem;
    text-align: center;
    transition: all 0.3s ease;
    outline: none;
}

.pl-custom-input:focus {
    background: rgba(255,255,255,0.06);
    border-color: var(--accent-electric);
    box-shadow: 0 0 0 3px rgba(var(--accent-electric-rgb), 0.1);
}
.pl-custom-input::placeholder { color: rgba(255,255,255,0.2); }

.pl-type-selector {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.pl-radio-label { flex: 1; cursor: pointer; }
.pl-radio-label input { display: none; }

.pl-radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 10px 5px;
    color: rgba(255,255,255,0.4);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.pl-radio-label input:checked + .pl-radio-content {
    background: rgba(var(--accent-electric-rgb), 0.1);
    border-color: rgba(var(--accent-electric-rgb), 0.4);
    color: var(--accent-electric);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.pl-form-actions { display: flex; gap: 10px; }

.pl-btn-outline, .pl-btn-solid {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pl-btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}
.pl-btn-outline:hover { background: rgba(255,255,255,0.05); color: white; }

.pl-btn-solid {
    background: var(--accent-electric);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(var(--accent-electric-rgb), 0.2);
}
.pl-btn-solid:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--accent-electric-rgb), 0.4);
}

#plShowAddFormBtn {
    width: 100%;
    margin-bottom: 15px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
#plShowAddFormBtn:hover {
    background: rgba(255,255,255,0.08);
    color: white;
    border-color: rgba(255,255,255,0.4);
}

/* ITEMS DE LA LISTA (PLAYLIST & HISTORIAL) */
.pl-item { 
    background: rgba(255,255,255,0.02); 
    border: 1px solid rgba(255,255,255,0.04); 
    border-radius: 10px;
    padding: 10px 12px; 
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: grab; 
    transition: all 0.2s ease;
    position: relative;
}

.pl-item:hover {
    background: rgba(255,255,255,0.05); 
    border-color: rgba(255,255,255,0.1);
}

.pl-item.playing { 
    background: rgba(var(--accent-electric-rgb), 0.05); 
    border-color: rgba(var(--accent-electric-rgb), 0.3); 
}

.pl-item-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pl-item-title { 
    color: rgba(255,255,255,0.9); 
    font-weight: 500; 
    font-size: 0.85rem; 
    margin: 0; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pl-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pl-item-btns-hidden {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.pl-item:hover .pl-item-btns-hidden {
    opacity: 1;
}

.pl-action-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.3);
    padding: 6px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    transition: 0.2s;
}

.pl-action-btn:hover { color: white; background: rgba(255,255,255,0.05); }
.pl-action-btn.delete:hover { color: var(--error-color); }
.pl-action-btn.finish:hover { color: #4ade80; } /* 💡 AÑADIDO: Hover verde para finalizar serie */

.pl-status-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.pl-item:hover .pl-status-indicator {
    color: white;
    border-color: rgba(255,255,255,0.4);
}

.pl-item.playing .pl-status-indicator {
    background: var(--accent-electric);
    color: white;
    border-color: var(--accent-electric);
    box-shadow: 0 0 10px rgba(var(--accent-electric-rgb), 0.5);
}

.history-panel .pl-item { cursor: default; }
.history-panel .pl-status-indicator { cursor: default; border-color: transparent; background: rgba(255,255,255,0.03); }
.history-panel .pl-item:hover .pl-status-indicator { background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.3); }

.pl-tag-discret {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.5;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tag-youtube { color: #ff4e4e; }
.tag-serie { color: #4ade80; }
.tag-pelicula { color: #60a5fa; }
.tag-date { color: rgba(255,255,255,0.5); font-weight: 600; margin-left: 5px; border-left: 1px solid rgba(255,255,255,0.2); padding-left: 5px;}

.pl-item.drag-over { 
    border-top: 2px solid var(--accent-electric);
    background: rgba(255,255,255,0.05);
}