/* 🎵 Moonlight Music Player - SoundCloud-inspired styles with Theme Support */

/* ===== CSS CUSTOM PROPERTIES FOR THEME SUPPORT ===== */
:root {
    /* Light Theme Variables */
    --mp-bg-primary: #ffffff;
    --mp-bg-secondary: #f8fafc;
    --mp-bg-gradient-start: #1a1a1a;
    --mp-bg-gradient-end: #2d2d2d;
    --mp-text-primary: #1f2937;
    --mp-text-secondary: #6b7280;
    --mp-text-muted: #9ca3af;
    --mp-border-color: #e5e7eb;
    --mp-button-bg: rgba(0, 0, 0, 0.05);
    --mp-button-hover: rgba(0, 0, 0, 0.1);
    --mp-accent-color: #f97316;
    --mp-shadow-color: rgba(0, 0, 0, 0.1);
    --mp-waveform-bg: rgba(0, 0, 0, 0.05);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --mp-bg-primary: #1a1a1a;
    --mp-bg-secondary: #2d2d2d;
    --mp-bg-gradient-start: #1a1a1a;
    --mp-bg-gradient-end: #2d2d2d;
    --mp-text-primary: #ffffff;
    --mp-text-secondary: #cccccc;
    --mp-text-muted: #999999;
    --mp-border-color: #333333;
    --mp-button-bg: rgba(255, 255, 255, 0.1);
    --mp-button-hover: rgba(255, 255, 255, 0.2);
    --mp-accent-color: #FF5500;
    --mp-shadow-color: rgba(0, 0, 0, 0.3);
    --mp-waveform-bg: rgba(255, 255, 255, 0.05);
}

.moonlight-music-player {
    position: relative;
    font-family: 'Figtree', sans-serif;
    color: var(--mp-text-primary);
    transition: color 0.3s ease;
}

/* ===== MINI PLAYER BAR (SoundCloud-style bottom bar) ===== */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(135deg, var(--mp-bg-gradient-start) 0%, var(--mp-bg-gradient-end) 100%);
    border-top: 1px solid var(--mp-border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px var(--mp-shadow-color);
    transition: all 0.3s ease;
}

/* ===== PLAYER CONTROLS ===== */
.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-btn {
    background: none;
    border: none;
    color: var(--mp-text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: var(--mp-button-hover);
    transform: scale(1.1);
}

.control-btn.play-pause {
    background: var(--mp-accent-color);
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 12px rgba(255, 85, 0, 0.3);
}

.control-btn.play-pause:hover {
    background: #ff6a1a;
    transform: scale(1.05);
}

/* ===== TRACK INFO ===== */
.track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.track-cover {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.track-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--mp-text-primary);
    line-height: 1.2;
}

.track-artist {
    font-size: 12px;
    color: var(--mp-text-secondary);
    line-height: 1.2;
}

/* ===== WAVEFORM CONTAINER ===== */
.waveform-container {
    flex: 1;
    position: relative;
    height: 60px;
    margin: 0 20px;
    cursor: pointer;
}

.waveform-canvas {
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

.comments-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.comment-marker {
    position: absolute;
    top: 10px;
    width: 8px;
    height: 8px;
    background: #FFD700;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    transform: translateX(-50%);
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.4);
}

.comment-marker:hover {
    transform: translateX(-50%) scale(1.3);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.6);
}

.progress-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #FF5500;
    border-radius: 1px;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(255, 85, 0, 0.6);
}

/* ===== PLAYER INFO ===== */
.player-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.time-display {
    font-size: 12px;
    color: #cccccc;
    font-variant-numeric: tabular-nums;
    min-width: 80px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-btn {
    background: none;
    border: none;
    color: #cccccc;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.volume-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #FF5500;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(255, 85, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #FF5500;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(255, 85, 0, 0.3);
}

.player-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    background: none;
    border: none;
    color: #cccccc;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.action-btn.active {
    color: #FF5500;
    background: rgba(255, 85, 0, 0.1);
}

.action-btn.liked {
    color: #ff4757;
}

/* ===== FULL PLAYER VIEW ===== */
.full-player {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
}

.full-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.close-btn {
    background: none;
    border: none;
    color: #cccccc;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.full-player-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.track-artwork img {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.track-details-full h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.track-details-full h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #cccccc;
}

.track-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.track-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #cccccc;
    font-size: 14px;
}

.full-waveform-container {
    position: relative;
    height: 120px;
    margin: 30px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.full-waveform-canvas {
    width: 100%;
    height: 100%;
}

/* ===== COMMENTS SECTION ===== */
.comments-section {
    grid-column: 1 / -1;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #333;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.comments-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.toggle-comments {
    background: none;
    border: 1px solid #333;
    color: #cccccc;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-comments:hover {
    border-color: #FF5500;
    color: #FF5500;
}

.comments-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.comment-item {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
}

.comment-time {
    color: #FF5500;
    font-size: 12px;
    font-weight: 500;
}

.comment-date {
    color: #888;
    font-size: 12px;
}

.comment-text {
    color: #cccccc;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    gap: 12px;
}

.comment-like {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.comment-like:hover {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

/* ===== ADD COMMENT ===== */
.add-comment {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.add-comment textarea {
    flex: 1;
    background: #333;
    border: 1px solid #444;
    color: #ffffff;
    padding: 12px;
    border-radius: 6px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.add-comment textarea:focus {
    outline: none;
    border-color: #FF5500;
}

.add-comment button {
    background: #FF5500;
    border: none;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.add-comment button:hover {
    background: #ff6a1a;
    transform: translateY(-1px);
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .player-bar {
        padding: 0 12px;
        height: 90px;
        gap: 12px;
    }
    
    .track-info {
        min-width: 150px;
    }
    
    .track-title {
        font-size: 12px;
    }
    
    .track-artist {
        font-size: 11px;
    }
    
    .waveform-container {
        margin: 0 12px;
    }
    
    .player-info {
        gap: 12px;
    }
    
    .volume-control {
        display: none; /* Hide on mobile */
    }
    
    .full-player-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .track-details-full h1 {
        font-size: 24px;
    }
    
    .track-details-full h2 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .player-controls {
        gap: 8px;
    }
    
    .control-btn.play-pause {
        width: 40px;
        height: 40px;
    }
    
    .track-cover {
        width: 40px;
        height: 40px;
    }
    
    .player-actions {
        gap: 4px;
    }
    
    .time-display {
        font-size: 11px;
        min-width: 60px;
    }
}