/* ═══════════════════════════════════════
   TB Audio Player — Frontend Styles
   ═══════════════════════════════════════ */

.tba-player {
    --tba-primary: #000000;
    --tba-bg:      #f5f5f5;
    --tba-color:   #000000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

.tba-player * {
    box-sizing: border-box;
}

/* ── Botón circular compartido ─────────────────────────────── */
.tba-circle-btn,
.tba-player-btn {
    border-radius: 50%;
    background: var(--tba-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    user-select: none;
}

.tba-circle-btn:hover,
.tba-player-btn:hover {
    opacity: 0.82;
    transform: scale(1.06);
}

.tba-circle-btn svg,
.tba-player-btn svg {
    fill: #ffffff;
    pointer-events: none;
}

/* ── Barra de progreso compartida ──────────────────────────── */
.tba-progress-wrap {
    position: relative;
    height: 4px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 5px;
}

.tba-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--tba-primary);
    border-radius: 4px;
    pointer-events: none;
    transition: width 0.08s linear;
}

.tba-time-row {
    display: flex;
    justify-content: space-between;
}

.tba-time-row span {
    color: var(--tba-color);
    opacity: 0.5;
    font-size: 11px;
}

/* ══════════════════════════════════════
   PRESET: circle
   ══════════════════════════════════════ */
.tba-preset-circle {
    background: var(--tba-bg);
    border-radius: 16px;
    padding: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Tamaños — circle */
.tba-preset-circle.tba-size-small  .tba-circle-btn { width: 52px;  height: 52px;  }
.tba-preset-circle.tba-size-medium .tba-circle-btn { width: 68px;  height: 68px;  }
.tba-preset-circle.tba-size-large  .tba-circle-btn { width: 90px;  height: 90px;  }

.tba-preset-circle .tba-circle-btn svg { width: 44%; height: 44%; }

/* ══════════════════════════════════════
   PRESET: player
   ══════════════════════════════════════ */
.tba-preset-player {
    background: var(--tba-bg);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Tamaños — player */
.tba-preset-player.tba-size-small  .tba-player-btn { width: 46px;  height: 46px;  }
.tba-preset-player.tba-size-medium .tba-player-btn { width: 58px;  height: 58px;  }
.tba-preset-player.tba-size-large  .tba-player-btn { width: 74px;  height: 74px;  }

.tba-preset-player .tba-player-btn svg { width: 44%; height: 44%; }

.tba-player-info {
    flex: 1;
    min-width: 0;
}

.tba-track-title {
    color: var(--tba-color);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 2px;
}

.tba-track-artist {
    color: var(--tba-color);
    opacity: 0.55;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 10px;
}

/* ══════════════════════════════════════
   PRESET: playlist
   ══════════════════════════════════════ */
.tba-preset-playlist {
    background: var(--tba-bg);
    border-radius: 14px;
    overflow: hidden;
}

.tba-playlist-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.tba-playlist-header .tba-player-btn {
    width: 44px;
    height: 44px;
}

.tba-playlist-header .tba-player-btn svg { width: 44%; height: 44%; }

.tba-playlist-now {
    flex: 1;
    min-width: 0;
}

.tba-playlist-now .tba-track-title {
    font-size: 13px;
    margin-bottom: 1px;
}

.tba-playlist-now .tba-track-artist {
    margin-bottom: 0;
    font-size: 11px;
}

.tba-playlist-progress {
    padding: 10px 18px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.tba-playlist-progress .tba-progress-wrap {
    margin-bottom: 4px;
}

.tba-playlist-tracks {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tba-playlist-track {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background 0.14s ease;
}

.tba-playlist-track:last-child {
    border-bottom: none;
}

.tba-playlist-track:hover {
    background: rgba(0, 0, 0, 0.03);
}

.tba-playlist-track.tba-active {
    background: rgba(0, 0, 0, 0.05);
}

.tba-track-num {
    width: 20px;
    text-align: center;
    font-size: 11px;
    color: var(--tba-color);
    opacity: 0.4;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tba-playlist-track.tba-active .tba-track-num {
    opacity: 1;
    color: var(--tba-primary);
}

.tba-playlist-track.tba-active .tba-track-num svg {
    fill: var(--tba-primary);
}

.tba-track-meta {
    flex: 1;
    min-width: 0;
}

.tba-track-meta .tba-track-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 1px;
}

.tba-playlist-track.tba-active .tba-track-meta .tba-track-title {
    font-weight: 600;
}

.tba-track-meta .tba-track-artist {
    font-size: 11px;
    margin-bottom: 0;
}

.tba-track-dur {
    font-size: 11px;
    color: var(--tba-color);
    opacity: 0.38;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Botón de desmutear (fallback autoplay) ──────────────────── */
.tba-unmute-btn {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: inherit;
    border: none;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(2px);
    transition: background 0.15s ease;
    font-family: inherit;
    letter-spacing: 0.2px;
}

.tba-unmute-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.tba-unmute-btn svg {
    flex-shrink: 0;
}
