/**
 * Songs Discovery Page Styles
 * Browse/discover all songs with waveforms, filters, and playback
 */

.songs-discovery-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* ============================================================
   HEADER
   ============================================================ */

.songs-discovery-header {
    position: relative;
    padding: 40px 0 30px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.songs-discovery-title {
    margin: 0 0 8px 0;
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
}

.songs-discovery-title i {
    color: var(--color-hot-pink);
    font-size: 30px;
}

.songs-discovery-subtitle {
    margin: 0;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
}

.songs-discovery-subtitle .songs-total-count {
    color: var(--color-hot-pink);
    font-weight: 600;
}

/* ============================================================
   FILTER BAR
   ============================================================ */

.songs-discovery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 15px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Search */
.songs-filter-search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.songs-search-input {
    width: 100%;
    padding: 10px 38px 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.songs-search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.songs-search-input:focus {
    outline: none;
    border-color: var(--color-hot-pink);
    box-shadow: 0 0 0 3px rgba(226, 55, 178, 0.2);
}

.songs-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    font-size: 13px;
}

/* Filter Group */
.songs-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Multiselect Dropdown */
.songs-filter-multiselect {
    position: relative;
}

.songs-discovery-page .songs-filter-btn,
.songs-discovery-page .songs-filter-btn[type="button"] {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.songs-discovery-page .songs-filter-btn:hover,
.songs-discovery-page .songs-filter-btn[type="button"]:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.songs-filter-btn.has-selection {
    border-color: var(--color-hot-pink);
    background: rgba(226, 55, 178, 0.15);
    color: #fff;
}

.songs-filter-btn i:first-child {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.songs-filter-btn.has-selection i:first-child {
    color: var(--color-hot-pink);
}

.filter-count {
    background: var(--color-hot-pink);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.filter-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.songs-filter-multiselect.open .filter-arrow {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.songs-filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 100;
    width: 260px;
    background: #1e1e3a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.songs-filter-multiselect.open .songs-filter-dropdown {
    display: block;
}

.filter-dropdown-search {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: #fff;
    font-size: 13px;
}

.filter-dropdown-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.filter-dropdown-search:focus {
    outline: none;
    border-bottom-color: var(--color-hot-pink);
}

.filter-dropdown-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 6px 0;
}

.filter-dropdown-list::-webkit-scrollbar {
    width: 5px;
}

.filter-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.filter-dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.filter-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.filter-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.filter-dropdown-item input[type="checkbox"] {
    accent-color: var(--color-hot-pink);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.filter-dropdown-item .term-count {
    margin-left: auto;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
}

.filter-dropdown-item.hidden {
    display: none;
}

.filter-dropdown-actions {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.15);
}

.songs-discovery-page .filter-clear-btn,
.songs-discovery-page button.filter-clear-btn {
    padding: 5px 12px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
}

.songs-discovery-page .filter-clear-btn:hover,
.songs-discovery-page button.filter-clear-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.songs-discovery-page .filter-apply-btn,
.songs-discovery-page button.filter-apply-btn {
    padding: 5px 16px;
    border: none;
    background: var(--color-hot-pink);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.songs-discovery-page .filter-apply-btn:hover,
.songs-discovery-page button.filter-apply-btn:hover {
    background: #c92da0;
    color: #fff;
}

/* BPM Range */
.songs-filter-bpm {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bpm-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bpm-label i {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.bpm-input {
    width: 70px;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    text-align: center;
}

.bpm-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.bpm-input:focus {
    outline: none;
    border-color: var(--color-hot-pink);
}

.bpm-sep {
    color: rgba(255, 255, 255, 0.3);
}

/* Filter Actions */
.songs-filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-left: auto;
}

.songs-sort-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.songs-sort-wrap .sort-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-hot-pink);
    display: flex;
    align-items: center;
    gap: 5px;
}

.songs-sort-select {
    padding: 9px 32px 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 150px;
}

.songs-sort-select:focus {
    outline: none;
    border-color: var(--color-hot-pink);
}

.songs-sort-select option {
    background: #1e1e3a;
    color: #fff;
}

/* Play All (reuse taxonomy pattern) */
.songs-discovery-page .play-all-btn,
.songs-discovery-page button.play-all-btn[type="button"] {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: var(--color-hot-pink);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.songs-discovery-page .play-all-btn:hover,
.songs-discovery-page button.play-all-btn[type="button"]:hover {
    background: var(--color-orange);
    color: #fff;
    transform: translateY(-1px);
}

.songs-discovery-page .play-all-btn i {
    font-size: 11px;
}

/* ============================================================
   ACTIVE FILTERS
   ============================================================ */

.songs-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    padding: 0 4px;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.active-filter-tag.genre-tag {
    background: rgba(47, 110, 211, 0.2);
    color: var(--color-bright-blue);
    border: 1px solid rgba(47, 110, 211, 0.3);
}

.active-filter-tag.mood-tag {
    background: rgba(240, 145, 77, 0.2);
    color: var(--color-orange);
    border: 1px solid rgba(240, 145, 77, 0.3);
}

.active-filter-tag.bpm-tag {
    background: rgba(226, 55, 178, 0.15);
    color: var(--color-hot-pink);
    border: 1px solid rgba(226, 55, 178, 0.3);
}

.active-filter-tag .remove-filter {
    font-size: 10px;
    opacity: 0.7;
}

.active-filter-tag:hover {
    opacity: 0.8;
}

.active-filter-tag:hover .remove-filter {
    opacity: 1;
}

/* ============================================================
   RESULTS INFO
   ============================================================ */

.songs-results-info {
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    padding: 0 4px;
}

/* ============================================================
   LOADING
   ============================================================ */

.songs-loading {
    display: none;
    justify-content: center;
    padding: 40px;
}

.songs-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-hot-pink);
    border-radius: 50%;
    animation: songs-spin 1s linear infinite;
}

@keyframes songs-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   SONGS CONTAINER
   ============================================================ */

.songs-discovery-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: opacity 0.2s;
}

.songs-discovery-no-results,
.songs-discovery-error {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
}

/* ============================================================
   SONG ROW
   ============================================================ */

.sd-song-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.025);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.sd-song-row:hover {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(226, 55, 178, 0.25);
}

