/* floating-player.css — Fixed bottom-right audio player widget */

/* =============================================
   CONTAINER — 3 states via classes on #floating-player
   .fp-minimized (default) | .fp-compact | .fp-fullscreen
   ============================================= */

#floating-player {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9000;
    font-family: 'Exo 2', monospace;
}

/* =============================================
   SONG REQUEST PANEL
   ============================================= */

#fp-request {
    position: fixed;
    right: 1.5rem;
    bottom: 0; /* set dynamically by JS */
    z-index: 8999;
    width: 380px;
    background: rgba(0, 5, 15, 0.97);
    border: 1px solid rgba(251, 70, 228, 0.5);
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(251, 70, 228, 0.15), 0 4px 24px rgba(0, 0, 0, 0.5);
    font-family: 'Exo 2', monospace;
    overflow: hidden;
}

.fp-request-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    color: var(--color-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    user-select: none;
}

.fp-request-header:hover { background: rgba(251, 70, 228, 0.06); }

.fp-request-arrow {
    margin-left: auto;
    transition: transform 0.2s;
    font-size: 0.7rem;
}

.fp-request-body { padding: 0.75rem; }

.fp-request-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fp-request-input {
    width: 100%;
    padding: 0.45rem 0.65rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(251, 70, 228, 0.3);
    border-radius: 2px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.fp-request-input:focus { border-color: var(--color-primary); }
.fp-request-input::placeholder { color: rgba(255,255,255,0.3); }

.fp-request-submit {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.2s, color 0.2s;
    width: 100%;
}

.fp-request-submit:hover { background: var(--color-primary); color: #000; }
.fp-request-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.fp-request-result {
    margin-top: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    display: none;
}

.fp-request-result.success { color: #00ff64; }
.fp-request-result.error { color: #ff4444; }

@media (max-width: 420px) {
    #fp-request {
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 0;
    }
}

/* =============================================
   MINIMIZED TAB
   ============================================= */

.fp-tab {
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    background: rgba(0, 5, 15, 0.97);
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    padding: 0.7rem 1rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2), 0 4px 24px rgba(0, 0, 0, 0.5);
    width: 380px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.fp-tab:hover {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.35), 0 4px 24px rgba(0, 0, 0, 0.5);
    border-color: #fff;
}

.fp-tab-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fp-tab-label {
    font-family: 'Exo 2', monospace;
    font-size: 0.7rem;
    color: var(--color-accent);
    letter-spacing: 2px;
    opacity: 0.8;
    flex: 1;
}

.fp-tab-expand-btn {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.4);
    padding: 0.1rem 0.3rem;
}

.fp-tab-expand-btn:hover {
    color: var(--color-accent);
}

.fp-tab-middle {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.fp-tab-song {
    font-family: 'Russo One', sans-serif;
    font-size: 1rem;
    color: #fff;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-tab-artist-text {
    font-size: 0.8rem;
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Controls row */
.fp-tab-controls-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.55rem;
    margin-top: 0.1rem;
    border-top: 1px solid rgba(0, 255, 255, 0.12);
}

.fp-tab-like {
    font-size: 1.15rem;
    color: var(--color-primary);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s;
}

.fp-tab-like:hover {
    color: #fff;
}

.fp-tab-toggle {
    font-size: 1.75rem;
    color: var(--color-primary);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s, text-shadow 0.2s;
}

.fp-tab-toggle:hover {
    color: #fff;
    text-shadow: 0 0 12px var(--color-primary);
}

.fp-tab-controls-row .volume-control {
    flex: 1;
    justify-content: flex-end;
}

.fp-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent);
    flex-shrink: 0;
    animation: fp-pulse 2s ease-in-out infinite;
}

@keyframes fp-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--color-accent); }
    50% { opacity: 0.4; box-shadow: none; }
}

/* =============================================
   COMPACT PANEL (~320px)
   ============================================= */

.fp-compact-panel {
    display: none;
    flex-direction: column;
    width: 380px;
    background: rgba(0, 5, 15, 0.97);
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.12), inset 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.fp-compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1rem;
    background: rgba(0, 255, 255, 0.05);
    border-bottom: 1px solid rgba(0, 255, 255, 0.15);
}

.fp-compact-label {
    font-size: 0.7rem;
    color: var(--color-accent);
    letter-spacing: 2px;
    opacity: 0.7;
}

.fp-compact-btns {
    display: flex;
    gap: 0.4rem;
}

/* Labeled action buttons in compact header */
.fp-compact-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.55);
    font-family: 'Exo 2', monospace;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    cursor: pointer;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    line-height: 1.4;
}

.fp-compact-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.05);
}

.fp-compact-btn-expand {
    border-color: rgba(0, 255, 255, 0.35);
    color: var(--color-accent);
}

.fp-compact-btn-expand:hover {
    border-color: var(--color-accent);
    background: rgba(0, 255, 255, 0.1);
    color: #fff;
}

/* Keep fp-icon-btn for the tab expand button */
.fp-icon-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
}

.fp-icon-btn:hover {
    color: var(--color-accent);
    background: rgba(0, 255, 255, 0.08);
}

/* --- Song row --- */
.fp-song-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
}

.fp-art {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid rgba(251, 70, 228, 0.4);
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(251, 70, 228, 0.15);
}

.fp-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.fp-title {
    font-family: 'Russo One', sans-serif;
    font-size: 1rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.fp-artist {
    font-size: 0.85rem;
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Progress --- */
.fp-progress {
    padding: 0 1rem;
}

.fp-progress .progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.fp-progress .progress-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 2px;
    transition: width 0.5s linear;
    width: 0%;
}

.fp-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--color-muted);
    opacity: 0.7;
    margin-top: 0.3rem;
}

