/* css/spotify.css */
/* Estilos para la integración de Spotify, Mini-Reproductor y CananJam */

/* --- Ticker "Now Playing" en la Bento Card --- */
.spotify-ticker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
    padding: 6px 12px;
    background: rgba(29, 185, 84, 0.1);
    border: 1px solid rgba(29, 185, 84, 0.3);
    border-radius: 8px;
    width: fit-content;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.spotify-ticker:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.spotify-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.spotify-bars span {
    display: block;
    width: 3px;
    background-color: #1DB954;
    border-radius: 2px;
    animation: bounceAudio 1.2s infinite ease-in-out alternate;
}

.spotify-bars span:nth-child(1) { animation-delay: 0.1s; height: 100%; }
.spotify-bars span:nth-child(2) { animation-delay: 0.3s; height: 60%; }
.spotify-bars span:nth-child(3) { animation-delay: 0.5s; height: 80%; }

@keyframes bounceAudio {
    0% { height: 20%; }
    100% { height: 100%; }
}

.spotify-text-wrapper {
    display: flex;
    flex-direction: column;
    width: 140px; 
    overflow: hidden;
    position: relative;
}

#spotifyTrackName {
    display: inline-block;
    white-space: nowrap;
    /* La transición ahora la maneja JS con precisión exacta */
}

/* --- Botones y Sección Modal de Perfil --- */
.spotify-connect-section {
    margin-top: 20px;
    background: rgba(128, 128, 128, 0.05);
    padding: 15px;
    border-radius: 16px;
    border: 1px solid rgba(128, 128, 128, 0.1);
}

.spotify-connect-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.spotify-connect-header h4 {
    color: #1DB954;
    margin: 0;
    font-size: 1.1rem;
}

.btn-spotify-connect {
    background: #1DB954;
    color: white;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-spotify-connect:hover {
    background: #1ed760;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 185, 84, 0.4);
}

.btn-spotify-connect.is-linked {
    background: rgba(29, 185, 84, 0.2);
    color: #1DB954;
    border: 1px solid #1DB954;
    box-shadow: none;
}

.btn-spotify-connect.is-linked:hover {
    background: var(--error-color, #ef4444);
    color: white;
    border-color: var(--error-color, #ef4444);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-spotify-connect.is-linked:hover span { display: none; }
.btn-spotify-connect.is-linked:hover::after { content: "Desvincular"; }

.jam-trigger-btn {
    background: rgba(29, 185, 84, 0.15);
    color: #1DB954;
    border: 1px solid rgba(29, 185, 84, 0.3);
    transition: 0.2s;
}

.jam-trigger-btn:hover {
    background: #1DB954;
    color: white;
}

/* --- ESTILOS DEL MINI-REPRODUCTOR (INFO POPUP) --- */
.np-album-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 20px auto;
}

#npAlbumArt {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.np-spotify-icon {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: var(--bg-secondary);
    border-radius: 50%;
    padding: 5px;
    display: flex;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.np-info-scroll {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    cursor: default;
}

.np-info-text {
    display: inline-block;
    white-space: nowrap;
    color: var(--text-main); 
    /* Transición controlada por JS */
}

.np-progress-container {
    width: 100%;
    margin-top: 15px;
}

.np-time-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 5px;
}

.np-progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(128,128,128,0.2);
    border-radius: 4px;
    overflow: hidden;
}

.np-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: #1DB954;
    border-radius: 4px;
    transition: width 0.1s linear; 
    box-shadow: 0 0 10px rgba(29, 185, 84, 0.5);
}

/* --- AJUSTES ESPECÍFICOS: TEMA HELLO KITTY --- */
[data-theme="hellokitty"] .np-info-text#npTrackTitle {
    color: var(--accent-electric); /* Rosa fuerte para resaltar */
    font-weight: 900;
    text-shadow: 0 2px 5px rgba(244, 114, 182, 0.2);
}

[data-theme="hellokitty"] .np-info-text#npArtistName {
    color: var(--text-pure); /* Violeta profundo para contrastar */
    font-weight: 700;
    opacity: 0.9;
}

[data-theme="hellokitty"] .np-progress-bar-bg {
    background: rgba(244, 114, 182, 0.2); 
}

[data-theme="hellokitty"] .np-progress-bar-fill {
    background: var(--accent-electric);
    box-shadow: 0 0 10px var(--accent-glow);
}

[data-theme="hellokitty"] .np-time-text {
    color: var(--text-pure);
    font-weight: 800;
}

/* --- ANIMACIÓN INVITACIÓN AL JAM --- */
@keyframes pulseJam {
    0% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(29, 185, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); }
}

[data-theme="hellokitty"] #jamInviteText {
    color: var(--accent-electric) !important;
}

/* --- VENTANA FLOTANTE DEL JAM (DRAGGABLE) --- */
.floating-jam-window {
    position: fixed;
    top: 80px; 
    left: 50%;
    transform: translateX(-50%); /* Empieza centrado arriba */
    width: 320px;
    z-index: 10005;
    display: flex;
    flex-direction: column;
    padding: 0; /* Padding movido a los componentes internos */
    border: 1px solid rgba(29, 185, 84, 0.4);
    border-radius: 20px;
    overflow: hidden;
    transition: width 0.3s ease, height 0.3s ease, opacity 0.3s;
}

[data-theme="batman"] .floating-jam-window { box-shadow: 0 15px 40px rgba(29, 185, 84, 0.15); background: rgba(10,10,10,0.9); }
[data-theme="hellokitty"] .floating-jam-window { border: 2px solid #1DB954; box-shadow: 0 15px 40px rgba(29, 185, 84, 0.2); background: rgba(253, 242, 248, 0.95); }

/* Minimizado */
.floating-jam-window.minimized {
    width: 250px;
    height: auto !important;
}

.floating-jam-window.minimized .jam-body {
    display: none !important;
}

.jam-header-drag {
    padding: 12px 20px;
    background: rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.jam-header-drag:active { cursor: grabbing; }

[data-theme="hellokitty"] .jam-header-drag { background: rgba(255,255,255,0.5); border-bottom: 1px solid rgba(0,0,0,0.05); }

.jam-role-badge {
    background: #1DB954;
    color: white;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 10px;
    letter-spacing: 1px;
}
.jam-role-badge.guest { background: var(--accent-electric); }

.jam-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.jam-album-art {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 20px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
}

.jam-track-details {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.jam-title {
    margin: 0 0 5px 0;
    font-size: 1.3rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

.jam-artist {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.jam-controls {
    display: flex;
    align-items: center;
    gap: 25px;
}

.jam-btn {
    background: none;
    border: none;
    color: var(--text-pure);
    cursor: pointer;
    transition: 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.8;
}

.jam-btn:hover {
    transform: scale(1.15);
    color: #1DB954;
    opacity: 1;
}

.play-btn {
    width: 55px;
    height: 55px;
    background: #1DB954;
    color: white;
    border-radius: 50%;
    opacity: 1;
    box-shadow: 0 5px 15px rgba(29, 185, 84, 0.4);
}

.play-btn:hover {
    background: #1ed760;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(29, 185, 84, 0.6);
}