/* Hostplay Radio Player for WordPress */
#hp-wp-player {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99999;
    --hp-accent: #555;           /* cor neutra inicial; actualizada via JS com accent_color da rádio */
    --hp-accent-glow: rgba(85,85,85,.4);
    background: rgba(10,10,10,.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: transform .3s ease, opacity .3s ease;
}

#hp-wp-player.hp-player--bottom {
    bottom: 0;
    border-top: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 -8px 32px rgba(0,0,0,.4);
}

#hp-wp-player.hp-player--top {
    top: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

#hp-wp-player.hp-player--hidden {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
}

#hp-wp-player.hp-player--top.hp-player--hidden {
    transform: translateY(-110%);
}

.hp-player__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Capa */
.hp-player__cover-wrap {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
}

.hp-player__cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .3s;
}

.hp-player__cover[src=""] { opacity: 0; }

/* Info */
.hp-player__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hp-player__title {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: .01em;
}

.hp-player__artist {
    color: rgba(255,255,255,.55);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Controles */
.hp-player__controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Reset agressivo para anular estilos do WordPress/tema */
#hp-wp-player button,
#hp-wp-player .hp-player__btn {
    all: unset;
    box-sizing: border-box !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: none !important;
    line-height: 1 !important;
    transition: transform .15s, opacity .15s !important;
}

#hp-wp-player button:hover,
#hp-wp-player .hp-player__btn:hover { opacity: .8; transform: scale(1.05); }
#hp-wp-player button:active,
#hp-wp-player .hp-player__btn:active { transform: scale(.95) !important; }

#hp-wp-player .hp-player__btn--play {
    width: 40px !important;
    height: 40px !important;
    background: var(--hp-accent) !important;
    border-radius: 50% !important;
    color: #fff !important;
    box-shadow: 0 4px 16px var(--hp-accent-glow) !important;
    flex-shrink: 0 !important;
    transition: background .3s, box-shadow .3s, transform .15s !important;
}

/* Botão de volume */
.hp-vol-wrap {
    position: relative;
}

.hp-player__btn--vol {
    width: 32px !important;
    height: 32px !important;
    color: rgba(255,255,255,.45) !important;
    background: none !important;
    flex-shrink: 0 !important;
}

.hp-player__btn--vol:hover,
.hp-player__btn--vol.hp-vol-active {
    color: #fff !important;
    background: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Popup vertical que abre para cima */
.hp-vol-popup {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scaleY(0);
    transform-origin: bottom center;
    background: rgba(15,15,15,.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 40px;
    opacity: 0;
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

.hp-vol-popup.hp-vol-popup--open {
    transform: translateX(-50%) scaleY(1);
    opacity: 1;
    pointer-events: all;
}

/* Seta apontando para baixo */
.hp-vol-popup::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(15,15,15,.95);
    border-bottom: none;
}

.hp-vol-popup__pct {
    color: rgba(255,255,255,.6);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    user-select: none;
}

/* Slider vertical */
.hp-vol-popup__slider {
    -webkit-appearance: slider-vertical;
    appearance: slider-vertical;
    width: 4px;
    height: 90px;
    cursor: pointer;
    outline: none;
    border: none;
    background: transparent;
    writing-mode: vertical-lr;
    direction: rtl;
}

.hp-vol-popup__slider::-webkit-slider-runnable-track {
    width: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 2px;
}

.hp-vol-popup__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--hp-accent, #f97316);
    cursor: pointer;
    margin-left: -5px;
    box-shadow: 0 2px 8px var(--hp-accent-glow, rgba(249,115,22,.5));
}

.hp-vol-popup__slider::-moz-range-track {
    width: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 2px;
}

.hp-vol-popup__slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--hp-accent, #f97316);
    border: none;
    cursor: pointer;
}

/* Animação de carregamento */
@keyframes hp-spin {
    to { stroke-dashoffset: -100; }
}

/* Responsivo */
@media (max-width: 480px) {
    .hp-player__vol-row { display: none; }
    .hp-player__inner { gap: 10px; padding: 8px 12px; }
    .hp-player__cover-wrap { width: 38px; height: 38px; }
    .hp-player__title { font-size: 12px; }
    .hp-player__artist { font-size: 10px; }
}

/* Garante que o conteúdo do WordPress não fica coberto pelo player */
body.hp-player-bottom { padding-bottom: 80px !important; }
body.hp-player-top    { padding-top: 70px !important; }
