/* ============================================================
   HIKAMI MODERN AUDIO PLAYER — Spotify-style
============================================================ */

/* ---- Player Bar (fixed bottom, appears when audio plays) ---- */
#hikami-audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0d2b1d;
    border-top: 3px solid #C4973A;
    z-index: 9990;
    padding: 0;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
}
#hikami-audio-player.player-visible {
    transform: translateY(0);
}

.player-inner {
    display: grid;
    grid-template-columns: 300px 1fr 220px;
    align-items: center;
    gap: 0;
    min-height: 90px;
    padding: 0 24px;
}

/* ---- Track Info (left) ---- */
.player-track-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.player-cover {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(196,151,58,0.4);
    background: #1B4332;
}
.player-cover-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    background: linear-gradient(135deg, #1B4332, #2D6A4F);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(196,151,58,0.4);
}
.player-cover-placeholder svg {
    width: 28px;
    height: 28px;
    color: rgba(196,151,58,0.6);
}
.player-track-text { min-width: 0; }
.player-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.player-series {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Controls (center) ---- */
.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
}
.player-buttons {
    display: flex;
    align-items: center;
    gap: 20px;
}
.player-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    padding: 0;
    color: rgba(255,255,255,0.7);
}
.player-btn:hover { color: #fff; transform: scale(1.08); }
.player-btn svg { display: block; }

.player-btn-prev svg,
.player-btn-next svg { width: 20px; height: 20px; }

.player-btn-skip svg { width: 22px; height: 22px; }

.player-btn-play {
    width: 44px;
    height: 44px;
    background: #C4973A;
    border-radius: 50%;
    color: #fff;
}
.player-btn-play:hover { background: #E8BE6A; transform: scale(1.06); }
.player-btn-play svg { width: 20px; height: 20px; }
.player-btn-play .icon-play  { display: block; margin-left: 2px; }
.player-btn-play .icon-pause { display: none; }
.player-btn-play.playing .icon-play  { display: none; }
.player-btn-play.playing .icon-pause { display: block; }

/* Progress / seek bar */
.player-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 520px;
}
.player-time {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    min-width: 36px;
    font-family: 'Lato', monospace;
}
.player-time.time-end { text-align: right; }

.player-seekbar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: height .15s;
}
.player-seekbar:hover { height: 6px; }
.player-seek-fill {
    height: 100%;
    background: #C4973A;
    border-radius: 2px;
    position: relative;
    pointer-events: none;
    transition: width .1s linear;
}
.player-seek-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transition: transform .15s;
    box-shadow: 0 0 4px rgba(0,0,0,0.4);
}
.player-seekbar:hover .player-seek-fill::after { transform: translateY(-50%) scale(1); }

/* ---- Right Controls ---- */
.player-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}
.player-volume-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.player-vol-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    padding: 0;
    display: flex;
    align-items: center;
}
.player-vol-btn:hover { color: #fff; }
.player-vol-btn svg { width: 18px; height: 18px; }
.player-volume-bar {
    width: 80px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}
.player-volume-fill {
    height: 100%;
    background: rgba(255,255,255,0.6);
    border-radius: 2px;
}
.player-volume-bar:hover .player-volume-fill { background: #C4973A; }

.player-download-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    padding: 0;
    display: flex;
    align-items: center;
    transition: color .15s;
}
.player-download-btn:hover { color: var(--gold, #C4973A); }
.player-download-btn svg { width: 18px; height: 18px; }

.player-close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.4);
    font-size: 20px;
    padding: 0;
    line-height: 1;
    transition: color .15s;
}
.player-close:hover { color: #fff; }

/* ---- Audio List Cards (replace old audio-item) ---- */
.audio-card-list { display: flex; flex-direction: column; gap: 10px; }
.audio-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--white, #fff);
    border: 1px solid var(--border, #E0D5C0);
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    overflow: hidden;
}
.audio-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--gold, #C4973A);
    transform: scaleY(0);
    transition: transform .2s;
}
.audio-card:hover, .audio-card.playing {
    border-color: var(--gold, #C4973A);
    box-shadow: 0 4px 16px rgba(196,151,58,0.12);
    transform: translateX(3px);
}
.audio-card:hover::before, .audio-card.playing::before { transform: scaleY(1); }

.audio-card-thumb {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--green, #1B4332);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.audio-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.audio-card-thumb-placeholder {
    width: 56px; height: 56px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--green, #1B4332), #2D6A4F);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.audio-card-thumb-placeholder svg { width: 24px; height: 24px; color: rgba(196,151,58,0.7); }

/* Equalizer animation when playing */
.audio-card.playing .audio-card-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}
.audio-eq {
    display: none;
    position: absolute;
    inset: 0;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    padding: 10px 8px;
    z-index: 2;
}
.audio-card.playing .audio-eq { display: flex; }
.audio-eq span {
    display: block;
    width: 3px;
    background: var(--gold, #C4973A);
    border-radius: 1px;
    animation: eq-bounce 0.8s ease infinite alternate;
}
.audio-eq span:nth-child(1) { animation-delay: 0s;    height: 40%; }
.audio-eq span:nth-child(2) { animation-delay: 0.15s; height: 70%; }
.audio-eq span:nth-child(3) { animation-delay: 0.05s; height: 55%; }
.audio-eq span:nth-child(4) { animation-delay: 0.2s;  height: 80%; }
@keyframes eq-bounce {
    from { transform: scaleY(0.4); }
    to   { transform: scaleY(1); }
}

.audio-card-play-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--green, #1B4332);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all .2s;
    color: var(--gold, #C4973A);
}
.audio-card-play-btn:hover { background: var(--gold, #C4973A); color: #fff; transform: scale(1.08); }
.audio-card-play-btn svg { width: 16px; height: 16px; }
.audio-card-play-btn .btn-play  { display: block; margin-left: 2px; }
.audio-card-play-btn .btn-pause { display: none; }
.audio-card.playing .audio-card-play-btn .btn-play  { display: none; }
.audio-card.playing .audio-card-play-btn .btn-pause { display: block; margin-left: 0; }

.audio-card-info { flex: 1; min-width: 0; }
.audio-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark, #1A1A1A);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.audio-card.playing .audio-card-title { color: var(--green, #1B4332); }
.audio-card-meta {
    font-size: 12px;
    color: var(--text-muted, #7A7A7A);
    display: flex;
    gap: 10px;
    align-items: center;
}
.audio-card-duration {
    font-size: 12px;
    color: var(--text-muted, #7A7A7A);
    white-space: nowrap;
    font-weight: 700;
}

/* Padding so content doesn't hide behind fixed player */
body.player-active { padding-bottom: 95px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .player-inner { grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 0; padding: 12px 16px; }
    .player-track-info { min-width: 0; }
    .player-right { display: none; }
    .player-controls { padding: 8px 0; }
    .player-progress-wrap { max-width: 100%; }
}
@media (max-width: 600px) {
    .player-cover, .player-cover-placeholder { width: 44px; height: 44px; }
    .player-title { font-size: 12px; }
    .player-btn-play { width: 38px; height: 38px; }
    .audio-card-list { gap: 8px; }
}