/* --- Controls --- */
/* Override site.css .controlls (space-between, 1.75rem, 2.5rem play btn) */
.fp-controls {
    padding: 0.5rem 1rem 0.75rem;
    border-top: 1px solid rgba(0, 255, 255, 0.08);
    justify-content: flex-start !important;
    gap: 0.9rem !important;
    font-size: 1.1rem !important;
    padding-block: 0.5rem !important;
}

.fp-controls .fa-circle-play,
.fp-controls .fa-circle-pause {
    font-size: 1.75rem !important;
    cursor: pointer;
}

/* Volume takes up remaining space, keeps slider right-aligned */
.fp-controls .volume-control {
    flex: 1;
    justify-content: flex-end;
}

/* Volume icon size inside player */
.fp-vol-icon {
    font-size: 0.9rem;
    color: var(--color-muted);
    opacity: 0.7;
    flex-shrink: 0;
}

/* Override site.css vertical-popup volume — inline horizontal everywhere in the player */
.fp-compact-panel .volume-control,
.fp-fs-controls .volume-control,
.fp-tab-controls-row .volume-control {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.fp-compact-panel .volume-slider-wrapper,
.fp-fs-controls .volume-slider-wrapper,
.fp-tab-controls-row .volume-slider-wrapper {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
}

.fp-compact-panel .volume-slider-wrapper::after,
.fp-fs-controls .volume-slider-wrapper::after,
.fp-tab-controls-row .volume-slider-wrapper::after {
    display: none !important;
}

.fp-compact-panel .volume-slider,
.fp-fs-controls .volume-slider,
.fp-tab-controls-row .volume-slider {
    transform: none !important;
    margin: 0 !important;
    width: 70px !important;
    height: 4px;
    cursor: pointer;
}

/* =============================================
   FULLSCREEN OVERLAY
   ============================================= */

.fp-fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 8, 0.97);
    display: flex;
    flex-direction: column;
    /* Hidden by default — use opacity+visibility so p5 canvas dimensions are available */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fp-fullscreen-overlay.fp-fs-active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* Header bar with EXIT button */
.fp-fs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.25rem;
    background: rgba(0, 5, 15, 0.95);
    border-bottom: 1px solid rgba(0, 255, 255, 0.15);
    flex-shrink: 0;
    z-index: 10;
}

.fp-fs-header-label {
    font-size: 0.7rem;
    color: var(--color-accent);
    letter-spacing: 2px;
    opacity: 0.7;
}

.fp-fs-exit-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    letter-spacing: 1px;
    cursor: pointer;
    padding: 0.35rem 0.85rem;
    border-radius: 2px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.fp-fs-exit-btn:hover {
    color: #fff;
    border-color: var(--color-primary);
    background: rgba(251, 70, 228, 0.1);
}

/* Visualizer fills most of the overlay */
.fp-fs-visualizer {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* p5 canvas fills the container */
.fp-fs-visualizer canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Progress bar strip above bottom bar */
.fp-fs-progress {
    padding: 0.5rem 2rem 0;
    flex-shrink: 0;
    background: rgba(0, 5, 15, 0.95);
}

.fp-fs-progress .progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.fp-fs-progress .progress-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 2px;
    transition: width 0.5s linear;
    width: 0%;
}

.fp-fs-progress .fp-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--color-muted);
    opacity: 0.7;
    margin-top: 0.3rem;
    padding-bottom: 0.4rem;
}

/* Bottom bar with art + info + controls */
.fp-fs-bottom {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 2rem;
    background: rgba(0, 5, 15, 0.95);
    border-top: 1px solid rgba(0, 255, 255, 0.15);
    flex-shrink: 0;
}

.fp-fs-art {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid rgba(251, 70, 228, 0.3);
    flex-shrink: 0;
}

.fp-fs-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.fp-fs-title {
    font-family: 'Russo One', sans-serif;
    font-size: 1.1rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-fs-artist {
    font-size: 0.85rem;
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-fs-controls {
    font-size: 1.5rem !important;
    padding: 0 !important;
    padding-block: 0 !important;
    border: none;
    flex-shrink: 0;
    gap: 1rem !important;
}

.fp-fs-controls .fa-circle-play,
.fp-fs-controls .fa-circle-pause {
    font-size: 2.2rem !important;
}

.fp-fs-controls .volume-control {
    flex: 1;
    justify-content: flex-end;
    max-width: 160px;
}

.fp-fs-progress {
    padding: 0 2rem;
    flex-shrink: 0;
}

/* =============================================
   STATE MACHINE
   ============================================= */

/* Minimized: show only tab */
#floating-player.fp-minimized .fp-tab { display: flex; flex-direction: column; }
#floating-player.fp-minimized .fp-compact-panel { display: none; }

/* Compact: show panel */
#floating-player.fp-compact .fp-tab { display: none; }
#floating-player.fp-compact .fp-compact-panel { display: flex; }

/* Fullscreen: hide both (overlay is outside #floating-player now) */
#floating-player.fp-fullscreen .fp-tab { display: none; }
#floating-player.fp-fullscreen .fp-compact-panel { display: none; }

/* =============================================
   MOBILE — reposition + resize
   ============================================= */

@media (max-width: 420px) {
    #floating-player {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
    }

    .fp-tab {
        width: 100%;
        border-radius: 4px 4px 0 0;
    }

    .fp-compact-panel {
        width: 100%;
        border-radius: 4px 4px 0 0;
    }

    .fp-art {
        width: 56px;
        height: 56px;
    }

    .fp-fs-bottom {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .fp-fs-art {
        width: 44px;
        height: 44px;
    }
}
