/* Base reset and typography */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background: #121212;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    padding: 2rem 1rem;
    border-bottom: 1px solid #2a2a2a;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

.tagline {
    color: #888;
    margin-top: 0.25rem;
}

/* Main content */
main {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    width: 100%;
}

/* Audio player bar */
.player {
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#player-title {
    font-weight: 600;
    color: #fff;
}

#player-bpm {
    color: #888;
    font-size: 0.875rem;
}

audio {
    width: 100%;
    height: 36px;
}

/* Beat cards */
.beats-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.beat-card {
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
}

.beat-card:hover {
    border-color: #444;
}

.beat-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.beat-title {
    font-weight: 600;
    color: #fff;
    font-size: 1.1rem;
}

.beat-meta {
    color: #888;
    font-size: 0.85rem;
}

.beat-tags {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.tag {
    background: #2a2a2a;
    color: #aaa;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Actions (play button, price) */
.beat-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.play-btn {
    background: none;
    border: 2px solid #e0e0e0;
    color: #e0e0e0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
}

.play-btn:hover {
    border-color: #fff;
    color: #fff;
}

.buy-btn {
    background: none;
    border: 2px solid #4caf50;
    color: #4caf50;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.buy-btn:hover {
    background: #4caf50;
    color: #121212;
}

/* Loading state */
.loading {
    text-align: center;
    color: #888;
    padding: 2rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #555;
    font-size: 0.85rem;
    border-top: 1px solid #2a2a2a;
}

/* License modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal {
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #2a2a2a;
}

.modal-header h2 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.license-options {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.5rem;
}

.license-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    width: 100%;
    text-align: left;
}

.license-option:hover {
    border-color: #4caf50;
    background: #2a2a2a;
}

.license-option:disabled {
    opacity: 0.5;
    cursor: wait;
}

.license-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.license-label {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.license-type {
    color: #888;
    font-size: 0.8rem;
}

.license-price {
    color: #4caf50;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.5rem;
    }

    .beat-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .beat-actions {
        width: 100%;
        justify-content: space-between;
    }
}
