:root {
    --bg: #121212;
    --bg-elevated: #181818;
    --bg-card: #212121;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent: #1DB954;
    --accent-hover: #1ed760;
    --border: #2a2a2a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}
.nav-brand { font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.nav-tag { font-size: 0.75rem; color: var(--text-secondary); }
.nav-auth { font-size: 0.85rem; color: var(--text-secondary); }
.nav-auth a { color: var(--text-secondary); }
.nav-auth a:hover { color: var(--accent); }
.nav-link-btn { background: none; border: none; padding: 0; font: inherit; color: var(--text-secondary); cursor: pointer; }
.nav-link-btn:hover { color: var(--accent); }

main { flex: 1; padding: 2rem; max-width: 1000px; margin: 0 auto; width: 100%; }

.messages { list-style: none; margin-bottom: 1.5rem; }
.messages li { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 0.5rem; background: var(--bg-card); border-left: 3px solid var(--accent); font-size: 0.9rem; }
.messages li.error { border-left-color: #e74c3c; }

.form-card { max-width: 480px; margin: 2rem auto; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 2.5rem; }
.form-card h1 { font-size: 1.6rem; margin-bottom: 0.4rem; }
.subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; }

.field { margin-bottom: 1.25rem; }
.field label { display: block; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-secondary); margin-bottom: 0.4rem; }
.field .optional { text-transform: none; font-weight: 400; }

.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field textarea,
.field select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}
.field textarea { min-height: 90px; resize: vertical; }
.field select[multiple] { min-height: 140px; }
.field select[multiple] option:checked { background: var(--accent); color: #000; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }

.field-error { color: #e74c3c; font-size: 0.8rem; margin-top: 0.3rem; }
.form-errors { background: #e74c3c22; border: 1px solid #e74c3c; padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1.25rem; font-size: 0.85rem; }

.actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.btn { display: inline-block; padding: 0.6rem 1.4rem; border-radius: 500px; font-weight: 700; font-size: 0.85rem; text-decoration: none; border: none; cursor: pointer; transition: transform 0.1s, background 0.15s; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); transform: scale(1.03); }

footer { text-align: center; padding: 1.5rem; color: var(--text-secondary); font-size: 0.8rem; }

/* Home Page Styles */
.home-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1.5rem;
}
.home-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}
.home-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.search-container {
    margin-bottom: 2rem;
}
.search-form {
    display: flex;
    gap: 0.5rem;
}
.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
}
.search-input::placeholder {
    color: var(--text-secondary);
}
.search-input:focus {
    outline: none;
    border-color: var(--accent);
}
.btn-search {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.btn-search:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

/* Song Grid */
.song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    place-items: center;
}

.song-card-link {
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.song-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.song-card:hover {
    background: var(--bg-elevated);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(29, 185, 84, 0.15);
    border-color: var(--accent);
}

.song-art {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #1DB954, #1ed760);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.song-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
}
.song-artist {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.song-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
.song-likes {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.75rem;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 3rem 1rem;
}

/* Artist Detail Page */
.artist-header {
    background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%);
    color: #000;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}
.artist-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}
.artist-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}
.stat {
    display: flex;
    flex-direction: column;
}
.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
}
.stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.follow-btn {
    background: #000;
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 500px;
    cursor: pointer;
    transition: all 0.2s;
}
.follow-btn:hover {
    background: #333;
    transform: scale(1.05);
}
.follow-btn.following {
    background: #fff;
    color: #000;
}
.follow-btn.following:hover {
    background: #e0e0e0;
}

/* Sections */
.section {
    margin-bottom: 2.5rem;
}
.section h2 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.75rem;
}

.music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}
.music-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}
.music-card:hover {
    background: var(--bg-elevated);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(29, 185, 84, 0.15);
    border-color: var(--accent);
}
.music-card h3 {
    margin: 0.75rem 0;
    font-size: 1.05rem;
    color: var(--text-primary);
}
.music-card p {
    color: var(--text-secondary);
    margin: 0.4rem 0;
    font-size: 0.85rem;
}
.genre-badge {
    display: inline-block;
    background: var(--accent);
    color: #000;
    padding: 0.4rem 1rem;
    border-radius: 500px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Music Detail Page */
.music-detail-header {
    background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%);
    color: #000;
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}
.music-art {
    font-size: 5rem;
    width: 120px;
    height: 120px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.music-info {
    flex: 1;
}
.music-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}
.music-artist {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}
.music-artist a {
    color: #000;
    text-decoration: none;
    font-weight: 600;
}
.music-artist a:hover {
    text-decoration: underline;
}
.music-album {
    color: rgba(0, 0, 0, 0.8);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
.music-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.release-date {
    color: rgba(0, 0, 0, 0.8);
}
.music-actions {
    display: flex;
    gap: 0.75rem;
}
.btn-like {
    background: #000;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 500px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-like:hover {
    background: #333;
    transform: scale(1.05);
}
.btn-like.liked {
    background: #fff;
    color: #000;
}
.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Album Card */
.album-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
}
.album-detail p {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}
.album-detail p strong {
    color: var(--accent);
}
.album-detail a {
    color: var(--accent);
    text-decoration: none;
}
.album-detail a:hover {
    text-decoration: underline;
}