@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;700&display=swap');

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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --gold: #fbbf24;
    --silver: #94a3b8;
    --bronze: #cd7f32;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #2a2a3a;
    --success: #22c55e;
    --error: #ef4444;
    --youtube: #ff0033;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at top, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* Header */
header {
    background: rgba(18, 18, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

nav h1 a {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

nav h1 a::before {
    content: '';
    display: inline-block;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 8px;
    box-shadow: 0 0 20px var(--accent-glow);
}

nav h1 a:hover {
    color: var(--accent-secondary);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

/* User Switcher */
.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.user-switcher {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.user-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.user-btn:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

.user-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
    color: white;
    box-shadow: 0 2px 10px var(--accent-glow);
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* Header Section */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.header-section h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.song-count {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-secondary);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Search */
.search-bar {
    margin-bottom: 2rem;
}

.search-bar form {
    display: flex;
    gap: 0.75rem;
}

.search-bar input {
    flex: 1;
    padding: 0.9rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar button {
    padding: 0.9rem 1.75rem;
    background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-bar button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.clear-search {
    padding: 0.9rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.clear-search:hover {
    color: var(--text-primary);
}

/* Table */
.songs-list {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem 1.25rem;
    text-align: left;
}

th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

td {
    border-bottom: 1px solid rgba(42, 42, 58, 0.5);
}

.rank-col { width: 90px; }
.youtube-col { width: 110px; }
.actions-col { width: 100px; text-align: center; }
.move-col { width: 80px; text-align: center; }

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Rank Badges */
.rank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* Top 10 - Gold Crown */
tr.top-ten {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.1) 0%, transparent 50%);
}

tr.top-ten .rank-number {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    border: none;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

tr.top-ten .title {
    color: var(--gold);
    font-weight: 600;
}

/* Top 100 - Silver/Purple tint */
tr.top-hundred:not(.top-ten) {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
}

tr.top-hundred:not(.top-ten) .rank-number {
    background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
    color: white;
    border: none;
}

.title {
    font-weight: 500;
    color: var(--text-primary);
}

.artist {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Overall Rankings */
.avg-col { width: 100px; }
.breakdown-col { width: 250px; }

.avg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.user-rankings {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Rank Prompt */
.rank-prompt {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent-primary);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 70px;
    z-index: 50;
}

.rank-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.rank-prompt-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.prompt-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.song-to-rank {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    transition: all 0.3s ease;
    border: 2px dashed var(--border);
}

.song-to-rank:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.song-to-rank.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: scale(0.98);
}

.song-info {
    flex: 1;
}

.song-info .song-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.song-info .song-artist {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.other-rankings {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.other-rankings .avg-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.ranking-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.song-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-skip {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-skip:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.rank-instructions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.rank-instructions p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.quick-rank {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.rank-action-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #1e1e2a;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid #3a3a4a;
}

.rank-action-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.quick-rank input {
    width: 80px;
    padding: 0.6rem 0.75rem;
    border: 2px solid #4a4a5a;
    border-radius: 8px;
    background: #2a2a3a;
    color: var(--text-primary);
    font-size: 1rem;
    text-align: center;
    font-weight: 500;
}

.quick-rank input::placeholder {
    color: #6a6a7a;
}

.quick-rank input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: #3a3a4a;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-jump {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
}

.btn-jump:hover {
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.rank-divider {
    display: none;
}

/* Drag and drop styles */
.song-row.drag-over {
    background: rgba(139, 92, 246, 0.2) !important;
    box-shadow: inset 0 -3px 0 var(--accent-primary);
}

.drop-indicator {
    height: 3px;
    background: var(--accent-primary);
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

/* Needs More Rankings Section */
.needs-rankings-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px dashed var(--border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    color: var(--text-muted);
}

.section-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(100, 116, 139, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
}

.songs-list.unranked {
    opacity: 0.9;
}

.unranked-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px dashed var(--border);
}

.unranked-section .section-header {
    margin-bottom: 1rem;
}

.unranked-section h3 {
    color: var(--accent-secondary);
}

.unranked-row {
    background: rgba(139, 92, 246, 0.05);
}

.unranked-row:hover {
    background: rgba(139, 92, 246, 0.1);
}

.ranked-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
    border-radius: 6px;
    font-weight: 500;
}

tr.needs-ranking {
    background: rgba(100, 116, 139, 0.05);
}

tr.needs-ranking:hover {
    background: rgba(100, 116, 139, 0.1);
}

.rank-number.unranked {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 1px dashed var(--border);
}

/* YouTube Link */
.youtube-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    background: var(--youtube);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.youtube-link::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid white;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

.youtube-link:hover {
    background: #cc0029;
    transform: scale(1.05);
}

.no-link {
    color: var(--text-muted);
}

/* Actions */
.actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

td.actions {
    display: table-cell;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

td.actions .btn,
td.actions .ranked-badge {
    vertical-align: middle;
    line-height: 1;
}

.delete-form {
    display: inline;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.btn-edit {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-secondary);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.btn-edit:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-primary);
}

.btn-delete {
    background: transparent;
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
}

.btn-move {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-secondary);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-move:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-primary);
}

.btn-move.btn-cancel {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-move.btn-cancel:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error);
}

tr.moving {
    background: rgba(139, 92, 246, 0.2) !important;
    box-shadow: 0 0 20px var(--accent-glow);
}

tr.moving td {
    border-color: var(--accent-primary);
}

.move-col {
    width: 80px;
    text-align: center;
}

.move {
    text-align: center;
}

.view-only-badge {
    display: inline-block;
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: 1rem;
}

.logout-link {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
}

.request-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.rank-divider {
    color: var(--text-muted);
    margin: 0 0.5rem;
}

tr.highlight-jump {
    background: rgba(251, 191, 36, 0.3) !important;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
    transition: all 0.3s ease;
}

tr.highlight-jump td {
    border-color: var(--gold);
}

/* Friends Page */
.friends-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.friends-section h3 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--accent-secondary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.friend-card, .request-card, .sent-card, .potential-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.friend-name, .request-name, .sent-name, .potential-name {
    font-weight: 500;
    color: var(--text-primary);
}

.request-text, .sent-status {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.friend-actions, .request-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.no-friends {
    color: var(--text-muted);
    font-style: italic;
}

.friends-link {
    position: relative;
}

.badge {
    background: var(--accent-primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.3rem;
    font-weight: 600;
}

.friends-info {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state::before {
    content: '';
    display: block;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    opacity: 0.2;
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Form Styles */
.song-form {
    max-width: 500px;
}

h2 {
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
}

.form-actions .btn {
    padding: 0.9rem 2rem;
    font-size: 0.95rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.alert-success::before {
    background: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.alert-error::before {
    background: var(--error);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 0.75rem;
        position: sticky;
        top: 0;
    }

    nav {
        flex-direction: column;
        gap: 0.75rem;
    }

    nav h1 a {
        font-size: 1.2rem;
    }

    nav h1 a::before {
        width: 24px;
        height: 24px;
    }

    .nav-center {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-center::-webkit-scrollbar {
        display: none;
    }

    .user-switcher {
        width: max-content;
        min-width: 100%;
        justify-content: flex-start;
        padding: 0.2rem;
        gap: 0.15rem;
    }

    .user-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .nav-links a {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    main {
        padding: 0.75rem;
    }

    .container {
        padding: 1rem;
        border-radius: 12px;
    }

    .header-section {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .header-section h2 {
        font-size: 1.25rem;
    }

    .song-count {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .search-bar {
        margin-bottom: 1rem;
    }

    .search-bar form {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-bar input {
        padding: 0.75rem 1rem;
        font-size: 16px; /* Prevents iOS zoom */
    }

    .search-bar button {
        padding: 0.75rem 1.25rem;
    }

    /* Mobile-friendly table - card layout */
    .songs-list {
        border: none;
        border-radius: 0;
    }

    table {
        display: block;
    }

    thead {
        display: none;
    }

    tbody {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    tbody tr {
        display: flex;
        flex-wrap: wrap;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 0.75rem;
        gap: 0.5rem;
        align-items: center;
    }

    tbody tr:hover {
        background: var(--bg-card);
    }

    td {
        padding: 0;
        border: none;
    }

    td.rank-col {
        order: 1;
        width: auto;
    }

    td:nth-child(2) { /* Title */
        order: 2;
        flex: 1;
        min-width: 0;
    }

    td:nth-child(3) { /* Artist */
        order: 3;
        width: 100%;
        padding-left: calc(48px + 0.5rem);
        margin-top: -0.25rem;
    }

    td.youtube-col {
        order: 4;
        width: auto;
    }

    td.actions-col, td.move-col {
        order: 5;
        width: auto;
    }

    .rank-number {
        min-width: 40px;
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }

    .title {
        font-size: 0.9rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .artist {
        font-size: 0.8rem;
    }

    .youtube-link {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    .actions {
        flex-direction: row;
        gap: 0.25rem;
    }

    .btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.7rem;
    }

    .btn-move {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }

    /* Rank prompt mobile */
    .rank-prompt {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
        top: 120px;
    }

    .rank-prompt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .rank-prompt-header h3 {
        font-size: 1rem;
    }

    .song-to-rank {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        gap: 0.75rem;
    }

    .song-info .song-title {
        font-size: 1rem;
    }

    .song-info .song-artist {
        font-size: 0.9rem;
    }

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

    .quick-rank {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .quick-rank input {
        width: 70px;
        padding: 0.5rem;
        font-size: 16px;
    }

    /* Overall rankings mobile */
    .avg-col, .breakdown-col {
        width: auto;
    }

    td.avg-col {
        order: 2;
    }

    td.breakdown-col {
        order: 6;
        width: 100%;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border);
        margin-top: 0.5rem;
    }

    .user-rankings {
        font-size: 0.75rem;
    }

    /* Friends page mobile */
    .friends-section {
        padding: 1rem;
    }

    .friend-card, .request-card, .sent-card, .potential-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .friend-actions, .request-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* Form mobile */
    .form-group input {
        font-size: 16px; /* Prevents iOS zoom */
    }

    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-actions .btn {
        width: 100%;
        padding: 0.75rem 1.5rem;
    }

    /* Toast mobile */
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        text-align: center;
    }

    /* Footer mobile */
    footer {
        padding: 1rem;
        font-size: 0.75rem;
    }

    /* Needs rankings section */
    .needs-rankings-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    /* View only badge */
    .view-only-badge {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    nav h1 a {
        font-size: 1rem;
    }

    .user-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
    }

    .nav-links a {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
    }

    .rank-number {
        min-width: 35px;
        font-size: 0.75rem;
    }

    .title {
        font-size: 0.85rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.container {
    animation: fadeIn 0.4s ease-out;
}

tbody tr {
    animation: fadeIn 0.3s ease-out;
    animation-fill-mode: both;
}

tbody tr:nth-child(1) { animation-delay: 0.05s; }
tbody tr:nth-child(2) { animation-delay: 0.1s; }
tbody tr:nth-child(3) { animation-delay: 0.15s; }
tbody tr:nth-child(4) { animation-delay: 0.2s; }
tbody tr:nth-child(5) { animation-delay: 0.25s; }
tbody tr:nth-child(6) { animation-delay: 0.3s; }
tbody tr:nth-child(7) { animation-delay: 0.35s; }
tbody tr:nth-child(8) { animation-delay: 0.4s; }
tbody tr:nth-child(9) { animation-delay: 0.45s; }
tbody tr:nth-child(10) { animation-delay: 0.5s; }

/* Onboarding Styles */
.onboarding {
    text-align: center;
    padding: 2rem 0;
}

.onboarding-header {
    margin-bottom: 2.5rem;
}

.onboarding-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.onboarding-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.onboarding-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.onboarding-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    text-align: left;
}

.onboarding-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.2);
}

.onboarding-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    margin-bottom: 1.25rem;
}

.onboarding-icon.prefill-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    position: relative;
}

.onboarding-icon.prefill-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 24px;
    background: repeating-linear-gradient(
        0deg,
        white 0px,
        white 3px,
        transparent 3px,
        transparent 8px
    );
    opacity: 0.9;
}

.onboarding-icon.prompt-icon {
    background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
    position: relative;
}

.onboarding-icon.prompt-icon::after {
    content: '?';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

.onboarding-icon.fresh-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    position: relative;
}

.onboarding-icon.fresh-icon::after {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
}

.onboarding-card h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.onboarding-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.onboarding-tag {
    display: inline-block;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Mobile onboarding */
@media (max-width: 768px) {
    .onboarding {
        padding: 1rem 0;
    }

    .onboarding-header h3 {
        font-size: 1.4rem;
    }

    .onboarding-header p {
        font-size: 1rem;
    }

    .onboarding-options {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .onboarding-card {
        padding: 1.5rem 1.25rem;
    }

    .onboarding-icon {
        width: 50px;
        height: 50px;
    }

    .onboarding-card h4 {
        font-size: 1.1rem;
    }

    .onboarding-card p {
        font-size: 0.9rem;
    }
}

/* Rank Section - Left sidebar, main panel right */
.rank-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* Songs Sidebar - 15% width vertical column */
.songs-sidebar {
    width: 15%;
    min-width: 140px;
    max-width: 180px;
    flex-shrink: 0;
}

.sidebar-header {
    display: none;
}

.song-options {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.song-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.5rem;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.song-option:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.song-option.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-primary);
}

.option-rank {
    min-width: 32px;
    padding: 0.15rem 0.3rem;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-secondary);
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
    flex-shrink: 0;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

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

.option-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.option-artist {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.option-youtube {
    display: none;
}

/* Main rank prompt - takes remaining 85% */
.rank-section .rank-prompt {
    flex: 1;
    margin-bottom: 0;
    padding: 1rem 1.25rem;
    position: static;
    border: none;
    border-left: 3px solid var(--accent-primary);
    box-shadow: none;
    background: var(--bg-card);
    border-radius: 8px;
}

.rank-section .rank-prompt-header {
    margin-bottom: 0.75rem;
}

.rank-section .rank-prompt-header h3 {
    font-size: 1.1rem;
}

.rank-section .song-to-rank {
    padding: 1rem;
    border-radius: 8px;
}

.rank-section .song-info .song-title {
    font-size: 1.25rem;
}

.rank-section .song-info .song-artist {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.rank-section .rank-instructions {
    margin-top: 1rem;
    padding-top: 1rem;
}

/* Mobile Rank Section */
@media (max-width: 768px) {
    .rank-section {
        flex-direction: column;
        padding: 0.5rem;
    }

    .songs-sidebar {
        width: 100%;
        max-width: none;
    }

    .song-options {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.4rem;
        padding-bottom: 0.25rem;
    }

    .song-option {
        flex-shrink: 0;
        min-width: 120px;
        max-width: 140px;
    }

    .rank-section .rank-prompt {
        padding: 0.75rem;
    }

    .rank-section .song-info .song-title {
        font-size: 1rem;
    }

    .rank-section .song-info .song-artist {
        font-size: 0.9rem;
    }

    .rank-section .quick-rank {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}
