/* ========== FOCUS AUDIO SYSTEM ========== */

/* ---- Main Bar ---- */
.focus-audio-bar {
    width: 100%;
    max-width: 600px;
    margin: 0.8rem auto 0;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 180, 216, 0.04);
    border: 1px solid rgba(0, 180, 216, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.focus-audio-bar:hover {
    border-color: rgba(0, 180, 216, 0.3);
    background: rgba(0, 180, 216, 0.06);
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.08);
}
.focus-audio-bar.fa-active {
    border-color: rgba(0, 180, 216, 0.35);
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.08), rgba(123, 75, 206, 0.06));
    box-shadow: 0 4px 24px rgba(0, 180, 216, 0.1);
}

/* ---- Collapsed Bar Layout ---- */
.fa-collapsed {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 1rem 0.7rem 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Icon + mini equalizer */
.fa-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.12), rgba(180, 0, 0, 0.06));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
/* YouTube SVG logo — always visible */
.fa-yt-logo {
    z-index: 2;
    filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.35));
    flex-shrink: 0;
}

/* Mini equalizer — small overlay at bottom of icon */
.fa-eq-mini {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 3;
}
.fa-icon-wrap.playing .fa-eq-mini {
    opacity: 1;
}
.fa-eq-mini span {
    display: block;
    width: 2.5px;
    height: 3px;
    border-radius: 2px;
    background: #fff;
}
.fa-eq-mini.animating span {
    animation: faEqBar 0.7s ease-in-out infinite alternate;
}
.fa-eq-mini.animating span:nth-child(1) { animation-delay: 0s; }
.fa-eq-mini.animating span:nth-child(2) { animation-delay: 0.15s; }
.fa-eq-mini.animating span:nth-child(3) { animation-delay: 0.3s; }

@keyframes faEqBar {
    0% { height: 3px; }
    100% { height: 10px; }
}

/* Track info */
.fa-info {
    flex: 1;
    min-width: 0;
}
.fa-now-playing {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text, #f0f0f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.fa-subtitle {
    font-size: 0.78rem;
    color: var(--quantum-blue, #00b4d8);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    font-weight: 500;
}

/* ---- Controls ---- */
.fa-controls {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}
.fa-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.2s;
    padding: 0;
}
.fa-btn:hover {
    color: #fff;
    background: rgba(0, 180, 216, 0.12);
}
.fa-btn-play {
    width: 44px;
    height: 44px;
    font-size: 1.05rem;
    color: #fff;
    background: linear-gradient(135deg, var(--quantum-blue, #00b4d8), var(--plasma-purple, #7b4bce));
    border-radius: 50%;
    position: relative;
    box-shadow: 0 2px 12px rgba(0, 180, 216, 0.3);
}
.fa-btn-play:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 20px rgba(0, 180, 216, 0.4);
}

/* Loading ring around play button */
.fa-loading-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--neon-cyan, #00e6d6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.fa-btn-play.loading .fa-loading-ring {
    opacity: 1;
    animation: faSpinRing 0.8s linear infinite;
}

@keyframes faSpinRing {
    to { transform: rotate(360deg); }
}

/* ---- Expanded Panel ---- */
.fa-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
    background: rgba(10, 10, 20, 0.6);
    border-top: 1px solid rgba(0, 180, 216, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.fa-panel.open {
    max-height: 700px;
    opacity: 1;
    overflow-y: auto;
}
.fa-panel-inner {
    padding: 1rem 1.1rem 1.2rem;
}

/* Scrollbar for panel */
.fa-panel::-webkit-scrollbar {
    width: 4px;
}
.fa-panel::-webkit-scrollbar-track {
    background: transparent;
}
.fa-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 180, 216, 0.3);
    border-radius: 4px;
}

/* ---- Panel Sections ---- */
.fa-section {
    margin-bottom: 1rem;
}
.fa-section:last-child {
    margin-bottom: 0;
}
.fa-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.fa-section-title i {
    color: var(--quantum-blue, #00b4d8);
    font-size: 0.7rem;
}

/* ---- Preset Grid ---- */
.fa-presets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}
.fa-preset-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.65rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.fa-preset-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.fa-preset-card.active {
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.2);
}
.fa-preset-icon {
    font-size: 1.5rem;
    line-height: 1;
}
.fa-preset-name {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.2;
}
.fa-preset-card.active .fa-preset-name {
    color: #fff;
}

/* ---- Input Row (URL + Search) ---- */
.fa-input-row {
    display: flex;
    gap: 0.5rem;
}
.fa-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
    color: #f0f0f0;
    font-size: 0.82rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
}
.fa-input:focus {
    border-color: rgba(0, 180, 216, 0.45);
}
.fa-input::placeholder {
    color: #4a5568;
}
.fa-action-btn {
    background: linear-gradient(135deg, var(--quantum-blue, #00b4d8), var(--plasma-purple, #7b4bce));
    color: #fff;
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex-shrink: 0;
}
.fa-action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(0, 180, 216, 0.3);
}
.fa-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ---- Search Results ---- */
.fa-search-results {
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}
.fa-search-results::-webkit-scrollbar {
    width: 3px;
}
.fa-search-results::-webkit-scrollbar-thumb {
    background: rgba(0, 180, 216, 0.2);
    border-radius: 3px;
}
.fa-result-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}
.fa-result-item:hover {
    background: rgba(0, 180, 216, 0.08);
}
.fa-result-thumb {
    width: 48px;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}
