/* ──────────────────────────────────────────────────
   HP Audio Portfolio - Waveform Player Styles
   ────────────────────────────────────────────────── */

/* Player Area (replaces the old thumbnail section) */
.hpap-player-area {
    background: linear-gradient(145deg, #1a1410 0%, #0d0a07 100%);
    border-bottom: 1px solid rgba(212, 168, 67, 0.1);
    position: relative;
    overflow: hidden;
}

/* ── Waveform Player Layout ── */
.hpap-waveform-player {
    display: flex;
    align-items: stretch;
    min-height: 120px;
}

/* Album Art (left side) */
.hpap-album-art {
    width: 120px;
    min-height: 120px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #231a12 0%, #1a1410 50%, #0d0a07 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-right: 1px solid rgba(212, 168, 67, 0.08);
}

.hpap-art-placeholder {
    opacity: 0.5;
    transition: opacity 0.3s;
}

.hpap-track-card:hover .hpap-art-placeholder {
    opacity: 0.8;
}

/* Player Controls (right side) */
.hpap-player-controls {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    min-width: 0;
}

/* Play Button */
.hpap-play-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    border: 2px solid rgba(212, 168, 67, 0.4);
    background: rgba(212, 168, 67, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.hpap-play-btn:hover {
    background: rgba(212, 168, 67, 0.25);
    border-color: #d4a843;
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
}

.hpap-play-btn:active {
    transform: scale(0.95);
}

.hpap-play-btn .hpap-icon-play {
    margin-left: 3px; /* visual center for play triangle */
}

/* Waveform / Progress */
.hpap-waveform-container {
    flex: 1;
    height: 48px;
    position: relative;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    min-width: 0;
}

.hpap-waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    z-index: 2;
}

.hpap-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 245, 230, 0.08);
    border-radius: 2px;
    z-index: 3;
}

.hpap-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #d4a843, #e6bc5a);
    border-radius: 2px;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(212, 168, 67, 0.4);
}

/* Time Display */
.hpap-time {
    font-family: 'Montserrat', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #b0a090;
    white-space: nowrap;
    min-width: 36px;
    text-align: right;
    letter-spacing: 0.02em;
}

/* ── Track Info Additions ── */
.hpap-artist {
    display: block;
    font-size: 0.8rem;
    color: #d4a843;
    font-weight: 500;
    margin-top: 2px;
    letter-spacing: 0.03em;
}

.hpap-track-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.hpap-year, .hpap-duration {
    font-size: 0.7rem;
    color: #7a6a5a;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.hpap-duration::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 3px;
    background: #7a6a5a;
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* ── SoundCloud Embed ── */
.hpap-player-area:has(.hpap-soundcloud-wrap) {
    background: transparent;
}
.hpap-soundcloud-wrap {
    padding: 12px;
    min-height: 120px;
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}
.hpap-sc-with-art {
    gap: 12px;
}
.hpap-sc-artwork {
    width: 120px;
    min-width: 120px;
    height: 120px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}
.hpap-sc-player {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    border-radius: 8px;
    background: transparent;
    position: relative;
}
/* Brown-tinted overlay on top of the native SoundCloud player */
.hpap-sc-player::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(26, 20, 16, 0.55);
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: multiply;
}
.hpap-soundcloud-wrap iframe {
    border-radius: 8px;
    min-height: 166px;
    display: block;
    filter: sepia(0.35) saturate(0.8) brightness(0.85);
}

/* ── No Audio State ── */
.hpap-no-audio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    gap: 8px;
    padding: 20px;
}

.hpap-no-audio span {
    font-size: 0.75rem;
    color: #7a6a5a;
    font-style: italic;
    letter-spacing: 0.03em;
}

/* ── Playing State ── */
.hpap-track-card.hpap-playing {
    border-color: rgba(212, 168, 67, 0.35) !important;
    box-shadow: 0 0 30px rgba(212, 168, 67, 0.15), inset 0 0 60px rgba(212, 168, 67, 0.03) !important;
}

.hpap-track-card.hpap-playing .hpap-play-btn {
    background: rgba(212, 168, 67, 0.2);
    border-color: #d4a843;
    box-shadow: 0 0 15px rgba(212, 168, 67, 0.25);
}

.hpap-track-card.hpap-playing .hpap-album-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(212, 168, 67, 0.15) 0%, transparent 70%);
    animation: hpap-pulse 2s ease-in-out infinite;
}

@keyframes hpap-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ── Loading State ── */
.hpap-waveform-player.hpap-loading .hpap-waveform-canvas {
    opacity: 0.3;
}

.hpap-waveform-player.hpap-loading .hpap-play-btn {
    opacity: 0.7;
}

.hpap-waveform-player.hpap-loading::after {
    content: "Loading...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    color: #7a6a5a;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    z-index: 5;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .hpap-waveform-player {
        flex-direction: column;
        min-height: auto;
    }

    .hpap-album-art {
        width: 100%;
        height: 160px;
        min-height: 160px;
        border-right: none;
        border-bottom: 1px solid rgba(212, 168, 67, 0.08);
    }

    .hpap-player-controls {
        padding: 12px 16px;
        gap: 10px;
    }

    .hpap-play-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }

    .hpap-waveform-container {
        height: 40px;
    }

    .hpap-sc-artwork {
        width: 80px;
        min-width: 80px;
        height: 80px;
    }
    .hpap-soundcloud-wrap {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .hpap-album-art {
        height: 120px;
        min-height: 120px;
    }
}

/* ── Visualizer Bars (playing animation) ── */
.hpap-visualizer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    padding: 0 10px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.hpap-playing .hpap-visualizer {
    opacity: 0.6;
}

