/* ============================================
   Spotify Styles
   ============================================ */

/* Spotify logo for card */
.spotify-logo {
    height: 2.5rem;
    width: auto;
    filter: brightness(0) invert(1);
}

[data-theme="light"] .spotify-logo {
    filter: brightness(0) invert(0.2);
}

/* Icon filter for Spotify green */
.group-icon-spotify {
    filter: invert(65%) sepia(72%) saturate(520%) hue-rotate(80deg) brightness(95%);
}

/* ============================================
   Spotify Modal
   ============================================ */
.spotify-modal {
    z-index: 1001;
}

.modal-spotify-fullscreen {
    width: 95vw;
    max-width: 95vw;
    height: 95vh;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

.spotify-modal .modal-header-row {
    padding: 0.125rem 0.5rem;
    border-bottom: none;
}

.spotify-logo-modal {
    height: 2.5rem;
    width: auto;
    filter: brightness(0) invert(1);
}

[data-theme="light"] .spotify-logo-modal {
    filter: brightness(0) invert(0.2);
}

.spotify-modal-content {
    flex: 1;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.spotify-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ============================================
   Spotify Tabs
   ============================================ */
.spotify-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.spotify-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.spotify-tab:hover {
    background: rgba(29, 185, 84, 0.1);
    color: #1db954;
}

.spotify-tab.active {
    background: rgba(29, 185, 84, 0.2);
    color: #1db954;
}

.spotify-tab-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
}

/* ============================================
   Now Playing
   ============================================ */
.spotify-now-playing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.spotify-album-art {
    width: 280px;
    height: 280px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.spotify-album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-no-art {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spotify-track-info {
    text-align: center;
    width: 100%;
}

.spotify-track-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.spotify-track-artist {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.spotify-track-album {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============================================
   Progress Bar
   ============================================ */
.spotify-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.spotify-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 40px;
}

.spotify-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.spotify-progress-fill {
    height: 100%;
    background: #1db954;
    border-radius: 3px;
    transition: width 0.1s linear;
}

.spotify-progress-bar:hover .spotify-progress-fill {
    background: #1ed760;
}

/* ============================================
   Controls
   ============================================ */
.spotify-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.spotify-control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.spotify-control-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    pointer-events: none;
}

.spotify-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.spotify-control-btn.spotify-play-btn {
    width: 64px;
    height: 64px;
    background: #1db954;
}

.spotify-control-btn.spotify-play-btn:hover {
    background: #1ed760;
}

.spotify-control-btn.spotify-play-btn img {
    width: 28px;
    height: 28px;
}

.spotify-control-btn.spotify-secondary {
    background: transparent;
}

.spotify-control-btn.spotify-secondary img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(0.5);
}

.spotify-control-btn.spotify-secondary.active img {
    filter: invert(65%) sepia(72%) saturate(520%) hue-rotate(80deg) brightness(95%);
}

/* ============================================
   Volume
   ============================================ */
.spotify-volume {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 300px;
}

.spotify-volume-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(0.5);
}

.spotify-volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    cursor: pointer;
}

.spotify-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #1db954;
    border-radius: 50%;
    cursor: pointer;
}

.spotify-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #1db954;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.spotify-volume-value {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 40px;
    text-align: right;
}

/* ============================================
   No Playback State
   ============================================ */
.spotify-no-playback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-muted);
}

.spotify-no-playback-icon {
    width: 80px;
    height: 80px;
    filter: brightness(0) invert(0.3);
    margin-bottom: 1.5rem;
}

.spotify-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ============================================
   Playlists Grid
   ============================================ */