/* Play Button / Cover */
.sd-play-btn,
button.sd-play-btn,
.songs-discovery-page button.sd-play-btn[type="button"] {
    width: 54px;
    height: 54px;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: none;
}

.sd-cover {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.2s;
}

.sd-cover i {
    font-size: 18px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.sd-song-row:hover .sd-cover {
    filter: brightness(0.65);
}

.sd-song-row:hover .sd-cover i {
    opacity: 1;
}

/* Waveform */
.sd-waveform-wrap {
    flex: 1;
    min-width: 80px;
    max-width: 220px;
    height: 40px;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: default;
}

.sd-waveform-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Song Info */
.sd-song-info {
    flex: 2;
    min-width: 0;
}

.sd-song-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-song-title:hover {
    color: var(--color-hot-pink);
}

.sd-song-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    margin-bottom: 4px;
}

.sd-artist {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
}

.sd-artist:hover {
    color: var(--color-hot-pink);
}

.sd-meta-sep {
    color: rgba(255, 255, 255, 0.25);
}

.sd-album {
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
}

.sd-album:hover {
    color: var(--color-hot-pink);
}

/* Tags */
.sd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.sd-tag {
    padding: 1px 7px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.sd-tag.genre-tag {
    background: rgba(47, 110, 211, 0.15);
    color: var(--color-bright-blue);
}

.sd-tag.genre-tag:hover {
    background: rgba(47, 110, 211, 0.25);
}

.sd-tag.mood-tag {
    background: rgba(240, 145, 77, 0.15);
    color: var(--color-orange);
}

.sd-tag.mood-tag:hover {
    background: rgba(245, 176, 65, 0.25);
}

/* Song Details (BPM, Duration, Key) */
.sd-details {
    display: flex;
    gap: 14px;
    flex-shrink: 0;
    align-items: center;
}

.sd-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 40px;
}

.sd-detail-value {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Monaco', 'Consolas', monospace;
}

.sd-detail-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.3);
}

/* Actions */
.sd-actions {
    flex-shrink: 0;
}

.sd-license-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
    background: rgba(226, 55, 178, 0.18);
    color: var(--color-hot-pink);
}

.sd-license-btn:hover {
    background: var(--color-hot-pink);
    color: #fff;
}

/* Currently playing */
.sd-song-row.is-playing {
    background: rgba(47, 110, 211, 0.08);
    border-color: rgba(47, 110, 211, 0.3);
}

.sd-song-row.is-playing .sd-cover {
    box-shadow: 0 0 0 2px var(--color-bright-blue);
}

/* ============================================================
   PAGINATION
   ============================================================ */

.songs-discovery-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.songs-discovery-pagination .pagination-inner {
    display: flex;
    align-items: center;
    gap: 5px;
}

.songs-discovery-pagination .page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.songs-discovery-pagination .page-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.songs-discovery-pagination .page-btn.active {
    background: var(--color-hot-pink);
    border-color: var(--color-hot-pink);
    color: #fff;
}

.songs-discovery-pagination .page-ellipsis {
    color: rgba(255, 255, 255, 0.35);
    padding: 0 6px;
}

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

@media (max-width: 1024px) {
    .sd-waveform-wrap {
        max-width: 160px;
    }

    .sd-details {
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .songs-discovery-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .songs-filter-search {
        max-width: none;
    }

    .songs-filter-group {
        flex-wrap: wrap;
    }

    .songs-filter-actions {
        margin-left: 0;
        justify-content: space-between;
    }

    .sd-waveform-wrap {
        display: none;
    }

    .sd-song-row {
        gap: 10px;
        padding: 8px 10px;
    }

    .sd-play-btn {
        width: 46px;
        height: 46px;
    }

    .sd-tags {
        display: none;
    }

    .sd-details {
        gap: 8px;
    }

    .sd-detail {
        min-width: 32px;
    }

    .sd-detail-value {
        font-size: 12px;
    }

    /* Dropdown goes full-width on mobile */
    .songs-filter-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 60vh;
        z-index: 1000;
    }

    .filter-dropdown-list {
        max-height: 45vh;
    }
}

@media (max-width: 480px) {
    .songs-discovery-title {
        font-size: 26px;
    }

    .songs-discovery-title i {
        font-size: 22px;
    }

    .sd-details {
        flex-direction: column;
        gap: 4px;
    }

    .sd-detail {
        flex-direction: row;
        gap: 4px;
    }

    .sd-detail-label {
        display: none;
    }

    .songs-filter-bpm {
        width: 100%;
    }

    .bpm-input {
        flex: 1;
    }
}
