/* ==========================================================================
   Trapsoul Continuous Player - CSS Styles (Spotify-inspired)
   ========================================================================== */

:root {
    --ts-bg: #121212;
    --ts-bg-elevated: #1a1a1a;
    --ts-accent: #E20194;
    --ts-accent-hover: #ff01ab;
    --ts-cyan: #2FDBFF;
    --ts-text: #FCFCFC;
    --ts-text-muted: #a7a7a7;
    --ts-player-height: 90px;
}

/* =============================================
   FOOTER PLAYER Ã¢â‚¬â€œ Spotify Style
   ============================================= */

#trapsoul-global-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--ts-player-height);
    background: linear-gradient(180deg, #1c1c1c 0%, #111111 100%);
    z-index: 999999;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.7);
    font-family: 'Sofia Pro', 'Montserrat', 'Inter', sans-serif;
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

#trapsoul-global-player.is-active {
    transform: translateY(0);
}

/* Grid de 3 columnas simétricas â€” igual que Spotify */
.ts-player-inner {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: 30% 40% 30%;
    align-items: center;
    padding: 0 32px;
    height: 100%;
}

/* --- IZQUIERDA: CarÃƒÂ¡tula + Info --- */
.ts-track-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    position: relative;
}

.ts-track-info .ts-beat-cover-wrapper {
    position: relative;
    flex-shrink: 0;
}

.ts-track-info img.ts-beat-cover {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    display: block;
}

/* Ecualizador animado sobre la carÃƒÂ¡tula del footer */
.ts-track-info .ts-equalizer {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.3s;
}

#trapsoul-global-player.is-playing .ts-equalizer {
    opacity: 1;
}

.ts-equalizer span {
    display: block;
    width: 3px;
    background: var(--ts-accent);
    border-radius: 2px;
    animation: none;
}

#trapsoul-global-player.is-playing .ts-equalizer span:nth-child(1) {
    animation: eq-bar 0.8s ease-in-out infinite alternate;
    animation-delay: 0s;
    height: 8px;
}
#trapsoul-global-player.is-playing .ts-equalizer span:nth-child(2) {
    animation: eq-bar 0.6s ease-in-out infinite alternate;
    animation-delay: 0.15s;
    height: 14px;
}
#trapsoul-global-player.is-playing .ts-equalizer span:nth-child(3) {
    animation: eq-bar 0.9s ease-in-out infinite alternate;
    animation-delay: 0.05s;
    height: 10px;
}
#trapsoul-global-player.is-playing .ts-equalizer span:nth-child(4) {
    animation: eq-bar 0.7s ease-in-out infinite alternate;
    animation-delay: 0.2s;
    height: 6px;
}

@keyframes eq-bar {
    0%   { transform: scaleY(0.3); }
    100% { transform: scaleY(1); }
}

.ts-track-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.ts-track-details .ts-beat-title {
    color: var(--ts-text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}

.ts-track-details .ts-beat-artist {
    color: var(--ts-text-muted);
    font-size: 11px;
    font-weight: 400;
}

/* --- CENTRO: Controles + Barra de progreso --- */
.ts-controls-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 0 24px;
    box-sizing: border-box;
}

.ts-main-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
}

/* Todos los botones del footer: blanco por defecto, fucsia al hover */
#trapsoul-global-player .ts-control-btn,
#trapsoul-global-player .ts-control-btn i {
    background: transparent;
    border: none;
    color: #fcfcfc !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.15s, transform 0.15s;
    font-size: 17px;
}

#trapsoul-global-player .ts-control-btn:hover,
#trapsoul-global-player .ts-control-btn:hover i {
    color: var(--ts-accent) !important;
    transform: scale(1.12);
}

/* BotÃƒÂ³n Play/Pause Ã¢â‚¬â€ cÃƒÂ­rculo blanco */
#trapsoul-global-player .ts-play-pause-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #fcfcfc !important;
    color: #000000 !important;
    font-size: 14px;
    transition: transform 0.15s, background-color 0.15s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#trapsoul-global-player .ts-play-pause-btn i {
    color: #000000 !important;
}

#trapsoul-global-player .ts-play-pause-btn:hover {
    transform: scale(1.07) !important;
    background-color: #ebebeb !important;
}

#trapsoul-global-player .ts-play-pause-btn:hover i {
    color: #000000 !important;
}

#trapsoul-global-player .ts-skip-btn {
    font-size: 16px;
}

/* Barra de progreso Ã¢â‚¬â€ ocupa todo el ancho del centro */
.ts-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.ts-time-display {
    color: #fcfcfc !important;
    font-size: 11px;
    min-width: 38px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 400;
    opacity: 0.75;
}

.ts-progress-container {
    flex: 1;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.15s;
}

.ts-progress-container:hover {
    height: 6px;
}

.ts-progress-bar {
    height: 100%;
    background: #fcfcfc;
    border-radius: 2px;
    width: 0%;
    pointer-events: none;
    position: relative;
    transition: background 0.3s;
}

.ts-progress-container:hover .ts-progress-bar {
    background: var(--ts-accent);
}

.ts-progress-bar::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: #fcfcfc;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.15s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.ts-progress-container:hover .ts-progress-bar::after {
    opacity: 1;
}

/* --- DERECHA: Comprar licencia + Volumen --- */
.ts-volume-wrapper {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
}

.ts-buy-btn {
    background-color: var(--ts-accent) !important;
    color: #fcfcfc !important;
    padding: 12px 24px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 4px 15px rgba(226, 1, 148, 0.4);
    letter-spacing: 0.02em;
}