.spotify-playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.spotify-playlist-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.spotify-playlist-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.spotify-playlist-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.spotify-playlist-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-playlist-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-playlist-tracks {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   Devices List
   ============================================ */
.spotify-devices-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.spotify-device {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.spotify-device:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-device.active {
    background: rgba(29, 185, 84, 0.15);
    border: 1px solid rgba(29, 185, 84, 0.3);
}

.spotify-device-icon {
    font-size: 1.5rem;
}

.spotify-device-info {
    flex: 1;
}

.spotify-device-name {
    font-size: 1rem;
    color: var(--text-primary);
}

.spotify-device-type {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.spotify-device-active-indicator {
    width: 8px;
    height: 8px;
    background: #1db954;
    border-radius: 50%;
}

.spotify-no-devices {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================
   Search
   ============================================ */
.spotify-search {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.spotify-search-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.spotify-search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.spotify-search-input:focus {
    outline: none;
    border-color: #1db954;
}

.spotify-search-btn {
    padding: 0.75rem 1.5rem;
    background: #1db954;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.spotify-search-btn:hover {
    background: #1ed760;
}

.spotify-search-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.spotify-results-section {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.spotify-tracks-list {
    display: flex;
    flex-direction: column;
}

.spotify-track-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.spotify-track-row:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-track-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.spotify-track-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-track-details {
    flex: 1;
    min-width: 0;
}

.spotify-track-title {
    font-size: 0.95rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-track-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-track-duration {
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.spotify-no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* ============================================
   Playlist Modal
   ============================================ */
.spotify-playlist-modal {
    z-index: 1002;
}

.modal-spotify-playlist {
    width: 95vw;
    max-width: 600px;
    height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.spotify-playlist-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.spotify-play-all-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #1db954;
    border: none;
    border-radius: 24px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: background 0.2s;
}

.spotify-play-all-btn:hover {
    background: #1ed760;
}

.spotify-play-all-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

.spotify-icon {
    filter: invert(65%) sepia(72%) saturate(520%) hue-rotate(80deg) brightness(95%);
}

.spotify-auth-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    gap: 1.5rem;
    color: var(--text-muted);
}

.spotify-error {
    color: #e94560;
    text-align: center;
    padding: 2rem;
}

/* ============================================
   Split Layout
   ============================================ */
.spotify-split-layout {
    display: flex;
    gap: 1.5rem;
    height: 100%;
    min-height: 500px;
}

.spotify-left-panel {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
}

.spotify-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.spotify-now-playing-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    height: 100%;
}

.spotify-now-playing-panel .spotify-album-art {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.spotify-now-playing-panel .spotify-album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-now-playing-panel .spotify-track-info {
    text-align: center;
    width: 100%;
}

.spotify-now-playing-panel .spotify-track-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-now-playing-panel .spotify-track-artist {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-artist-link {
    cursor: pointer;
    transition: color 0.2s;
}

.spotify-artist-link:hover {
    color: #fff;
    text-decoration: underline;
}

.spotify-now-playing-panel .spotify-progress {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spotify-now-playing-panel .spotify-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spotify-now-playing-panel .spotify-volume {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.5rem;
}

.spotify-device-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(29, 185, 84, 0.15);
    border: 1px solid rgba(29, 185, 84, 0.3);
    border-radius: 24px;
    color: #1db954;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: auto;
    width: 100%;
}

.spotify-device-btn:hover {
    background: rgba(29, 185, 84, 0.25);
    border-color: rgba(29, 185, 84, 0.5);
}

.spotify-device-btn img {
    width: 20px;
    height: 20px;
    filter: invert(65%) sepia(72%) saturate(520%) hue-rotate(80deg) brightness(95%);
}

.spotify-device-btn span {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   Search Bar
   ============================================ */
.spotify-search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    margin-right: 0.625rem;
}

.spotify-search-bar:focus-within {
    background: rgba(255, 255, 255, 0.15);
}

.spotify-search-icon {
    width: 18px;
    height: 18px;
    filter: invert(1);
    opacity: 0.7;
    flex-shrink: 0;
}

.spotify-search-bar .spotify-search-input {
    flex: 1;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.9rem;
}

.spotify-search-bar .spotify-search-input:focus {
    outline: none;
}

.spotify-search-bar .spotify-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.spotify-search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}

.spotify-search-clear:hover {
    background: rgba(255, 255, 255, 0.3);
}

.spotify-search-clear img {
    width: 12px;
    height: 12px;
    filter: invert(1);
}

/* ============================================
   Search Results
   ============================================ */
.spotify-search-results-container {
    padding-bottom: 1rem;
}

.spotify-search-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 1rem 0;
}

.spotify-search-top-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.spotify-top-result {
    flex: 0 0 280px;
}

.spotify-top-result-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
}

.spotify-top-result-card:hover {
    background: rgba(255, 255, 255, 0.2);
}

.spotify-top-result-img {
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.spotify-top-result-img.round {
    border-radius: 50%;
}

.spotify-top-result-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-top-result-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-top-result-type {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.spotify-search-songs {
    flex: 1;
    min-width: 0;
}

.spotify-search-songs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.spotify-search-song-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.spotify-search-song-row:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-search-song-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.spotify-search-song-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-search-song-info {
    flex: 1;
    min-width: 0;
}

.spotify-search-song-title {
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-search-song-artist {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-search-song-duration {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

.spotify-search-section {
    margin-bottom: 1.5rem;
}

.spotify-search-row {
    display: flex;
    gap: 1rem;
    overflow: hidden;
}

.spotify-search-card {
    flex: 0 0 calc((100% - 6rem) / 7);
    min-width: 100px;
    cursor: pointer;
}

.spotify-search-card-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.spotify-search-card-round .spotify-search-card-img {
    border-radius: 50%;
}

.spotify-search-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-search-card-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
}

.spotify-search-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.spotify-search-card-type {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-search-card:hover .spotify-search-card-img {
    opacity: 0.8;
}

/* ============================================
   Filter Pills
   ============================================ */
.spotify-filter-pills {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.spotify-filter-pill {
    padding: 0.4rem 0.9rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.spotify-filter-pill:hover {
    background: rgba(255, 255, 255, 0.2);
}

.spotify-filter-pill.active {
    background: #fff;
    color: #000;
}

/* ============================================
   Browse Tabs
   ============================================ */
.spotify-browse-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-right: .625rem;
}

.spotify-browse-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.spotify-browse-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.spotify-browse-tab.active {
    background: rgba(29, 185, 84, 0.2);
    border-color: rgba(29, 185, 84, 0.4);
    color: #1db954;
}

/* ============================================
   Browse Content
   ============================================ */
.spotify-browse-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.spotify-browse-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* ============================================
   Playlist Row (List View)
   ============================================ */
.spotify-playlist-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.spotify-playlist-row:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-playlist-thumb {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.spotify-playlist-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-playlist-details {
    flex: 1;
    min-width: 0;
}

.spotify-playlist-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-playlist-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.spotify-no-art-small {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

/* ============================================
   Device Modal
   ============================================ */
.spotify-device-modal {
    z-index: 1100;
}

.spotify-device-modal .modal-content {
    max-width: 400px;
}

.modal-spotify-device {
    max-width: 400px;
}

.spotify-device-content {
    padding: 1rem 0;
}

/* ============================================
   Album/Artist Detail Modal
   ============================================ */
.spotify-detail-modal {
    z-index: 1100;
}

.modal-spotify-detail {
    max-width: 500px;
    max-height: 80vh;
}

.modal-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

.modal-back-btn img {
    width: 24px;
    height: 24px;
    filter: invert(1);
    opacity: 0.7;
}

.modal-back-btn:hover img {
    opacity: 1;
}

.spotify-detail-content {
    padding: 1rem 0;
}

/* ============================================
   Inline Detail View
   ============================================ */
.spotify-detail-inline {
    display: flex;
    flex-direction: column;
}

.spotify-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.spotify-back-btn:hover {
    opacity: 1;
}

.spotify-back-btn img {
    width: 20px;
    height: 20px;
    filter: invert(1);
}

.spotify-detail-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.spotify-detail-image {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
}

.spotify-detail-image.round {
    border-radius: 50%;
}

.spotify-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.spotify-detail-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.25rem;
}

.spotify-detail-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-detail-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.75rem;
}

.spotify-detail-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.spotify-detail-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.spotify-play-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    background: #1db954;
    border: none;
    border-radius: 24px;
    color: #000;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.spotify-play-btn:hover {
    background: #1ed760;
    transform: scale(1.02);
}

.spotify-play-btn img {
    width: 18px;
    height: 18px;
    filter: brightness(0);
}

.spotify-shuffle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
}

.spotify-shuffle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.spotify-shuffle-btn img {
    width: 16px;
    height: 16px;
    filter: invert(1);
}

.spotify-save-btn,
.spotify-follow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.spotify-save-btn:hover,
.spotify-follow-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.spotify-save-btn img,
.spotify-follow-btn img {
    width: 18px;
    height: 18px;
    filter: invert(1);
}

.spotify-save-btn.saved img {
    filter: invert(32%) sepia(98%) saturate(1234%) hue-rotate(330deg) brightness(95%) contrast(95%);
}

.spotify-follow-btn.following {
    background: rgba(30, 215, 96, 0.2);
    border-color: rgba(30, 215, 96, 0.4);
}

.spotify-follow-btn.following img {
    filter: invert(70%) sepia(63%) saturate(495%) hue-rotate(91deg) brightness(94%) contrast(86%);
}

.spotify-detail-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #fff;
}

.spotify-detail-tracks {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
}

.spotify-detail-track {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.spotify-detail-track:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-detail-track-num {
    width: 24px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.spotify-detail-track-info {
    flex: 1;
    min-width: 0;
}

.spotify-detail-track-name {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-detail-track-artist {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.spotify-detail-track-duration {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   Artist Albums Grid
   ============================================ */
.spotify-artist-albums {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.spotify-artist-album {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
}

.spotify-artist-album:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-artist-album-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.4rem;
    background: rgba(0, 0, 0, 0.3);
}

.spotify-artist-album-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-artist-album-name {
    font-size: 0.8rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-artist-album-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.spotify-artist-album-year {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   Artist Detail Two-Column Layout
   ============================================ */
.spotify-artist-detail-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    height: 100%;
}

.spotify-artist-detail-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    align-self: start;
}

.spotify-artist-image-large {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.spotify-artist-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-artist-info {
    text-align: center;
}

.spotify-artist-name-large {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.spotify-artist-genres {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
}

.spotify-artist-followers {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.spotify-artist-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.spotify-artist-detail-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.spotify-artist-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ============================================
   Artist Top Tracks
   ============================================ */
.spotify-artist-top-tracks {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.spotify-artist-track {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.spotify-artist-track:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-artist-track-num {
    width: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

.spotify-artist-track-image {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.spotify-artist-track-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-artist-track-info {
    flex: 1;
    min-width: 0;
}

.spotify-artist-track-name {
    font-size: 0.95rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-artist-track-duration {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

/* Now Playing Track State */
.spotify-artist-track.now-playing {
    background: rgba(29, 185, 84, 0.15);
    border: 1px solid rgba(29, 185, 84, 0.5);
}

.spotify-artist-track.now-playing .spotify-artist-track-name {
    color: #1db954;
}

.spotify-artist-track.now-playing .spotify-artist-track-num {
    color: #1db954;
}

.now-playing-icon {
    width: 14px;
    height: 14px;
    filter: invert(52%) sepia(84%) saturate(431%) hue-rotate(88deg) brightness(95%) contrast(92%);
}

/* ============================================
   Album Detail Two-Column Layout
   ============================================ */
.spotify-album-detail-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    height: 100%;
}

.spotify-album-detail-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    align-self: start;
}

.spotify-album-image-large {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.spotify-album-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-album-info {
    text-align: center;
}

.spotify-album-name-large {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    line-height: 1.2;
}

.spotify-album-artists {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.25rem;
}

.spotify-album-artist-link {
    cursor: pointer;
    transition: color 0.15s;
}

.spotify-album-artist-link:hover {
    color: #1db954;
    text-decoration: underline;
}

.spotify-album-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.spotify-album-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.spotify-secondary-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 0.75rem;
}

.spotify-album-detail-right {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

/* Album Track List */
.spotify-album-tracklist {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.spotify-album-track {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.spotify-album-track:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-album-track-num {
    width: 1.75rem;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.spotify-album-track-info {
    flex: 1;
    min-width: 0;
}

.spotify-album-track-name {
    font-size: 1rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-album-track-duration {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

/* Album Track Now Playing State */
.spotify-album-track.now-playing {
    background: rgba(29, 185, 84, 0.15);
    border: 1px solid rgba(29, 185, 84, 0.5);
}

.spotify-album-track.now-playing .spotify-album-track-name {
    color: #1db954;
}

.spotify-album-track.now-playing .spotify-album-track-num {
    color: #1db954;
}

.spotify-no-devices {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
}

.spotify-no-devices .modal-btn {
    margin-top: 1rem;
}

/* ============================================
   Home Sections
   ============================================ */
.spotify-home-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-right: 0.625rem;
}

.spotify-home-section {
    margin-bottom: 0;
}

.spotify-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.spotify-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.spotify-section-showall {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.spotify-section-showall:hover {
    color: #fff;
    text-decoration: underline;
}

/* Section View (Show All) */
.spotify-section-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.spotify-section-view-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0.5rem 0 1rem 0;
}

.spotify-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

/* Horizontal scroll row within sections */
.spotify-scroll-row {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.spotify-scroll-row::-webkit-scrollbar {
    display: none;
}

.spotify-home-card {
    flex: 0 0 180px;
    width: 180px;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0.5rem;
    border-radius: 8px;
}

.spotify-home-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-home-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
}

.spotify-home-card-image.round {
    border-radius: 50%;
}

.spotify-home-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.spotify-play-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1db954;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.spotify-home-card:hover .spotify-play-overlay {
    opacity: 1;
    transform: translateY(0);
}

.spotify-play-overlay:hover {
    transform: scale(1.05);
    background: #1ed760;
}

.spotify-play-overlay img {
    width: 22px;
    height: 22px;
    filter: brightness(0);
    margin-left: 3px;
}

.spotify-home-card-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
    margin-top: 0.25rem;
}

.spotify-home-card-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* Allow 2 lines for subtitle with multiline */
.spotify-home-card-subtitle.multiline {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ============================================
   Library
   ============================================ */
.spotify-library-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.spotify-library-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.spotify-library-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.spotify-library-search {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.spotify-library-search-icon {
    position: absolute;
    left: 0.75rem;
    width: 16px;
    height: 16px;
    filter: invert(1);
    opacity: 0.6;
}

.spotify-library-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
    color: #fff;
    font-size: 0.9rem;
}

.spotify-library-search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.spotify-library-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.spotify-library-search-clear {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spotify-library-search-clear img {
    width: 14px;
    height: 14px;
    filter: invert(1);
    opacity: 0.6;
}

.spotify-library-search-clear:hover img {
    opacity: 1;
}

.spotify-library-sort-select {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
}

.spotify-library-sort-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.spotify-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.spotify-library-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.spotify-library-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-library-item-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
}

.spotify-library-item-image.round {
    border-radius: 50%;
}

.spotify-library-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-library-item-info {
    min-width: 0;
}

.spotify-library-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-library-item-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Liked Songs Special Card */
.spotify-liked-songs-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #450af5, #c4efd9);
}

.spotify-library-item .spotify-liked-songs-gradient {
    border-radius: 6px;
}

.spotify-no-art.round {
    border-radius: 50%;
}

/* ============================================
   Liked Songs Detail View
   ============================================ */
.spotify-liked-songs-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.spotify-liked-songs-header {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    padding-bottom: 1rem;
}

.spotify-liked-songs-image {
    width: 180px;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.spotify-liked-songs-image .spotify-liked-songs-gradient {
    border-radius: 8px;
}

.spotify-liked-songs-icon {
    position: relative;
    width: 64px;
    height: 64px;
    filter: invert(1);
}

.spotify-liked-songs-info {
    flex: 1;
}

.spotify-liked-songs-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 0.25rem 0;
}

.spotify-liked-songs-count {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.spotify-liked-songs-actions {
    display: flex;
    gap: 0.75rem;
}

.spotify-liked-songs-tracks {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.spotify-liked-track {
    display: grid;
    grid-template-columns: 30px 40px 1fr 1fr 60px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.spotify-liked-track:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-liked-track.now-playing {
    background: rgba(30, 215, 96, 0.15);
}

.spotify-liked-track-num {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    text-align: center;
}

.spotify-liked-track.now-playing .spotify-liked-track-num {
    color: #1db954;
}

.spotify-liked-track-image {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.spotify-liked-track-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-liked-track-info {
    min-width: 0;
}

.spotify-liked-track-name {
    font-size: 0.9rem;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-liked-track.now-playing .spotify-liked-track-name {
    color: #1db954;
}

.spotify-liked-track-artist {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-liked-track-album {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-liked-track-duration {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: right;
}

/* ============================================
   Mini Player
   ============================================ */
.spotify-mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-elevated);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
    z-index: 900;
    cursor: pointer;
    border-top: 1px solid rgba(29, 185, 84, 0.3);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.spotify-mini-art {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.spotify-mini-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-mini-info {
    flex: 1;
    min-width: 0;
    padding-right: 0.5rem;
}

.spotify-mini-track {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-mini-artist {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-mini-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.spotify-mini-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.spotify-mini-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(0.7);
}

.spotify-mini-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-mini-btn:hover img {
    filter: brightness(0) invert(1);
}

.spotify-mini-btn.spotify-mini-play {
    width: 44px;
    height: 44px;
    background: #1db954;
    margin: 0 0.25rem;
}

.spotify-mini-btn.spotify-mini-play img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

.spotify-mini-btn.spotify-mini-play:hover {
    background: #1ed760;
    transform: scale(1.05);
}

.spotify-mini-volume {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    flex-shrink: 0;
}

.spotify-mini-volume-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.spotify-mini-volume-slider {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
}

.spotify-mini-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.spotify-mini-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
}

.spotify-mini-device-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    max-width: 150px;
}

.spotify-mini-device-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.spotify-mini-device-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.spotify-mini-device-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-mini-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.spotify-mini-progress-fill {
    height: 100%;
    background: #1db954;
    transition: width 0.1s linear;
}

/* Adjust page content when mini player is visible */
body:has(.spotify-mini-player[style*="display: flex"]) .home-container {
    padding-bottom: 80px;
}

body:has(.spotify-mini-player[style*="display: flex"]) .groups-grid {
    padding-bottom: 1rem;
}

/* ============================================
   Light Theme Overrides
   ============================================ */

/* Now Playing Panel */
[data-theme="light"] .spotify-now-playing-panel {
    background: var(--bg-secondary);
}

[data-theme="light"] .spotify-now-playing-panel .spotify-track-artist {
    color: var(--text-secondary);
}

/* Control buttons */
[data-theme="light"] .spotify-control-btn {
    background: var(--bg-tertiary);
}

[data-theme="light"] .spotify-control-btn:hover {
    background: var(--bg-hover);
}

[data-theme="light"] .spotify-control-btn img {
    filter: brightness(0) invert(0.2);
}

[data-theme="light"] .spotify-control-btn.spotify-secondary img {
    filter: brightness(0) invert(0.4);
}

/* Volume */
[data-theme="light"] .spotify-volume-icon {
    filter: brightness(0) invert(0.3);
}

/* No playback icon */
[data-theme="light"] .spotify-no-playback-icon {
    filter: brightness(0) invert(0.5);
}

/* Device button */
[data-theme="light"] .spotify-device-btn {
    background: rgba(29, 185, 84, 0.1);
    border-color: rgba(29, 185, 84, 0.3);
}

[data-theme="light"] .spotify-device-btn:hover {
    background: rgba(29, 185, 84, 0.2);
}

/* Tabs */
[data-theme="light"] .spotify-tab {
    color: var(--text-secondary);
}

[data-theme="light"] .spotify-tab:hover {
    background: rgba(29, 185, 84, 0.1);
}

[data-theme="light"] .spotify-tab.active {
    background: rgba(29, 185, 84, 0.15);
}

/* Browse tabs */
[data-theme="light"] .spotify-browse-tab {
    background: var(--bg-elevated);
    border-color: var(--border);
    color: var(--text-secondary);
}

[data-theme="light"] .spotify-browse-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="light"] .spotify-browse-tab.active {
    background: rgba(29, 185, 84, 0.15);
    border-color: rgba(29, 185, 84, 0.4);
}

/* Search bar */
[data-theme="light"] .spotify-search-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

[data-theme="light"] .spotify-search-bar:focus-within {
    background: var(--bg-elevated);
    border-color: #1db954;
}

[data-theme="light"] .spotify-search-icon {
    filter: brightness(0) invert(0.3);
}

[data-theme="light"] .spotify-search-bar .spotify-search-input {
    color: var(--text-primary);
}

[data-theme="light"] .spotify-search-bar .spotify-search-input::placeholder {
    color: var(--text-muted);
}

[data-theme="light"] .spotify-search-clear {
    background: var(--bg-tertiary);
}

[data-theme="light"] .spotify-search-clear:hover {
    background: var(--bg-hover);
}

[data-theme="light"] .spotify-search-clear img {
    filter: brightness(0) invert(0.3);
}

/* Section titles */
[data-theme="light"] .spotify-section-title {
    color: var(--text-primary);
}

[data-theme="light"] .spotify-section-showall {
    color: var(--text-muted);
}

[data-theme="light"] .spotify-section-showall:hover {
    color: var(--text-primary);
}

/* Home cards */
[data-theme="light"] .spotify-home-card:hover {
    background: var(--bg-secondary);
}

[data-theme="light"] .spotify-home-card-name {
    color: var(--text-primary);
}

[data-theme="light"] .spotify-home-card-subtitle {
    color: var(--text-secondary);
}

/* Playlist cards */
[data-theme="light"] .spotify-playlist-card {
    background: var(--bg-elevated);
}

[data-theme="light"] .spotify-playlist-card:hover {
    background: var(--bg-secondary);
}

/* Playlist rows */
[data-theme="light"] .spotify-playlist-row:hover {
    background: var(--bg-secondary);
}

[data-theme="light"] .spotify-playlist-subtitle {
    color: var(--text-muted);
}

/* Search results */
[data-theme="light"] .spotify-search-section-title {
    color: var(--text-primary);
}

[data-theme="light"] .spotify-top-result-card {
    background: var(--bg-secondary);
}

[data-theme="light"] .spotify-top-result-card:hover {
    background: var(--bg-tertiary);
}

[data-theme="light"] .spotify-top-result-name {
    color: var(--text-primary);
}

[data-theme="light"] .spotify-top-result-type {
    color: var(--text-secondary);
}

[data-theme="light"] .spotify-search-song-row:hover {
    background: var(--bg-secondary);
}

[data-theme="light"] .spotify-search-song-title {
    color: var(--text-primary);
}

[data-theme="light"] .spotify-search-song-artist {
    color: var(--text-secondary);
}

[data-theme="light"] .spotify-search-song-duration {
    color: var(--text-muted);
}

[data-theme="light"] .spotify-search-card-name {
    color: var(--text-primary);
}

[data-theme="light"] .spotify-search-card-type {
    color: var(--text-secondary);
}

/* Filter pills */
[data-theme="light"] .spotify-filter-pill {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="light"] .spotify-filter-pill:hover {
    background: var(--bg-tertiary);
}

[data-theme="light"] .spotify-filter-pill.active {
    background: var(--text-primary);
    color: var(--bg-elevated);
}

/* Library items */
[data-theme="light"] .spotify-library-item {
    background: var(--bg-elevated);
}

[data-theme="light"] .spotify-library-item:hover {
    background: var(--bg-secondary);
}

[data-theme="light"] .spotify-library-item-name {
    color: var(--text-primary);
}

[data-theme="light"] .spotify-library-item-meta {
    color: var(--text-secondary);
}

/* Library search */
[data-theme="light"] .spotify-library-search-input {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="light"] .spotify-library-search-input:focus {
    background: var(--bg-elevated);
    border-color: #1db954;
}

[data-theme="light"] .spotify-library-search-input::placeholder {
    color: var(--text-muted);
}

[data-theme="light"] .spotify-library-search-icon {
    filter: brightness(0) invert(0.3);
}

[data-theme="light"] .spotify-library-search-clear img {
    filter: brightness(0) invert(0.3);
}

[data-theme="light"] .spotify-library-sort-select {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

/* Detail views */
[data-theme="light"] .spotify-back-btn {
    color: var(--text-primary);
}

[data-theme="light"] .spotify-back-btn img {
    filter: brightness(0) invert(0.2);
}

[data-theme="light"] .spotify-detail-type {
    color: var(--text-muted);
}

[data-theme="light"] .spotify-detail-subtitle {
    color: var(--text-secondary);
}

[data-theme="light"] .spotify-detail-meta {
    color: var(--text-muted);
}

[data-theme="light"] .spotify-detail-section-title {
    color: var(--text-primary);
}

[data-theme="light"] .spotify-detail-track:hover {
    background: var(--bg-secondary);
}

[data-theme="light"] .spotify-detail-track-num {
    color: var(--text-muted);
}

[data-theme="light"] .spotify-detail-track-artist {
    color: var(--text-secondary);
}

[data-theme="light"] .spotify-detail-track-duration {
    color: var(--text-muted);
}

/* Artist detail */
[data-theme="light"] .spotify-artist-genres {
    color: var(--text-secondary);
}

[data-theme="light"] .spotify-artist-followers {
    color: var(--text-muted);
}

[data-theme="light"] .spotify-artist-track:hover {
    background: var(--bg-secondary);
}

[data-theme="light"] .spotify-artist-track-num {
    color: var(--text-muted);
}

[data-theme="light"] .spotify-artist-track-duration {
    color: var(--text-muted);
}

/* Album detail */
[data-theme="light"] .spotify-album-artists {
    color: var(--text-secondary);
}

[data-theme="light"] .spotify-album-meta {
    color: var(--text-muted);
}

[data-theme="light"] .spotify-album-track:hover {
    background: var(--bg-secondary);
}

[data-theme="light"] .spotify-album-track-num {
    color: var(--text-muted);
}

[data-theme="light"] .spotify-album-track-duration {
    color: var(--text-muted);
}

[data-theme="light"] .spotify-artist-album:hover {
    background: var(--bg-secondary);
}

[data-theme="light"] .spotify-artist-album-year {
    color: var(--text-muted);
}

/* Shuffle button */
[data-theme="light"] .spotify-shuffle-btn {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="light"] .spotify-shuffle-btn:hover {
    background: var(--bg-tertiary);
}

[data-theme="light"] .spotify-shuffle-btn img {
    filter: brightness(0) invert(0.2);
}

/* Save/Follow buttons */
[data-theme="light"] .spotify-save-btn,
[data-theme="light"] .spotify-follow-btn {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="light"] .spotify-save-btn:hover,
[data-theme="light"] .spotify-follow-btn:hover {
    background: var(--bg-tertiary);
}

[data-theme="light"] .spotify-save-btn img,
[data-theme="light"] .spotify-follow-btn img {
    filter: brightness(0) invert(0.2);
}

/* Liked songs */
[data-theme="light"] .spotify-liked-songs-count {
    color: var(--text-secondary);
}

[data-theme="light"] .spotify-liked-track:hover {
    background: var(--bg-secondary);
}

[data-theme="light"] .spotify-liked-track-num {
    color: var(--text-muted);
}

[data-theme="light"] .spotify-liked-track-name {
    color: var(--text-primary);
}

[data-theme="light"] .spotify-liked-track-artist {
    color: var(--text-secondary);
}

[data-theme="light"] .spotify-liked-track-album {
    color: var(--text-secondary);
}

[data-theme="light"] .spotify-liked-track-duration {
    color: var(--text-muted);
}

/* Browse empty state */
[data-theme="light"] .spotify-browse-empty {
    color: var(--text-muted);
}

/* Device list */
[data-theme="light"] .spotify-device {
    background: var(--bg-elevated);
}

[data-theme="light"] .spotify-device:hover {
    background: var(--bg-secondary);
}

/* Modal back button */
[data-theme="light"] .modal-back-btn img {
    filter: brightness(0) invert(0.2);
}
