/* Spotify Integration Styles */

/* Spotify Pills */
.spotify-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #1DB954, #1ED760);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(29, 185, 84, 0.3);
    margin: 2px 4px 2px 0;
    transition: all 0.2s ease;
}

.spotify-pill.clickable {
    cursor: pointer;
}

.spotify-pill.clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.4);
}

.spotify-pill i {
    font-size: 12px;
}

.spotify-pill .track-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Spotify Player Widget */
.spotify-player-widget {
    margin: 12px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.spotify-player-container {
    background: #121212;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.spotify-player-header {
    background: linear-gradient(135deg, #1DB954, #1ED760);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.spotify-track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    flex: 1;
    min-width: 0;
}

.spotify-track-info i {
    font-size: 20px;
}

.track-details {
    min-width: 0;
    flex: 1;
}

.track-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 12px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.spotify-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-player-frame {
    background: #121212;
}

.spotify-player-frame iframe {
    width: 100%;
    height: 152px;
    border: none;
    display: block;
}

/* Spotify Track Picker Modal */
.spotify-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spotify-picker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.spotify-picker-container {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.spotify-picker-header {
    background: linear-gradient(135deg, #1DB954, #1ED760);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.spotify-picker-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.spotify-picker-header i {
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spotify-picker-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.search-section {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: #1DB954;
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
}

.search-btn {
    background: #1DB954;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background: #1ED760;
    transform: translateY(-1px);
}

.section-header {
    margin-bottom: 16px;
}

.section-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.tracks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.track-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.track-item:hover {
    border-color: #1DB954;
    background: #f8f9fa;
    transform: translateX(4px);
}

.track-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.track-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-info {
    flex: 1;
    min-width: 0;
}

.track-info .track-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.track-info .track-artist {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.track-info .track-album {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-duration {
    font-size: 12px;
    color: #666;
    margin-right: 8px;
}

.select-track-btn {
    background: #1DB954;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.select-track-btn:hover {
    background: #1ED760;
    transform: scale(1.1);
}

.loading, .no-tracks, .error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.error {
    color: #d32f2f;
}

/* Post Creation Enhancements */
.post-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 8px;
}

.toolbar-btn {
    background: none;
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.toolbar-btn:hover {
    border-color: #1DB954;
    color: #1DB954;
    background: rgba(29, 185, 84, 0.05);
}

.spotify-btn {
    color: #1DB954;
}

.spotify-btn:hover {
    background: rgba(29, 185, 84, 0.1);
}

/* Attached Track Preview */
.attached-spotify-track {
    margin: 12px 0;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
}

.track-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.track-preview .track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.track-preview .track-info i {
    color: #1DB954;
    font-size: 16px;
}

.track-preview .track-details .track-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
}

.track-preview .track-details .track-artist {
    font-size: 12px;
    color: #666;
}

.remove-track-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.remove-track-btn:hover {
    color: #d32f2f;
    background: rgba(211, 47, 47, 0.1);
}

/* Dark theme support */
[data-theme="dark"] .spotify-picker-container {
    background: #1a1a1a;
    color: white;
}

[data-theme="dark"] .search-input {
    background: #2a2a2a;
    border-color: #444;
    color: white;
}

[data-theme="dark"] .search-input:focus {
    border-color: #1DB954;
}

[data-theme="dark"] .track-item {
    border-color: #444;
    background: #2a2a2a;
}

[data-theme="dark"] .track-item:hover {
    background: #333;
}

[data-theme="dark"] .track-info .track-name {
    color: white;
}

[data-theme="dark"] .track-info .track-artist {
    color: #ccc;
}

[data-theme="dark"] .track-info .track-album {
    color: #999;
}

[data-theme="dark"] .attached-spotify-track {
    background: #2a2a2a;
    border-color: #444;
}

[data-theme="dark"] .track-preview .track-details .track-name {
    color: white;
}

[data-theme="dark"] .track-preview .track-details .track-artist {
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .spotify-picker-container {
        width: 95%;
        max-height: 90vh;
    }
    
    .spotify-picker-content {
        padding: 16px;
        max-height: 70vh;
    }
    
    .track-item {
        padding: 8px;
    }
    
    .track-image {
        width: 40px;
        height: 40px;
    }
    
    .search-section {
        flex-direction: column;
    }
    
    .search-btn {
        align-self: stretch;
    }
    
    .spotify-pill .track-text {
        max-width: 150px;
    }
}

/* Profile Music Tab Styles */
.music-section {
    padding: 0;
}

.music-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #1db954 0%, #1ed760 100%);
    border-radius: 12px;
    color: white;
}

.music-header-content {
    flex: 1;
}

.music-title {
    font-size: 24px;
    font-weight: 600;
    color: white;
    margin: 0 0 0.5rem 0;
}

.music-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin: 0;
}

.spotify-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.spotify-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.music-card.enhanced {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    padding: 0;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.no-song-message, .no-music-posts {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
}

.no-song-icon, .no-posts-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.no-song-message h4, .no-music-posts h4 {
    font-size: 18px;
    font-weight: 600;
    color: #334155;
    margin: 0 0 0.5rem 0;
}

.no-song-message p, .no-music-posts p {
    margin: 0 0 1.5rem 0;
}

.add-song-btn {
    background: #1db954;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.add-song-btn:hover {
    background: #1ed760;
    transform: translateY(-2px);
}

.profile-song-display {
    padding: 1.5rem;
}

.song-info {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.song-artwork {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.song-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.song-artwork:hover .song-overlay {
    opacity: 1;
}

.play-btn {
    background: #1db954;
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.song-details {
    flex: 1;
}

.song-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.song-artist {
    font-size: 16px;
    color: #64748b;
    margin: 0 0 1.5rem 0;
}

.song-actions {
    display: flex;
    gap: 1rem;
}

.change-song-btn, .remove-song-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.change-song-btn {
    color: #1db954;
    border-color: #1db954;
}

.change-song-btn:hover {
    background: #1db954;
    color: white;
}

.remove-song-btn {
    color: #ef4444;
    border-color: #ef4444;
}

.remove-song-btn:hover {
    background: #ef4444;
    color: white;
}

.embedded-player {
    border-radius: 8px;
    overflow: hidden;
}

.loading-tracks {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
}

.loading-tracks i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #1db954;
}

@media (max-width: 768px) {
    .music-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .song-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .song-actions {
        justify-content: center;
    }
}

/* Music Posts Styles */
.music-post-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    background: white;
    transition: all 0.2s ease;
}

.music-post-item:hover {
    border-color: #1db954;
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.1);
}

.music-post-track {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.music-post-track .track-artwork {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
}

.music-post-track .track-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.music-post-track .track-info {
    flex: 1;
    min-width: 0;
}

.music-post-track .track-name {
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 2px 0;
    font-size: 14px;
}

.music-post-track .track-artist {
    color: #64748b;
    margin: 0;
    font-size: 12px;
}

.play-track-btn {
    background: #1db954;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.play-track-btn:hover {
    background: #1ed760;
    transform: scale(1.1);
}

.music-post-content {
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.music-post-content p {
    margin: 0 0 8px 0;
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.post-mood {
    font-weight: 600;
}

.post-date {
    color: #9ca3af;
}

/* Message Spotify Pills */
.message-spotify-pills {
    margin: 8px 0 4px 0;
}

.message-spotify-pills .spotify-pill {
    margin: 0;
}

/* Spotify Header Pills */
.spotify-header-pill {
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.spotify-header-pill:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-1px);
}

.spotify-header-pill:active {
    transform: translateY(0);
}

.spotify-header-pill i {
    color: #1db954;
}

/* Responsive adjustments for header pills */
@media (max-width: 768px) {
    .spotify-header-pill {
        max-width: 120px;
    }
    
    .spotify-header-pill span {
        font-size: 10px;
    }
}