/* =======================================
   My Little FurBoy — main.css
   ======================================= */
:root {
    --primary: #7c3aed;
    --primary-dark: #5b21b6;
    --primary-light: #ede9fe;
    --secondary: #ec4899;
    --accent: #f97316;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg: #0f0f1a;
    --bg-2: #1a1a2e;
    --bg-3: #16213e;
    --surface: #1e1e35;
    --surface-2: #252542;
    --surface-3: #2e2e50;
    --border: rgba(255,255,255,0.08);
    --border-light: rgba(255,255,255,0.15);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --transition: 0.2s ease;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== App Layout ===== */
.app-body { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}
.sidebar-logo { padding: 1.5rem 1.25rem 1rem; border-bottom: 1px solid var(--border); }
.logo-link { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo-paw { font-size: 1.5rem; }
.logo-text { font-size: 1rem; font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.sidebar-nav { flex: 1; padding: 1rem 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; }
.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; border-radius: var(--radius-sm);
    color: var(--text-muted); text-decoration: none; font-weight: 500;
    transition: all var(--transition); position: relative;
}
.nav-item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.nav-item .badge { background: var(--danger); color: #fff; font-size: 0.65rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 999px; min-width: 18px; text-align: center; }

.sidebar-user { padding: 1rem; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 0.75rem; }
.sidebar-user-info { flex: 1; display: flex; align-items: center; gap: 0.75rem; text-decoration: none; min-width: 0; }
.sidebar-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); flex-shrink: 0; }
.sidebar-name { font-size: 0.85rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-username { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout { color: var(--text-dim); display: flex; padding: 0.4rem; border-radius: var(--radius-sm); transition: color var(--transition); }
.sidebar-logout:hover { color: var(--danger); }
.sidebar-logout svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ===== Main Content ===== */
.main-content { margin-left: var(--sidebar-width); flex: 1; padding: 2rem 1.5rem; max-width: calc(1200px + var(--sidebar-width)); min-height: 100vh; }

/* ===== Mobile Header ===== */
.mobile-header { display: none; position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-height); background: var(--surface); border-bottom: 1px solid var(--border); z-index: 99; align-items: center; justify-content: space-between; padding: 0 1rem; }
.hamburger, .mobile-msg-icon { background: none; border: none; color: var(--text); cursor: pointer; padding: 0.5rem; display: flex; align-items: center; position: relative; }
.hamburger svg, .mobile-msg-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mobile-logo { font-size: 1.1rem; font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-decoration: none; }
.badge-sm { position: absolute; top: 2px; right: 2px; background: var(--danger); color: #fff; font-size: 0.6rem; font-weight: 700; border-radius: 999px; min-width: 16px; padding: 0.05rem 0.3rem; text-align: center; }

/* ===== Overlay ===== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }

/* ===== Cards ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.55rem 1.25rem; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.875rem;
    cursor: pointer; border: none; text-decoration: none; transition: all var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { filter: brightness(0.9); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-light); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.9); }
.btn-full { width: 100%; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn-xs { padding: 0.2rem 0.6rem; font-size: 0.75rem; }
.btn-xl { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-icon { background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; padding: 0.25rem; border-radius: var(--radius-sm); }
.btn-icon:hover { color: var(--danger); background: rgba(239,68,68,0.1); }
.btn-outline-light { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.btn-outline-light:hover { background: rgba(255,255,255,0.1); }

/* ===== Forms ===== */
.form-group { margin-bottom: 1rem; }
.form-label { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.form-label-link { font-weight: 400; color: var(--primary); font-size: 0.8rem; text-decoration: none; }
.form-label-link:hover { text-decoration: underline; }
.form-input {
    width: 100%; padding: 0.65rem 0.9rem; background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); font-size: 0.9rem; font-family: var(--font);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,0.15); }
.form-input::placeholder { color: var(--text-dim); }
.form-input-sm { padding: 0.45rem 0.75rem; font-size: 0.8rem; }
.form-input-xs { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; display: block; }
.form-terms { font-size: 0.8rem; color: var(--text-muted); margin: 0.75rem 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-section { padding: 1.25rem; background: var(--bg-2); border-radius: var(--radius-sm); margin-bottom: 1rem; }
.form-section-title { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; padding-top: 1rem; }
.required { color: var(--danger); }
.input-prefix-wrap { position: relative; }
.input-prefix { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.9rem; }
.form-input.has-prefix { padding-left: 2rem; }
.input-eye-wrap { position: relative; }
.eye-toggle { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0.25rem; }
.eye-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.form-input.has-prefix { padding-left: 2rem; }
.form-check { margin: 0.5rem 0; }
.check-label { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; font-size: 0.875rem; color: var(--text-muted); }
.check-input { display: none; }
.check-custom { width: 18px; height: 18px; border: 2px solid var(--border-light); border-radius: 4px; background: var(--bg-2); flex-shrink: 0; transition: all var(--transition); position: relative; }
.check-input:checked ~ .check-custom { background: var(--primary); border-color: var(--primary); }
.check-input:checked ~ .check-custom::after { content: ''; position: absolute; left: 3px; top: 0px; width: 5px; height: 9px; border: 2px solid #fff; border-top: none; border-left: none; transform: rotate(45deg); }

/* Password strength */
.password-strength { margin-top: 0.4rem; display: flex; align-items: center; gap: 0.5rem; }
.strength-bar { flex: 1; height: 4px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.strength-fill { height: 100%; width: 0; border-radius: 2px; transition: width 0.3s, background 0.3s; }
.strength-label { font-size: 0.75rem; color: var(--text-muted); min-width: 60px; }

/* ===== Alerts ===== */
.alert { padding: 0.85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.875rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.alert-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); color: #fcd34d; }
.alert-info { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }
.alert-close { background: none; border: none; color: inherit; cursor: pointer; font-size: 1.1rem; padding: 0; line-height: 1; opacity: 0.7; flex-shrink: 0; }
.alert-close:hover { opacity: 1; }
.error-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }

/* ===== Modals ===== */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.modal-content { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-sm { max-width: 380px; }
.modal-header { padding: 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; padding: 0; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ===== Search dropdown ===== */
.search-results-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 280px; overflow-y: auto; z-index: 50; box-shadow: var(--shadow); }
.search-result-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; cursor: pointer; text-decoration: none; color: var(--text); transition: background var(--transition); }
.search-result-item:hover { background: var(--surface-3); }
.search-result-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.search-result-name { font-weight: 600; font-size: 0.875rem; }
.search-result-username { font-size: 0.75rem; color: var(--text-muted); }
.user-search-wrap { position: relative; }

/* ===== Status badges ===== */
.status-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.status-active { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.status-banned { background: rgba(239,68,68,0.2); color: #fca5a5; }
.status-suspended { background: rgba(245,158,11,0.2); color: #fcd34d; }
.status-pending { background: rgba(59,130,246,0.2); color: #93c5fd; }
.status-resolved { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.status-dismissed { background: rgba(100,116,139,0.2); color: #94a3b8; }
.status-inactive { background: rgba(100,116,139,0.2); color: #94a3b8; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; gap: 0.5rem; padding: 1rem; flex-wrap: wrap; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); text-decoration: none; font-size: 0.875rem; transition: all var(--transition); }
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Link ===== */
.link { color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ===== Profile page ===== */
.profile-page { max-width: 700px; margin: 0 auto; }
.profile-cover { height: 220px; border-radius: var(--radius-lg); overflow: hidden; position: relative; margin-bottom: -60px; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.cover-img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, var(--primary-dark), var(--secondary)); }
.profile-header { padding: 1.5rem; padding-top: 70px; display: flex; gap: 1.25rem; align-items: flex-end; flex-wrap: wrap; }
.profile-avatar-wrap { position: absolute; top: -54px; }
.profile-header { position: relative; }
.profile-avatar { width: 108px; height: 108px; border-radius: 50%; object-fit: cover; border: 4px solid var(--surface); position: absolute; top: -54px; left: 1.5rem; }
.profile-info { flex: 1; padding-left: calc(108px + 1.5rem + 1rem); min-width: 0; }
.profile-names { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.profile-display-name { font-size: 1.4rem; font-weight: 800; }
.profile-username { color: var(--text-muted); font-size: 0.95rem; }
.profile-bio { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.profile-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.profile-meta a { color: var(--primary); text-decoration: none; }
.profile-fursona { margin-top: 0.4rem; }
.fursona-badge { display: inline-block; background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(236,72,153,0.2)); border: 1px solid rgba(124,58,237,0.3); padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.8rem; color: var(--text-muted); }
.profile-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; padding-bottom: 0.25rem; }
.profile-stats { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; background: var(--surface); }
.stat-item { flex: 1; text-align: center; padding: 1rem; text-decoration: none; color: var(--text); transition: background var(--transition); border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: none; }
.stat-item:hover { background: var(--surface-2); }
.stat-value { display: block; font-size: 1.4rem; font-weight: 800; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }
.profile-posts { display: flex; flex-direction: column; gap: 1rem; }

/* ===== Edit Profile ===== */
.profile-edit-card { max-width: 700px; margin: 0 auto; }
.edit-avatars { position: relative; margin-bottom: 1rem; }
.edit-cover-wrap { height: 160px; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.edit-cover-preview { width: 100%; height: 100%; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; position: relative; }
.edit-cover-btn { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.4); color: #fff; font-size: 1.5rem; cursor: pointer; opacity: 0; transition: opacity var(--transition); }
.edit-cover-preview:hover .edit-cover-btn { opacity: 1; }
.edit-avatar-wrap { position: absolute; left: 1.5rem; bottom: -36px; }
.edit-avatar-img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); }
.edit-avatar-btn { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.4); color: #fff; font-size: 1rem; border-radius: 50%; cursor: pointer; opacity: 0; transition: opacity var(--transition); }
.edit-avatar-wrap:hover .edit-avatar-btn { opacity: 1; }

/* ===== Feed layout ===== */
.feed-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; max-width: 1000px; margin: 0 auto; }
.feed-main { display: flex; flex-direction: column; gap: 1rem; }
.feed-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.sidebar-card { }
.sidebar-section-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.sidebar-profile { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.sidebar-profile-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.sidebar-profile-info { display: flex; flex-direction: column; }
.sidebar-profile-info strong { font-size: 0.875rem; }
.sidebar-profile-info span { font-size: 0.75rem; color: var(--text-muted); }

/* ===== Post composer ===== */
.post-composer { }
.composer-header { display: flex; align-items: center; gap: 1rem; }
.composer-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); flex-shrink: 0; }
.composer-trigger { flex: 1; padding: 0.75rem 1rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); text-align: left; cursor: pointer; font-size: 0.9rem; transition: border-color var(--transition); font-family: var(--font); }
.composer-trigger:hover { border-color: var(--primary); }
.composer-form { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.composer-textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 0.75rem; font-family: var(--font); font-size: 0.9rem; resize: vertical; min-height: 80px; }
.composer-textarea:focus { outline: none; border-color: var(--primary); }
.composer-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.75rem; }
.composer-actions { display: flex; align-items: center; gap: 0.5rem; }
.composer-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0.4rem; border-radius: var(--radius-sm); display: flex; transition: color var(--transition); }
.composer-btn:hover { color: var(--primary); }
.composer-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.char-counter { font-size: 0.75rem; color: var(--text-dim); }
.composer-preview { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.composer-preview-item { position: relative; width: 80px; height: 80px; border-radius: var(--radius-sm); overflow: hidden; }
.composer-preview-item img, .composer-preview-item video { width: 100%; height: 100%; object-fit: cover; }
.composer-preview-remove { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.7); color: #fff; border: none; cursor: pointer; border-radius: 50%; width: 18px; height: 18px; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; }

/* ===== Post card ===== */
.post-card { }
.post-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.75rem; }
.post-author-link { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; flex: 1; min-width: 0; }
.post-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); flex-shrink: 0; }
.post-author-info { display: flex; flex-direction: column; }
.post-display-name { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.post-username { font-size: 0.78rem; color: var(--text-muted); }
.post-time { font-size: 0.75rem; color: var(--text-dim); }
.post-content { font-size: 0.9rem; line-height: 1.65; margin-bottom: 0.75rem; word-break: break-word; }
.post-content a { color: var(--primary); }
.post-menu { position: relative; }
.post-menu-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 0.35rem; border-radius: var(--radius-sm); transition: all var(--transition); }
.post-menu-btn:hover { background: var(--surface-2); color: var(--text); }
.post-menu-btn svg { width: 18px; height: 18px; fill: currentColor; }
.post-menu-dropdown { position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 140px; box-shadow: var(--shadow); z-index: 10; display: none; }
.post-menu.open .post-menu-dropdown { display: block; }
.post-menu-item { display: block; width: 100%; text-align: left; padding: 0.65rem 1rem; background: none; border: none; color: var(--text); cursor: pointer; font-size: 0.875rem; transition: background var(--transition); white-space: nowrap; }
.post-menu-item:hover { background: var(--surface-3); }
.post-menu-item.danger { color: var(--danger); }
.post-menu-item form { margin: 0; }
.delete-form { margin: 0; }

/* Post media */
.post-media { display: grid; gap: 4px; border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 0.75rem; }
.post-media.media-count-1 { grid-template-columns: 1fr; }
.post-media.media-count-2 { grid-template-columns: 1fr 1fr; }
.post-media.media-count-3 { grid-template-columns: 1fr 1fr; }
.post-media.media-count-3 .media-item:first-child { grid-column: 1 / -1; }
.post-media.media-count-4 { grid-template-columns: 1fr 1fr; }
.media-item { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-3); }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; }
.media-item video { width: 100%; max-height: 400px; object-fit: contain; background: #000; }

/* Post actions */
.post-actions { display: flex; gap: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.post-action-btn { display: flex; align-items: center; gap: 0.4rem; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.875rem; padding: 0.3rem 0.5rem; border-radius: var(--radius-sm); transition: all var(--transition); text-decoration: none; font-family: var(--font); }
.post-action-btn:hover { background: var(--surface-2); color: var(--text); }
.post-action-btn.liked { color: var(--secondary); }
.post-action-btn.liked svg { fill: var(--secondary); }
.post-action-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.post-view-header { margin-bottom: 1rem; }

/* Comments */
.comments-section { padding-top: 0.75rem; border-top: 1px solid var(--border); margin-top: 0.25rem; }
.comments-full-section { margin-top: 1rem; }
.comments-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.comment-form { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 1rem; }
.comment-form-full { padding: 1rem; background: var(--bg-2); border-radius: var(--radius-sm); }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-input-wrap { flex: 1; display: flex; gap: 0.5rem; }
.comment-input { border-radius: 999px; }
.comment-item { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; }
.comment-body { flex: 1; background: var(--bg-2); padding: 0.65rem 0.85rem; border-radius: var(--radius-sm); }
.comment-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; flex-wrap: wrap; }
.comment-author { font-weight: 700; font-size: 0.85rem; color: var(--text); text-decoration: none; }
.comment-author:hover { color: var(--primary); }
.comment-time { font-size: 0.72rem; color: var(--text-dim); }
.comment-content { font-size: 0.875rem; color: var(--text-muted); }
.empty-comments { text-align: center; color: var(--text-muted); padding: 2rem; font-size: 0.9rem; }
.empty-feed { text-align: center; padding: 3rem 1rem; }
.empty-feed .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-feed h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.empty-feed p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.9rem; }
.comments-list.full { display: flex; flex-direction: column; }
.load-more-wrap { margin-top: 0.5rem; }

/* ===== Messages ===== */
.messages-layout { display: flex; height: calc(100vh - 4rem); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; max-width: 900px; margin: 0 auto; }
.messages-sidebar { width: 320px; flex-shrink: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.messages-sidebar-header { padding: 1rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.messages-sidebar-header h2 { font-size: 1rem; font-weight: 700; }
.conv-search-wrap { padding: 0.75rem; border-bottom: 1px solid var(--border); }
.conversations-list { flex: 1; overflow-y: auto; }
.conv-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; text-decoration: none; color: var(--text); transition: background var(--transition); border-bottom: 1px solid var(--border); }
.conv-item:hover { background: var(--surface-2); }
.conv-item.active { background: var(--primary-light); }
.conv-avatar-wrap { position: relative; flex-shrink: 0; }
.conv-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.online-dot { position: absolute; bottom: 1px; right: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--success); border: 2px solid var(--surface); }
.conv-info { flex: 1; min-width: 0; }
.conv-name-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.25rem; }
.conv-name { font-weight: 600; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 0.72rem; color: var(--text-dim); flex-shrink: 0; }
.conv-preview-row { display: flex; justify-content: space-between; align-items: center; gap: 0.25rem; }
.conv-preview { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.has-unread .conv-preview, .has-unread .conv-name { color: var(--text); font-weight: 700; }
.unread-badge { background: var(--primary); color: #fff; font-size: 0.65rem; font-weight: 700; border-radius: 999px; min-width: 18px; padding: 0.1rem 0.4rem; text-align: center; flex-shrink: 0; }
.empty-conv { text-align: center; padding: 2rem 1rem; color: var(--text-muted); font-size: 0.875rem; }
.messages-main { flex: 1; display: flex; flex-direction: column; }
.messages-empty-state { align-items: center; justify-content: center; }
.messages-empty { text-align: center; padding: 2rem; }
.messages-empty .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.messages-empty h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.messages-empty p { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1rem; }

/* Chat */
.chat-header { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.75rem; }
.chat-back { display: none; }
.chat-user-info { flex: 1; display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--text); }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-user-name { font-weight: 700; font-size: 0.9rem; }
.chat-user-sub { font-size: 0.75rem; color: var(--text-muted); }
.chat-actions { display: flex; gap: 0.5rem; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.chat-start { text-align: center; padding: 1rem; color: var(--text-muted); font-size: 0.875rem; }
.chat-start-avatar img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-bottom: 0.75rem; }
.chat-date-divider { text-align: center; margin: 0.75rem 0; }
.chat-date-divider span { background: var(--surface-2); padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.72rem; color: var(--text-dim); }
.chat-msg { display: flex; align-items: flex-end; gap: 0.5rem; max-width: 75%; }
.chat-msg.sent { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.received { align-self: flex-start; }
.msg-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.msg-bubble { padding: 0.6rem 0.85rem; border-radius: var(--radius-lg); max-width: 100%; }
.sent .msg-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.received .msg-bubble { background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; }
.msg-text { font-size: 0.875rem; word-break: break-word; }
.msg-time { font-size: 0.65rem; opacity: 0.65; margin-top: 0.2rem; display: block; text-align: right; }
.msg-status { font-size: 0.65rem; opacity: 0.65; }
.msg-img { max-width: 220px; border-radius: var(--radius-sm); display: block; margin-bottom: 0.3rem; cursor: pointer; }
.msg-file { display: flex; align-items: center; gap: 0.4rem; color: inherit; text-decoration: none; font-size: 0.825rem; }
.chat-input-area { padding: 0.85rem; border-top: 1px solid var(--border); }
.chat-form { display: flex; align-items: flex-end; gap: 0.6rem; }
.chat-attach-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0.5rem; display: flex; flex-shrink: 0; }
.chat-attach-btn:hover { color: var(--primary); }
.chat-attach-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.chat-input-wrap { flex: 1; }
.chat-textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); padding: 0.6rem 1rem; font-family: var(--font); font-size: 0.875rem; resize: none; max-height: 120px; overflow-y: auto; }
.chat-textarea:focus { outline: none; border-color: var(--primary); }
.chat-send-btn { background: var(--primary); border: none; color: #fff; cursor: pointer; padding: 0.6rem; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--transition); }
.chat-send-btn:hover { background: var(--primary-dark); }
.chat-send-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.chat-file-preview { background: var(--bg-2); border-radius: var(--radius-sm); padding: 0.5rem; margin-bottom: 0.5rem; display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); }
.messages-sidebar-mobile-hidden { }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }
    .mobile-header { display: flex; }
    .main-content { margin-left: 0; padding-top: calc(var(--topbar-height) + 1rem); }
    .feed-layout { grid-template-columns: 1fr; }
    .feed-sidebar { display: none; }
    .profile-info { padding-left: 0; padding-top: calc(54px + 0.5rem); }
    .profile-header { flex-direction: column; align-items: flex-start; }
    .profile-actions { width: 100%; }
    .form-row { grid-template-columns: 1fr; }
    .messages-layout { height: calc(100vh - var(--topbar-height) - 1rem); border-radius: var(--radius); }
    .messages-sidebar { width: 280px; }
}
@media (max-width: 640px) {
    .messages-sidebar { display: none; }
    .messages-sidebar.show-mobile { display: flex; width: 100%; }
    .chat-back { display: flex; }
    .chat-active .messages-sidebar { display: none; }
    .main-content { padding: calc(var(--topbar-height) + 0.75rem) 0.75rem 1rem; }
    .post-media.media-count-3, .post-media.media-count-4 { grid-template-columns: 1fr; }
}


