/* ==========================================================
   MusixBarn Social - Global Stylesheet
   Black + red (204,0,0) theme, matches MusixBarn brand
   ========================================================== */

:root {
    --bg-primary: rgb(0, 0, 0);
    --bg-secondary: rgb(15, 15, 15);
    --bg-card: rgb(20, 20, 20);
    --bg-hover: rgb(28, 28, 28);
    --accent: rgb(204, 0, 0);
    --accent-hover: rgb(255, 30, 30);
    --accent-soft: rgba(204, 0, 0, 0.15);
    --accent-glow: rgba(204, 0, 0, 0.4);
    --text-primary: rgb(255, 255, 255);
    --text-secondary: rgb(180, 180, 180);
    --text-muted: rgb(120, 120, 120);
    --border: rgb(40, 40, 40);
    --border-light: rgb(55, 55, 55);
    --success: rgb(46, 160, 67);
    --warn: rgb(234, 179, 8);
    --danger: rgb(239, 68, 68);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    --shadow-accent: 0 4px 20px var(--accent-glow);
    --nav-height: 60px;
    --max-width: 1200px;
}

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

html, body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

/* ============ NAV ============ */
.nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
}
.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
    height: 100%; gap: 16px;
}
.nav-brand {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-primary); font-weight: 700; font-size: 18px;
    letter-spacing: 0.3px;
}
.nav-brand img { height: 32px; width: auto; }
.nav-search { flex: 1; max-width: 420px; position: relative; }
.nav-search input {
    width: 100%; background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 14px 8px 36px; border-radius: 999px;
    font-size: 14px; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.nav-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.nav-search .fa-search {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 13px;
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
    color: var(--text-secondary); padding: 8px 12px;
    border-radius: var(--radius-sm); font-size: 14px;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }
.nav-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--bg-card); border: 1px solid var(--border);
    overflow: hidden; cursor: pointer;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============ LAYOUT ============ */
.container { max-width: var(--max-width); margin: 0 auto; padding: 20px; }
.container-narrow { max-width: 640px; margin: 0 auto; padding: 20px; }
.container-wide { max-width: 1440px; margin: 0 auto; padding: 20px; }

.page-grid {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    gap: 24px;
    max-width: var(--max-width);
    margin: 0 auto; padding: 20px;
}
@media (max-width: 1024px) {
    .page-grid { grid-template-columns: 1fr 300px; }
    .page-grid .sidebar-left { display: none; }
}
@media (max-width: 768px) {
    .page-grid { grid-template-columns: 1fr; }
    .page-grid .sidebar-right { display: none; }
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 10px 18px;
    border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all .15s;
    text-decoration: none; font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; box-shadow: var(--shadow-accent); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text-primary); border: 1px solid var(--border-light); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ CARDS ============ */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card-hover:hover { border-color: var(--border-light); }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block; font-size: 13px; font-weight: 500;
    color: var(--text-secondary); margin-bottom: 6px;
}
.form-control {
    width: 100%; background: var(--bg-secondary);
    border: 1px solid var(--border); color: var(--text-primary);
    padding: 10px 14px; border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 13px; color: var(--danger); margin-top: 6px; }