.ts-buy-btn:hover {
    transform: scale(1.02) translateY(-1px);
    box-shadow: 0 6px 22px rgba(226, 1, 148, 0.65);
    filter: brightness(1.1);
    color: #fcfcfc !important;
}

.ts-volume-slider-container {
    width: 90px;
    display: flex;
    align-items: center;
}

.ts-volume-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    border-radius: 2px;
    cursor: pointer;
    transition: height 0.15s;
}

.ts-volume-slider:hover {
    height: 6px;
}

.ts-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ts-text);
    cursor: pointer;  cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* =============================================
   CARÃƒÆ’ TULAS LOCALES ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â Tarjeta estilo Spotify
   ============================================= */

/* Ocultar todos los controles locales ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â el footer lo maneja */
.audio-player-container .controls-bar,
.audio-player-container audio {
    display: none !important;
}

/* La tarjeta local: imagen cuadrada + info debajo */
.audio-player-container {
    cursor: pointer !important;
    user-select: none !important;
    background: #181818 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    padding: 12px 12px 0 !important;
    /* Eliminar cualquier borde o glow del CSS anterior */
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    transition: background 0.2s !important;
}

.audio-player-container:hover {
    background: #282828 !important;
}

/* player-card: solo contiene la imagen cuadrada */
.audio-player-container .player-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #111;
    border-radius: 4px;  /* Redondeo sutil en las esquinas de la imagen */
}

.audio-player-container .player-card img.beat-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.25s ease;
}

/* Overlay oscuro: solo en hover */
.audio-player-container .player-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 1;
    pointer-events: none;
}

.audio-player-container .player-card:hover::before {
    opacity: 1;
}

/* Cuando estÃƒÆ’Ã‚Â¡ sonando: overlay sutil permanente */
.audio-player-container.ts-is-playing .player-card::before {
    opacity: 0.35;
}

/* BotÃƒÆ’Ã‚Â³n play: oculto por defecto, aparece centrado al hacer hover */
.ts-cover-play-btn {
    position: absolute;
    /* Centrado en la imagen */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    /* Fucsia con bastante transparencia */
    background-color: rgba(226, 1, 148, 0.55) !important;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s;
    box-shadow: 0 4px 20px rgba(226, 1, 148, 0.3);
    pointer-events: none;
}

.ts-cover-play-btn i {
    color: #fcfcfc !important;
    font-size: 18px;
    pointer-events: none;
}

.ts-cover-play-btn .ts-local-play-icon {
    margin-left: 3px; /* Solo el triángulo necesita este margen visual para verse centrado */
}

/* Mostrar centrado al hover en la imagen */
.audio-player-container .player-card:hover .ts-cover-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.ts-cover-play-btn:hover {
    background-color: rgba(226, 1, 148, 0.8) !important;
    transform: translate(-50%, -50%) scale(1.08) !important;
}

/* Ecualizador: oculto por defecto, visible al reproducir */
.ts-local-equalizer {
    position: absolute;
    bottom: 14px;
    right: 12px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

/* Al reproducir: mostrar ecualizador */
.audio-player-container.ts-is-playing .ts-local-equalizer {
    opacity: 1;
}

/* Intercambiar el icono de Play a Pause cuando la tarjeta está sonando */
.audio-player-container.ts-is-playing .ts-local-play-icon {
    display: none !important;
}
.audio-player-container.ts-is-playing .ts-local-pause-icon {
    display: inline-block !important;
}

.ts-local-equalizer span {
    display: block;
    width: 3px;
    border-radius: 2px;
    background: var(--ts-accent);
    transform-origin: bottom center;
}

.audio-player-container.ts-is-playing .ts-local-equalizer span:nth-child(1) {
    height: 10px;
    animation: eq-bar 0.8s ease-in-out infinite alternate;
}
.audio-player-container.ts-is-playing .ts-local-equalizer span:nth-child(2) {
    height: 16px;
    animation: eq-bar 0.55s ease-in-out infinite alternate;
    animation-delay: 0.1s;
}
.audio-player-container.ts-is-playing .ts-local-equalizer span:nth-child(3) {
    height: 12px;
    animation: eq-bar 0.75s ease-in-out infinite alternate;
    animation-delay: 0.05s;
}
.audio-player-container.ts-is-playing .ts-local-equalizer span:nth-child(4) {
    height: 7px;
    animation: eq-bar 0.65s ease-in-out infinite alternate;
    animation-delay: 0.18s;
}

/* Info debajo de la carÃƒÆ’Ã‚Â¡tula ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â ÃƒÆ’Ã‚Â¡rea negra estilo Spotify */
.ts-card-info {
    padding: 12px 14px 16px;
    background: transparent;  /* Hereda el fondo oscuro del container */
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ts-card-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.3;
}

.ts-card-artist {
    color: #a7a7a7;
    font-size: 12px;
    display: block;
    line-height: 1.3;
}


/* Espacio en el body para que el footer no tape contenido */
body {
    padding-bottom: calc(var(--ts-player-height) + 16px);
}

/* =============================================
   INVERSIÓN DE COLORES EN PÁGINA DE INICIO
   ============================================= */
html.ts-is-home .audio-player-container {
    background: #fcfcfc !important;
}

html.ts-is-home .audio-player-container:hover {
    background: #ebebeb !important;
}

html.ts-is-home .ts-card-info .ts-card-title {
    color: #141414 !important;
}

html.ts-is-home .ts-card-info .ts-card-artist {
    color: #444444 !important;
}

/* --- Transiciones SWUP --- */
.transition-fade {
    transition: opacity 0.35s ease, transform 0.35s ease;
    opacity: 1;
    transform: translateY(0);
}
html.is-animating .transition-fade {
    opacity: 0;
    transform: translateY(8px);
}




