/* MusicPlayer.css - Styles for the background music player (Compact Sidebar Layout) */

/* ==================== Player Container ==================== */
.music-player {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
}

.music-player.hidden {
    display: none;
}

/* ==================== Style Selector (Row 1) ==================== */
.music-style-selector {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
}

.music-style-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.music-style-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.music-style-btn i.fa-music {
    color: #a0c4ff;
    flex-shrink: 0;
}

.music-style-btn i.fa-chevron-down {
    margin-left: auto;
    font-size: 0.65rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.music-style-name {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Style Dropdown */
.music-style-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #2a2a4a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    margin-bottom: 6px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.music-style-dropdown.open {
    display: block;
}

.music-style-option {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: white;
}

.music-style-option:last-child {
    border-bottom: none;
}

.music-style-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.music-style-option.active {
    background: rgba(102, 126, 234, 0.25);
}

.music-style-option.locked {
    opacity: 0.7;
}

.music-style-option.locked:hover {
    background: rgba(255, 193, 7, 0.15);
}

.music-style-option span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Style Status Badges */
.style-status {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 8px;
    flex-shrink: 0;
}

.style-status.free {
    background: #4caf50;
    color: white;
}

.style-status.unlocked {
    background: #667eea;
    color: white;
}

.style-status.locked {
    background: #ffc107;
    color: #1a1a2e;
    font-weight: bold;
}

/* ==================== Controls Row (Row 2) ==================== */
.music-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.music-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.music-btn {
    background: transparent;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.85rem;
    opacity: 0.8;
}

.music-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

.music-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.music-btn.hidden {
    display: none;
}

.music-btn.play-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    opacity: 1;
}

.music-btn.play-btn:hover {
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
}

/* ==================== Volume Control ==================== */
.music-volume {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.music-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    min-width: 40px;
}

.music-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.music-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.music-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.music-volume-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.music-volume-btn:hover {
    opacity: 1;
}

/* ==================== Unlock Modal ==================== */
.music-unlock-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.music-unlock-modal.open {
    display: flex;
}

.music-unlock-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    animation: musicPopIn 0.3s ease-out;
}

.music-unlock-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
}

.music-unlock-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.music-unlock-cost {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.2rem;
    margin: 15px 0;
    color: #f9a825;
}

.music-unlock-balance {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 20px;
}

.music-unlock-balance span {
    font-weight: bold;
}

.music-unlock-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.music-unlock-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.music-unlock-btn.cancel {
    background: #e9ecef;
    color: #495057;
}

.music-unlock-btn.cancel:hover {
    background: #dee2e6;
}

.music-unlock-btn.confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.music-unlock-btn.confirm:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.music-unlock-btn.confirm:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.music-unlock-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 10px;
}

/* ==================== Animation ==================== */
@keyframes musicPopIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ==================== Mobile Responsive ==================== */
@media (max-width: 400px) {
    .music-player {
        padding: 10px;
    }

    .music-style-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    .music-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .music-btn.play-btn {
        width: 32px;
        height: 32px;
    }

    .music-volume-slider {
        min-width: 30px;
    }
}
