/* Page-specific styles for beats.html — base styles are in base.css */

/* Container width override */
.container {
    max-width: 800px;
}

/* ===== BEATS GRID ===== */
.beats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* ===== BEAT CARD ===== */
.beat-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: fadeUp 0.5s ease-out both;
    animation-delay: calc(var(--delay) * 0.07s);
    contain: layout paint;
    content-visibility: auto;
    contain-intrinsic-size: 260px;
}

.beat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    background: rgba(255, 215, 0, 0.06);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 30px var(--gold-glow);
}

/* ===== BEAT HEADER ===== */
.beat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.beat-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.beat-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gold-light);
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.15);
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ===== AUDIO PLAYER ===== */
.beat-player-wrapper {
    position: relative;
    width: 100%;
    height: 80px;
    margin-bottom: 18px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
    contain: strict;
}

.beat-player {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.preview-trigger {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.preview-trigger:hover {
    border-color: rgba(255, 215, 0, 0.35);
    background: rgba(255, 215, 0, 0.08);
    color: var(--text);
}

.preview-trigger:disabled {
    cursor: default;
    opacity: 0.75;
}

/* ===== BEAT ACTIONS ===== */
.beat-actions {
    display: flex;
    gap: 10px;
}

.btn-buy {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #0a0a0a;
    box-shadow: 0 4px 16px rgba(212, 160, 18, 0.3);
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(212, 160, 18, 0.45);
    filter: brightness(1.1);
}

.btn-buy:active {
    transform: translateY(0);
}

.btn-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ===== BEAT META (tag + date row) ===== */
.beat-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.beat-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 3px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.beat-date {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ===== LOADING STATE ===== */
.beats-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    animation: fadeUp 0.5s ease-out both;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 215, 0, 0.1);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== EMPTY STATE ===== */
.beats-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
    animation: fadeUp 0.5s ease-out both;
}

.beats-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* ===== MOBILE ===== */
@media (max-width: 768px),
(pointer: coarse) {
    .bg-canvas {
        display: none;
    }

    body {
        background: radial-gradient(circle at 20% 0%, #18120a 0%, #050505 55%);
    }

    .beat-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(20, 20, 20, 0.8);
    }

    .hero,
    .hero h1,
    .beat-card,
    .beats-loading,
    .beats-empty,
    .back-button {
        animation: none !important;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .beats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .beat-card {
        padding: 20px;
    }

    .beat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .beat-actions {
        flex-direction: column;
    }

    .back-button {
        padding: 12px 24px;
        font-size: 0.85rem;
    }
}