/**
 * Whisky Music Playlist Styles
 */

.whisky-playlist-widget {
    background: #faf8f5;
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem 0;
}

/* Header */
.playlist-header {
    margin-bottom: 1.5rem;
}

.playlist-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.playlist-title svg {
    width: 24px;
    height: 24px;
    color: #8b4513;
}

.playlist-subtitle {
    font-size: 0.9375rem;
    color: #666;
}

/* Login Prompt */
.playlist-login-prompt {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.playlist-login-prompt a {
    color: #8b4513;
    font-weight: 600;
}

/* User Section */
.playlist-user-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.playlist-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.playlist-name {
    font-size: 1.0625rem;
    font-weight: 600;
}

.playlist-song-count {
    font-size: 0.8125rem;
    color: #888;
}

/* Songs List */
.playlist-songs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.playlist-song {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.625rem;
    background: #f8f8f8;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.playlist-song:hover {
    background: #f0f0f0;
}

.song-artwork,
.song-artwork-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
}

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

.song-artwork-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e8e8;
}

.song-artwork-placeholder svg {
    width: 24px;
    height: 24px;
    color: #999;
}

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

.song-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist {
    font-size: 0.8125rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-play-btn,
.song-remove-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.song-play-btn {
    background: #8b4513;
    color: #fff;
}

.song-play-btn:hover {
    background: #6b3410;
}

.song-play-btn svg {
    width: 18px;
    height: 18px;
}

.song-play-btn .pause-icon {
    display: none;
}

.song-play-btn.playing .play-icon {
    display: none;
}

.song-play-btn.playing .pause-icon {
    display: block;
}

.song-remove-btn {
    color: #999;
}

.song-remove-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.song-remove-btn svg {
    width: 16px;
    height: 16px;
}

/* Add Button */
.playlist-add-btn,
.playlist-create-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #8b4513;
    background: transparent;
    border: 2px dashed #d4a84b;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.playlist-add-btn:hover,
.playlist-create-btn:hover {
    background: #fef9e7;
    border-style: solid;
}

.playlist-add-btn svg,
.playlist-create-btn svg {
    width: 20px;
    height: 20px;
}

/* Create Prompt */
.playlist-create-prompt {
    text-align: center;
    padding: 1rem 0;
}

.playlist-create-prompt p {
    color: #666;
    margin-bottom: 1rem;
}

/* Connections */
.playlist-connections {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.connections-title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 0.875rem;
}

.connection-buttons {
    display: flex;
    gap: 0.75rem;
}

.connection-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.connection-btn:hover {
    background: #e8e8e8;
}

.connection-btn.spotify {
    color: #1db954;
}

.connection-btn.spotify:hover {
    background: #d1f4d9;
}

.connection-btn.apple {
    color: #fa243c;
}

.connection-btn.apple:hover {
    background: #ffd1d6;
}

.connection-btn svg {
    width: 20px;
    height: 20px;
}

/* Community Section */
.playlist-community-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
}

.community-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.community-playlists {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.community-playlist {
    padding: 0.875rem;
    background: #f8f8f8;
    border-radius: 8px;
}

.community-playlist-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.community-playlist-name {
    font-weight: 500;
    color: #1a1a1a;
}

.community-playlist-user {
    font-size: 0.8125rem;
    color: #888;
}

.community-playlist-songs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.community-song {
    font-size: 0.75rem;
    color: #666;
    background: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.community-more {
    font-size: 0.75rem;
    color: #8b4513;
}

/* Modal */
.playlist-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid #e8e8e8;
}

.modal-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: #e8e8e8;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem;
    border-top: 1px solid #e8e8e8;
}

.modal-footer .btn {
    flex: 1;
}

/* Search Tabs */
.search-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-tab {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #666;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-tab:hover {
    border-color: #8b4513;
    color: #8b4513;
}

.search-tab.active {
    background: #8b4513;
    color: #fff;
    border-color: #8b4513;
}

/* Search Input */
.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.song-search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
}

.song-search-input:focus {
    border-color: #8b4513;
}

.search-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #8b4513;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.search-btn svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

/* Search Results */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem;
    background: #f8f8f8;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: #f0f0f0;
}

.search-result-item.selected {
    background: #fef9e7;
    border: 1px solid #d4a84b;
}

.search-result-artwork {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.search-result-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.search-result-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-artist {
    font-size: 0.75rem;
    color: #666;
}

/* Manual Entry */
.manual-entry {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.manual-entry input {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
}

.manual-entry input:focus {
    border-color: #8b4513;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: #8b4513;
    color: #fff;
}

.btn-primary:hover {
    background: #6b3410;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

/* Audio Player */
.playlist-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-song {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
}

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

.player-btn svg {
    width: 24px;
    height: 24px;
}

.player-btn.player-play {
    background: #fff;
    color: #1a1a1a;
}

.player-btn.player-play:hover {
    background: #e8e8e8;
}

.player-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    max-width: 300px;
}

.player-time {
    font-size: 0.75rem;
    color: #888;
    min-width: 36px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

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

/* Responsive */
@media (max-width: 768px) {
    .whisky-playlist-widget {
        padding: 1rem;
    }
    
    .connection-buttons {
        flex-direction: column;
    }
    
    .connection-btn {
        width: 100%;
        justify-content: center;
    }
    
    .playlist-player {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .player-progress {
        width: 100%;
        max-width: none;
    }
}
