/**
 * Preview Flotante - Estilos del mini reproductor flotante
 */

.preview-flotante {
    position: fixed;
    z-index: 9998;
    width: 200px;
    background: rgba(15, 15, 23, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 10px;
    user-select: none;
}

.preview-flotante.hidden {
    display: none;
}

.preview-flotante.dragging {
    opacity: 0.9;
    cursor: grabbing;
}

/* Header */
.pf-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: rgba(99, 102, 241, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px 8px 0 0;
    cursor: grab;
}

.pf-header:active {
    cursor: grabbing;
}

.pf-drag-handle {
    color: rgba(255, 255, 255, 0.3);
    display: flex;
}

.pf-drag-handle svg {
    width: 10px;
    height: 10px;
}

.pf-title {
    flex: 1;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pf-close {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.pf-close svg {
    width: 10px;
    height: 10px;
}

.pf-close:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Cover + Player */
.pf-cover-player {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
}

.pf-cover {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.pf-cover-placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.pf-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pf-cover-img.hidden {
    display: none;
}

.pf-player-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.pf-play-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #6366f1;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.pf-play-btn svg {
    width: 12px;
    height: 12px;
}

.pf-play-btn:hover {
    background: #818cf8;
    transform: scale(1.05);
}

.pf-play-btn:active {
    transform: scale(0.95);
}

.pf-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pf-progress-container {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
}

.pf-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.pf-progress-container:hover .pf-progress-bar {
    background: linear-gradient(90deg, #818cf8, #a5b4fc);
}

.pf-time {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    min-width: 24px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Info */
.pf-info {
    padding: 6px 8px 8px;
    max-height: 85px;
    overflow-y: auto;
    transition: max-height 0.1s ease;
}

.pf-info::-webkit-scrollbar {
    width: 2px;
}

.pf-info::-webkit-scrollbar-track {
    background: transparent;
}

.pf-info::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.pf-info-line {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pf-label {
    color: #4ade80;
    font-weight: 500;
}

/* Resize Handle */
.pf-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    cursor: se-resize;
    color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.pf-resize-handle:hover {
    color: rgba(255, 255, 255, 0.5);
}

.pf-resize-handle svg {
    width: 10px;
    height: 10px;
}

.preview-flotante.resizing {
    opacity: 0.95;
}

.preview-flotante.resizing .pf-resize-handle {
    color: #6366f1;
}

/* Responsive */
@media (max-width: 480px) {
    .preview-flotante {
        width: 170px;
        font-size: 9px;
    }

    .pf-cover {
        width: 36px;
        height: 36px;
    }

    .pf-play-btn {
        width: 22px;
        height: 22px;
    }

    .pf-info {
        max-height: 80px;
    }
}
