/* ================================================
   Audio Statement Player – Frontend CSS
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:wght@500;700&family=Source+Sans+3:wght@400;600&display=swap');

/* ── Wrap ── */
.asp-player-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 28px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.18), 0 1px 4px rgba(0,0,0,.10);
    font-family: 'Source Sans 3', sans-serif;
    color: var(--asp-text, #1a1a2e);
    min-height: 100px;
}

/* Translucent overlay so text stays readable over bg image */
.asp-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.22);
    pointer-events: none;
    z-index: 0;
}

/* ── Avatar ── */
.asp-avatar {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}
.asp-avatar img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,.7);
    box-shadow: 0 2px 12px rgba(0,0,0,.22);
    display: block;
}

/* ── Content ── */
.asp-content {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.asp-title {
    font-family: 'Lora', serif;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--asp-text, #1a1a2e);
}

/* ── Controls ── */
.asp-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.asp-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--asp-text, #1a1a2e);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform .15s, opacity .15s;
    flex-shrink: 0;
}
.asp-btn:hover { opacity: .7; transform: scale(1.12); }
.asp-btn:active { transform: scale(.95); }
.asp-btn svg { fill: currentColor; display: block; }

.asp-play-pause svg { width: 32px; height: 32px; }
.asp-rewind svg,
.asp-forward svg   { width: 26px; height: 26px; }

/* ── Progress / time ── */
.asp-time-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 120px;
}

.asp-current-time,
.asp-duration {
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: .85;
    font-weight: 600;
}

.asp-progress-bar {
    position: relative;
    flex: 1;
    height: 6px;
    background: rgba(0,0,0,.18);
    border-radius: 99px;
    overflow: visible;
}

.asp-progress-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 0%;
    background: var(--asp-accent, #2d6a4f);
    border-radius: 99px;
    pointer-events: none;
    transition: width .1s linear;
}

/* Invisible range slider sits on top */
.asp-seek {
    position: absolute;
    inset: -8px 0;
    width: 100%;
    height: calc(100% + 16px);
    opacity: 0;
    cursor: pointer;
    margin: 0;
}

/* ── Speed selector ── */
.asp-speed-wrap { flex-shrink: 0; }
.asp-speed {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,.45);
    border: 1.5px solid rgba(0,0,0,.2);
    border-radius: 20px;
    padding: 3px 26px 3px 10px;
    font-size: .82rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--asp-text, #1a1a2e);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a1a2e' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color .15s;
}
.asp-speed:hover  { border-color: var(--asp-accent, #2d6a4f); }
.asp-speed:focus  { outline: none; border-color: var(--asp-accent, #2d6a4f); }

/* ── Responsive ── */
@media (max-width: 520px) {
    .asp-player-wrap { flex-direction: column; align-items: flex-start; padding: 16px; }
    .asp-avatar img  { width: 64px; height: 64px; }
    .asp-title       { font-size: 1rem; white-space: normal; }
    .asp-time-wrap   { flex-wrap: wrap; }
}