.hpap-vis-bar {
    width: 3px;
    background: linear-gradient(to top, #d4a843, transparent);
    border-radius: 2px 2px 0 0;
    animation: hpap-vis 0.8s ease-in-out infinite alternate;
}

@keyframes hpap-vis {
    0% { height: 4px; }
    100% { height: 20px; }
}

.hpap-vis-bar:nth-child(2) { animation-delay: 0.1s; }
.hpap-vis-bar:nth-child(3) { animation-delay: 0.2s; }
.hpap-vis-bar:nth-child(4) { animation-delay: 0.15s; }
.hpap-vis-bar:nth-child(5) { animation-delay: 0.25s; }
.hpap-vis-bar:nth-child(6) { animation-delay: 0.05s; }
.hpap-vis-bar:nth-child(7) { animation-delay: 0.3s; }

/* ══════════════════════════════════════════════════
   LOCK OVERLAY
   ══════════════════════════════════════════════════ */
.hpap-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 10, 7, 0.92);
    backdrop-filter: blur(8px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    transition: opacity 0.4s ease;
}

.hpap-lock-overlay.hpap-unlocked {
    opacity: 0;
    pointer-events: none;
}

.hpap-lock-icon {
    opacity: 0.7;
}

.hpap-lock-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.hpap-lock-input {
    width: 160px;
    padding: 8px 14px;
    background: rgba(255, 245, 230, 0.06);
    border: 1px solid rgba(212, 168, 67, 0.3);
    border-radius: 6px;
    color: #f5f0ea;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.3s;
}

.hpap-lock-input:focus {
    border-color: #d4a843;
}

.hpap-lock-input::placeholder {
    color: #7a6a5a;
}

.hpap-lock-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 6px;
    background: #d4a843;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.hpap-lock-btn:hover {
    background: #e6bc5a;
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.4);
}

.hpap-lock-input.hpap-lock-error {
    border-color: #e74c3c;
    animation: hpap-shake 0.4s ease;
}

@keyframes hpap-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Player area needs position relative for overlay */
.hpap-player-area {
    position: relative;
}

/* Locked card has subtle visual difference */
.hpap-locked .hpap-player-controls {
    filter: blur(3px);
    pointer-events: none;
}

.hpap-locked .hpap-waveform-canvas {
    filter: blur(2px);
}

.hpap-locked.hpap-card-unlocked .hpap-player-controls {
    filter: none;
    pointer-events: auto;
}

.hpap-locked.hpap-card-unlocked .hpap-waveform-canvas {
    filter: none;
}

/* ══════════════════════════════════════════════════
   TRACK INFO TOP ROW (title + action icons)
   ══════════════════════════════════════════════════ */
.hpap-info-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.hpap-info-text {
    flex: 1;
    min-width: 0;
}

.hpap-track-actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding-top: 2px;
}

/* Action icons (lock badge + buy button) */
.hpap-action-icon {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.03em;
    transition: all 0.3s;
    border: none;
    cursor: default;
    background: none;
}

.hpap-lock-badge {
    color: #b0a090;
    background: rgba(176, 160, 144, 0.1);
}

.hpap-lock-badge.hpap-badge-unlocked {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.hpap-lock-badge.hpap-badge-unlocked svg {
    stroke: #2ecc71;
}

.hpap-buy-btn {
    cursor: pointer;
    color: #d4a843;
    background: rgba(212, 168, 67, 0.08);
    border: 1px solid rgba(212, 168, 67, 0.2);
    padding: 5px 10px;
}

.hpap-buy-btn:hover {
    background: rgba(212, 168, 67, 0.18);
    border-color: rgba(212, 168, 67, 0.5);
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.15);
    transform: translateY(-1px);
}

.hpap-price-tag {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: #d4a843;
}

/* ══════════════════════════════════════════════════
   BUY / PAYPAL MODAL
   ══════════════════════════════════════════════════ */
.hpap-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.hpap-modal-overlay.active {
    display: flex;
}

.hpap-modal {
    background: #1a1410;
    border: 1px solid rgba(212, 168, 67, 0.15);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.hpap-modal-top {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 245, 230, 0.06);
    display: flex;
    align-items: center;
    gap: 16px;
}

.hpap-modal-art {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: #231a12;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.hpap-modal-info h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #f5f0ea;
    margin: 0 0 4px 0;
}

.hpap-modal-info .hpap-modal-artist {
    font-size: 0.8rem;
    color: #b0a090;
}

.hpap-modal-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(212, 168, 67, 0.04);
}

.hpap-modal-price-label {
    font-size: 0.75rem;
    color: #b0a090;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.hpap-modal-price-val {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: #d4a843;
}

.hpap-modal-paypal {
    padding: 1.5rem;
}

.hpap-modal-paypal-placeholder {
    text-align: center;
    padding: 2rem 1rem;
    color: #7a6a5a;
    font-size: 0.82rem;
}

.hpap-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    color: #b0a090;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.hpap-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f5f0ea;
}

/* Download success state */
.hpap-download-success {
    text-align: center;
    padding: 2rem 1.5rem;
}

.hpap-download-success svg {
    margin-bottom: 12px;
}

.hpap-download-success h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    color: #2ecc71;
    margin: 0 0 8px 0;
}

.hpap-download-success p {
    font-size: 0.82rem;
    color: #b0a090;
    margin: 0 0 16px 0;
}

.hpap-download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #d4a843;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.hpap-download-link:hover {
    background: #e6bc5a;
    box-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
}

/* ══════════════════════════════════════════════════
   RESPONSIVE ADDITIONS
   ══════════════════════════════════════════════════ */
@media (max-width: 600px) {
    .hpap-lock-input { width: 130px; font-size: 0.78rem; }
    .hpap-buy-btn .hpap-price-tag { display: none; }
    .hpap-modal { margin: 1rem; max-width: none; }
}
