/* ============================================
   MUSIC MENU - Menú de Biblioteca Musical
   ============================================ */

.music-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.music-menu.active {
    display: flex;
}

.music-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

.music-menu-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #9333ea;
    border-radius: 20px;
    padding: 25px;
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(147, 51, 234, 0.3);
    animation: slideInScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Header */
.music-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(147, 51, 234, 0.3);
}

.music-menu-title {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 10px rgba(147, 51, 234, 0.5);
}

/* Current Music Display */
.current-music-display {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(79, 70, 229, 0.2));
    border: 2px solid rgba(147, 51, 234, 0.4);
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 25px;
    animation: currentMusicPulse 2s ease-in-out infinite;
}

@keyframes currentMusicPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(147, 51, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(147, 51, 234, 0.5);
    }
}

.current-music-icon {
    font-size: 32px;
    animation: musicBounce 1s ease-in-out infinite;
}

@keyframes musicBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.current-music-info {
    flex: 1;
}

.current-music-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.current-music-name {
    font-size: 20px;
    font-weight: bold;
    color: #9333ea;
}

/* Music List */
.music-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* Music Card */
.music-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(147, 51, 234, 0.3);
    border-radius: 15px;
    padding: 15px;
    transition: all 0.3s ease;
}

.music-card:hover {
    border-color: rgba(147, 51, 234, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(147, 51, 234, 0.2);
}

.music-card.current {
    border-color: #9333ea;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(79, 70, 229, 0.15));
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
}

.music-card.locked {
    opacity: 0.7;
}

/* Purchase Modal */
.music-purchase-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(10, 6, 22, 0.85), rgba(0, 0, 0, 0.85));
    backdrop-filter: blur(12px);
    z-index: 13000;
    padding: 24px;
}

.music-purchase-modal.active {
    display: flex;
}

.music-purchase-dialog {
    width: min(420px, 95vw);
    background: linear-gradient(145deg, #140022 0%, #23003c 100%);
    border: 2px solid rgba(147, 51, 234, 0.45);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 25px 60px rgba(147, 51, 234, 0.35);
    animation: slideInScale 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #f5eaff;
}

.music-purchase-title {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 14px rgba(147, 51, 234, 0.6);
}

.music-purchase-item {
    margin: 0 0 18px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.music-purchase-summary {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

/* Music Card Header */
.music-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    position: relative;
}

.music-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.music-info {
    flex: 1;
}

.music-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.music-description {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

.music-current-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #9333ea, #4f46e5);
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(147, 51, 234, 0.5);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Music Card Actions */
.music-card-actions {
    display: flex;
    gap: 8px;
}

.music-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.music-btn .btn-icon {
    font-size: 16px;
}

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

/* Preview Button */
.music-btn-preview {
    background: rgba(147, 51, 234, 0.2);
    color: #9333ea;
    border: 2px solid rgba(147, 51, 234, 0.4);
}

.music-btn-preview:hover:not(:disabled) {
    background: rgba(147, 51, 234, 0.3);
    border-color: rgba(147, 51, 234, 0.6);
    transform: translateY(-1px);
}

.music-btn-preview.playing {
    background: linear-gradient(135deg, #9333ea, #4f46e5);
    color: white;
    border-color: #9333ea;
    animation: playingPulse 1s ease-in-out infinite;
}

@keyframes playingPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(147, 51, 234, 0.5); }
    50% { box-shadow: 0 0 25px rgba(147, 51, 234, 0.7); }
}

/* Buy Button */
.music-btn-buy {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #000;
    border: none;
    font-weight: bold;
}

.music-btn-buy:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffed4e, #ffb732);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.music-btn-buy:active:not(:disabled) {
    transform: translateY(0);
}

/* Select Button */
.music-btn-select {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
}

.music-btn-select:hover:not(:disabled) {
    background: linear-gradient(135deg, #34d399, #10b981);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* Current Button */
.music-btn-current {
    background: rgba(147, 51, 234, 0.3);
    color: #9333ea;
    border: 2px solid rgba(147, 51, 234, 0.5);
}

/* Scrollbar */
.music-menu-content::-webkit-scrollbar {
    width: 8px;
}

.music-menu-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.music-menu-content::-webkit-scrollbar-thumb {
    background: rgba(147, 51, 234, 0.5);
    border-radius: 10px;
}

.music-menu-content::-webkit-scrollbar-thumb:hover {
    background: rgba(147, 51, 234, 0.7);
}

/* Responsive */
@media (max-width: 768px) {
    .music-list {
        grid-template-columns: 1fr;
    }

    .music-menu-content {
        padding: 20px;
        max-height: 90vh;
    }

    .music-menu-title {
        font-size: 24px;
    }

    .current-music-display {
        padding: 12px 15px;
    }

    .current-music-icon {
        font-size: 28px;
    }

    .current-music-name {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .music-menu-content {
        padding: 15px;
        max-width: 98%;
    }

    .music-menu-title {
        font-size: 20px;
    }

    .current-music-display {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .music-card {
        padding: 12px;
    }

    .music-icon {
        font-size: 32px;
    }

    .music-name {
        font-size: 15px;
    }

    .music-description {
        font-size: 12px;
    }

    .music-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .music-card-actions {
        flex-direction: column;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .music-menu-content {
        max-height: 95vh;
        padding: 15px;
    }

    .music-menu-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .music-menu-title {
        font-size: 20px;
    }

    .current-music-display {
        padding: 10px 15px;
        margin-bottom: 15px;
    }

    .music-list {
        gap: 12px;
    }

    .music-card {
        padding: 10px;
    }
}