.fa-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.fa-result-info {
    flex: 1;
    min-width: 0;
}
.fa-result-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.fa-result-channel {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fa-result-play {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 180, 216, 0.15);
    color: var(--quantum-blue, #00b4d8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: all 0.2s;
}
.fa-result-play:hover {
    background: rgba(0, 180, 216, 0.3);
    transform: scale(1.1);
}

/* ---- Saved List ---- */
.fa-saved-list {
    max-height: 160px;
    overflow-y: auto;
}
.fa-saved-list::-webkit-scrollbar {
    width: 3px;
}
.fa-saved-list::-webkit-scrollbar-thumb {
    background: rgba(123, 75, 206, 0.3);
    border-radius: 3px;
}
.fa-saved-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    transition: background 0.2s;
}
.fa-saved-item:hover {
    background: rgba(123, 75, 206, 0.08);
}
.fa-saved-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(123, 75, 206, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--plasma-purple, #7b4bce);
}
.fa-saved-title {
    flex: 1;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    min-width: 0;
}
.fa-saved-title:hover {
    color: #fff;
}
.fa-saved-type {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    flex-shrink: 0;
}
.fa-saved-type.video {
    color: var(--quantum-blue, #00b4d8);
    background: rgba(0, 180, 216, 0.12);
}
.fa-saved-type.playlist {
    color: var(--plasma-purple, #7b4bce);
    background: rgba(123, 75, 206, 0.12);
}
.fa-saved-delete {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 0.2rem;
    font-size: 0.75rem;
    transition: color 0.2s;
    flex-shrink: 0;
}
.fa-saved-delete:hover {
    color: #ff4d4d;
}
.fa-saved-empty {
    text-align: center;
    padding: 0.8rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ---- Volume Slider ---- */
.fa-volume-section {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0 !important;
}
.fa-volume-section .fa-section-title {
    margin-bottom: 0;
    white-space: nowrap;
}
.fa-volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
}
.fa-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--quantum-blue, #00b4d8);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 180, 216, 0.4);
    transition: transform 0.15s;
}
.fa-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
.fa-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--quantum-blue, #00b4d8);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(0, 180, 216, 0.4);
}

/* ---- Search Loading ---- */
.fa-search-loading {
    text-align: center;
    padding: 1rem;
}
.fa-search-loading .fa-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0, 180, 216, 0.2);
    border-top-color: var(--quantum-blue, #00b4d8);
    border-radius: 50%;
    animation: faSpinRing 0.7s linear infinite;
    margin: 0 auto;
}
.fa-search-msg {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    padding: 0.5rem;
}

/* ---- Repeat Toggle ---- */
.fa-repeat-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    transition: all 0.2s;
    flex-shrink: 0;
}
.fa-repeat-btn:hover {
    color: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
}
.fa-repeat-btn.active {
    color: var(--neon-cyan, #00e6d6);
    border-color: rgba(0, 230, 214, 0.3);
    background: rgba(0, 230, 214, 0.08);
}

/* ---- Speed Button (collapsed bar) ---- */
.fa-speed-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}
.fa-speed-btn:hover {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.18);
}
.fa-speed-btn.speed-changed {
    color: var(--quantum-blue, #00b4d8);
    border-color: rgba(0, 180, 216, 0.3);
    background: rgba(0, 180, 216, 0.08);
}

/* ---- Speed Options (expanded panel) ---- */
.fa-speed-options {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.fa-speed-option {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.55);
    border-radius: 10px;
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    flex: 1;
    text-align: center;
    min-width: 50px;
}
.fa-speed-option:hover {
    background: rgba(0, 180, 216, 0.08);
    border-color: rgba(0, 180, 216, 0.2);
    color: rgba(255, 255, 255, 0.8);
}
.fa-speed-option.active {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.15), rgba(123, 75, 206, 0.12));
    border-color: rgba(0, 180, 216, 0.4);
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 180, 216, 0.15);
}

/* ---- Desktop Zoom (click to enlarge) ---- */
.focus-audio-bar {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@media (min-width: 769px) {
    .focus-audio-bar.fa-zoomed {
        transform: scale(1.35);
        transform-origin: center top;
        z-index: 100;
        box-shadow: 0 8px 40px rgba(0, 180, 216, 0.2), 0 0 60px rgba(0, 180, 216, 0.06);
        border-color: rgba(0, 180, 216, 0.4);
        margin-bottom: 80px;
    }
    .focus-audio-bar.fa-zoomed .fa-panel.open {
        max-height: 500px;
    }
}

/* ========== RESPONSIVE ========== */

/* Tablet */
@media (max-width: 768px) {
    .fa-presets-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.4rem;
    }
    .fa-preset-card {
        padding: 0.5rem 0.35rem;
    }
    .fa-preset-icon {
        font-size: 1.3rem;
    }
    .fa-preset-name {
        font-size: 0.6rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .fa-collapsed {
        gap: 0.6rem;
        padding: 0.6rem 0.7rem;
    }
    .fa-icon-wrap {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    .fa-yt-logo {
        width: 24px;
        height: 17px;
    }
    .fa-now-playing {
        font-size: 0.82rem;
    }
    .fa-subtitle {
        font-size: 0.7rem;
    }
    .fa-btn {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
    .fa-btn-play {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }
    .fa-presets-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    .fa-preset-card {
        flex-direction: row;
        padding: 0.55rem 0.7rem;
        gap: 0.5rem;
    }
    .fa-preset-icon {
        font-size: 1.2rem;
    }
    .fa-preset-name {
        font-size: 0.7rem;
        text-align: left;
    }
    .fa-panel-inner {
        padding: 0.8rem;
    }
}

/* Mobile touch device optimization */
@media (hover: none) and (pointer: coarse) {
    .focus-audio-bar {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    }
    .fa-panel {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(10, 10, 20, 0.95);
    }
    .fa-btn,
    .fa-action-btn,
    .fa-preset-card,
    .fa-result-item,
    .fa-saved-item,
    .fa-repeat-btn {
        transition-property: opacity, transform !important;
        transition-duration: 0.2s !important;
    }
}