.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 14px; margin-bottom: 16px;
    display: flex; gap: 10px; align-items: flex-start;
}
.alert-success { background: rgba(46,160,67,.12); border: 1px solid rgba(46,160,67,.3); color: #85e096; }
.alert-error   { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #ff9999; }
.alert-warn    { background: rgba(234,179,8,.12); border: 1px solid rgba(234,179,8,.3); color: #ffd966; }
.alert-info    { background: rgba(204,0,0,.08); border: 1px solid rgba(204,0,0,.3); color: #ff6666; }

/* ============ AVATARS + BADGES ============ */
.avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--bg-secondary); border: 1px solid var(--border);
    overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 120px; height: 120px; border-width: 3px; }

.badge-verified {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; background: var(--accent);
    border-radius: 50%; color: #fff; font-size: 9px;
    margin-left: 4px; vertical-align: middle;
}
.badge {
    display: inline-block; padding: 2px 8px;
    font-size: 11px; font-weight: 600;
    border-radius: 999px; text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-artist { background: var(--accent-soft); color: var(--accent); }
.badge-new    { background: rgba(46,160,67,.2); color: #85e096; }

/* ============ ARTIST PROFILE HEADER (FB/Twitter style) ============ */
.profile-header { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.profile-cover {
    height: 280px; background: linear-gradient(135deg, #1a0000, #000);
    background-size: cover; background-position: center;
    position: relative;
}
@media (max-width: 768px) { .profile-cover { height: 180px; } }
.profile-info { padding: 0 24px 20px; position: relative; }
.profile-avatar-wrap {
    margin-top: -60px; margin-bottom: 12px;
    display: flex; align-items: flex-end; gap: 16px; justify-content: space-between;
}
.profile-avatar {
    width: 120px; height: 120px; border-radius: 50%;
    border: 4px solid var(--bg-primary); background: var(--bg-secondary);
    overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-actions { display: flex; gap: 8px; padding-bottom: 8px; }
.profile-name { font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.profile-handle { color: var(--text-muted); font-size: 14px; margin-bottom: 8px; }
.profile-bio { color: var(--text-secondary); font-size: 14px; margin: 10px 0; white-space: pre-line; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-muted); font-size: 13px; margin-top: 10px; }
.profile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.profile-stats { display: flex; gap: 24px; margin-top: 12px; font-size: 14px; }
.profile-stats strong { color: var(--text-primary); font-weight: 700; }
.profile-tabs {
    display: flex; gap: 0; border-top: 1px solid var(--border); margin-top: 16px;
}
.profile-tab {
    flex: 1; padding: 14px; text-align: center;
    color: var(--text-secondary); font-weight: 600; font-size: 14px;
    border-bottom: 2px solid transparent; cursor: pointer;
    transition: color .15s, border-color .15s;
}
.profile-tab:hover { color: var(--text-primary); }
.profile-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ============ COMPACT MUSIC PLAYER ROW ============
   Format: [play] Title ·························· 3:42 $0.99 [cart]
   Progress bar IS the dotted line (fills in as playing)
   ============================================================ */
.music-list { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.music-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    cursor: default; transition: background .1s;
}
.music-row:last-child { border-bottom: none; }
.music-row:hover { background: var(--bg-hover); }
.music-row.playing { background: var(--bg-hover); }

.music-play-btn {
    width: 36px; height: 36px; flex-shrink: 0;
    border-radius: 50%; background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary); font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .15s;
}
.music-play-btn:hover { background: var(--accent); border-color: var(--accent); }
.music-row.playing .music-play-btn { background: var(--accent); border-color: var(--accent); }

.music-title {
    font-size: 14px; font-weight: 500; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex-shrink: 0; max-width: 40%;
}
.music-row.playing .music-title { color: var(--accent); }

/* The progress line — fills as song plays */
.music-progress {
    flex: 1; height: 3px;
    background: linear-gradient(to right,
        var(--accent) 0%, var(--accent) var(--progress, 0%),
        var(--border-light) var(--progress, 0%), var(--border-light) 100%);
    border-radius: 2px; cursor: pointer; min-width: 40px;
    position: relative;
    background-image: repeating-linear-gradient(
        to right,
        var(--border-light) 0,
        var(--border-light) 3px,
        transparent 3px,
        transparent 6px);
}
.music-row.playing .music-progress {
    background: linear-gradient(to right,
        var(--accent) 0%, var(--accent) var(--progress, 0%),
        rgba(255,255,255,0.12) var(--progress, 0%), rgba(255,255,255,0.12) 100%);
}

.music-duration { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.music-row.playing .music-duration { color: var(--accent); }
.music-price { font-size: 13px; font-weight: 600; color: var(--text-primary); min-width: 48px; text-align: right; }
.music-cart-btn {
    width: 32px; height: 32px; border-radius: 50%;
    background: transparent; border: 1px solid var(--border);
    color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; transition: all .15s;
}
.music-cart-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.music-cart-btn.in-cart { background: var(--success); border-color: var(--success); color: #fff; }

.music-watermark-note { font-size: 11px; color: var(--warn); margin-left: 8px; }

/* ============ POSTS / FEED ============ */
.post {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.post-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.post-author { flex: 1; min-width: 0; }
.post-author-name { font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.post-meta { font-size: 12px; color: var(--text-muted); }
.post-body { font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; margin-bottom: 12px; }
.post-image { border-radius: var(--radius-sm); margin-bottom: 12px; max-height: 500px; width: 100%; object-fit: cover; }
.post-video { width: 100%; border-radius: var(--radius-sm); margin-bottom: 12px; }
.post-link-preview {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px; margin-bottom: 12px; display: flex; gap: 12px;
}
.post-link-preview img { width: 80px; height: 80px; border-radius: var(--radius-sm); object-fit: cover; }
.post-actions { display: flex; gap: 4px; border-top: 1px solid var(--border); padding-top: 10px; }
.post-action {
    flex: 1; background: transparent; border: none;
    color: var(--text-secondary); font-size: 13px;
    padding: 8px; border-radius: var(--radius-sm);
    cursor: pointer; display: inline-flex; align-items: center;
    justify-content: center; gap: 6px; font-family: inherit;
    transition: background .1s, color .1s;
}
.post-action:hover { background: var(--bg-hover); color: var(--text-primary); }
.post-action.liked { color: var(--accent); }

/* ============ COMPOSER ============ */
.composer { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.composer-input {
    width: 100%; background: var(--bg-secondary);
    border: 1px solid var(--border); color: var(--text-primary);
    padding: 12px; border-radius: var(--radius-sm);
    font-size: 14px; resize: none; outline: none; min-height: 80px;
    font-family: inherit;
}
.composer-input:focus { border-color: var(--accent); }
.composer-tools { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 8px; flex-wrap: wrap; }
.composer-icons { display: flex; gap: 4px; }
.composer-icon {
    width: 36px; height: 36px; border-radius: 50%;
    background: transparent; border: none;
    color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; transition: background .1s, color .1s;
}
.composer-icon:hover { background: var(--bg-hover); color: var(--accent); }

/* ============ AUTH PAGES ============ */
.auth-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 50% 30%, rgba(204,0,0,0.1), var(--bg-primary) 70%);
}
.auth-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 32px;
    width: 100%; max-width: 420px; box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo img { height: 48px; margin: 0 auto; }
.auth-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.auth-sub { color: var(--text-muted); font-size: 14px; text-align: center; margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 13px; }

/* ============ UTIL ============ */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.flex { display: flex; } .flex-1 { flex: 1; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.spinner {
    display: inline-block; width: 18px; height: 18px;
    border: 2px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

