/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #1a1a1a;
  --bg-card: #222222;
  --bg-elevated: #2a2a2a;
  --bg-input: #1a1a1a;
  --border: #333333;
  --border-focus: #666666;
  --text-primary: #f0f0f0;
  --text-secondary: #999999;
  --text-muted: #666666;
  --accent: #888888;
  --accent-hover: #aaaaaa;
  --danger: #cc3333;
  --success: #33aa55;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; }
.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* --- Navbar --- */
.navbar { background: rgba(26,26,26,0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.navbar .container { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; }
.logo { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); text-decoration: none; letter-spacing: -0.3px; transition: color var(--transition); }
.logo:hover { color: var(--accent-hover); }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-weight: 500; transition: color var(--transition); position: relative; font-size: 0.9rem; }
.nav-links a::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 1px; background: var(--accent-hover); transition: width var(--transition); }
.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }
.user-name { color: var(--text-muted); font-size: 0.85rem; }

/* --- Feed Layout --- */
.feed-layout { display: grid; grid-template-columns: 1fr 300px; gap: 25px; padding: 25px 0; }
.create-post { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--border); margin-bottom: 20px; animation: fadeIn 0.4s ease-out; }
.create-post h2 { font-size: 1.05rem; margin-bottom: 12px; color: var(--text-primary); }
.create-post textarea { width: 100%; height: 80px; padding: 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.9rem; resize: vertical; margin-bottom: 12px; font-family: inherit; transition: border var(--transition); }
.create-post textarea:focus { outline: none; border-color: var(--border-focus); }

/* --- Post Card --- */
.post-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--border); margin-bottom: 16px; animation: fadeIn 0.4s ease-out; transition: all var(--transition); }
.post-card:hover { border-color: var(--border-focus); }
.post-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--bg-elevated); border: 1px solid var(--border); }
.avatar-lg { width: 80px; height: 80px; border-radius: 50%; background: var(--bg-elevated); border: 1px solid var(--border); margin-bottom: 15px; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-elevated); border: 1px solid var(--border); }
.avatar-xs { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-elevated); border: 1px solid var(--border); }
.post-meta { display: flex; flex-direction: column; }
.post-author { font-weight: 600; color: var(--text-primary); text-decoration: none; transition: color var(--transition); }
.post-author:hover { color: var(--accent-hover); }
.post-date { font-size: 0.78rem; color: var(--text-muted); }
.post-content p { font-size: 0.95rem; line-height: 1.6; margin-bottom: 12px; }
.post-actions { display: flex; gap: 15px; align-items: center; border-top: 1px solid var(--border); padding-top: 12px; }
.action-form { margin: 0; }
.action-btn { background: var(--bg-input); border: 1px solid var(--border); padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 0.82rem; color: var(--text-secondary); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; transition: all var(--transition); }
.action-btn:hover { background: var(--bg-elevated); border-color: var(--border-focus); color: var(--text-primary); }
.action-btn.liked { color: var(--danger); border-color: var(--danger); background: rgba(204,51,51,0.1); }

/* --- Sidebar --- */
.sidebar { position: sticky; top: 80px; align-self: start; }
.suggestions-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--border); animation: fadeIn 0.5s ease-out; }
.suggestions-card h3 { font-size: 0.95rem; margin-bottom: 14px; color: var(--text-primary); }
.suggestion-item { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.suggestion-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.suggestion-info { flex: 1; }
.suggestion-info a { color: var(--text-primary); text-decoration: none; font-weight: 500; font-size: 0.88rem; transition: color var(--transition); }
.suggestion-info a:hover { color: var(--accent-hover); }
.btn-sm { padding: 5px 14px; font-size: 0.78rem; }

/* --- Buttons --- */
.btn { display: inline-block; padding: 10px 24px; background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 0.9rem; text-decoration: none; transition: all var(--transition); font-weight: 500; }
.btn:hover { background: #333; border-color: var(--border-focus); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.btn-primary { background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary); }
.btn-primary:hover { background: #fff; border-color: #fff; box-shadow: 0 4px 20px rgba(255,255,255,0.12); }
.btn-full { width: 100%; }

/* --- Auth --- */
.auth-container { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 56px); padding: 20px; background: radial-gradient(ellipse at 50% 0%, #1a1a1a 0%, var(--bg-primary) 70%); }
.auth-card { background: var(--bg-card); padding: 40px; border-radius: var(--radius-lg); border: 1px solid var(--border); width: 100%; max-width: 420px; text-align: center; animation: slideUp 0.5s ease-out; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.auth-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.auth-card h1 { margin-bottom: 25px; text-align: center; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.5px; }
.auth-link { text-align: center; margin-top: 18px; color: var(--text-muted); font-size: 0.9rem; }
.auth-link a { color: var(--accent-hover); text-decoration: none; transition: color var(--transition); }
.auth-link a:hover { color: var(--text-primary); text-decoration: underline; }
.demo-credentials { font-size: 0.82rem; color: var(--text-muted); font-family: 'SF Mono', 'Fira Code', monospace; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; color: var(--text-secondary); font-size: 0.85rem; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.9rem; transition: all var(--transition); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(136,136,136,0.1); }
.form-group textarea { height: 80px; resize: vertical; }
.alert { padding: 12px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 0.9rem; }
.alert.error { background: rgba(204,51,51,0.1); color: #ff6666; border: 1px solid rgba(204,51,51,0.3); }

/* --- Profile --- */
.profile-header { background: var(--bg-card); border-radius: var(--radius-lg); padding: 30px; border: 1px solid var(--border); margin: 25px 0; text-align: center; animation: fadeIn 0.5s ease-out; }
.profile-info { margin-bottom: 20px; }
.profile-info h1 { margin-bottom: 8px; }
.bio { color: var(--text-secondary); margin-bottom: 15px; }
.profile-stats { display: flex; justify-content: center; gap: 30px; margin-bottom: 18px; }
.profile-stats span { color: var(--text-muted); font-size: 0.9rem; }
.profile-stats strong { color: var(--text-primary); }
.profile-edit { max-width: 400px; margin: 0 auto; text-align: left; }
.profile-edit h3 { text-align: center; margin-bottom: 15px; }
.profile-posts { margin-top: 10px; }
.profile-posts h2 { margin-bottom: 16px; font-size: 1.1rem; }
.post-detail { padding: 25px 0; max-width: 680px; margin: 0 auto; }

/* --- Comments --- */
.comments-section { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--border); margin-top: 20px; }
.comments-section h3 { font-size: 1rem; margin-bottom: 16px; color: var(--text-primary); }
.comment-form textarea { width: 100%; height: 60px; padding: 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.9rem; resize: vertical; margin-bottom: 10px; font-family: inherit; transition: border var(--transition); }
.comment-form textarea:focus { outline: none; border-color: var(--border-focus); }
.comments-list { margin-top: 18px; }
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment-body { flex: 1; background: var(--bg-input); padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); }
.comment-author { font-weight: 600; color: var(--text-primary); text-decoration: none; font-size: 0.88rem; transition: color var(--transition); }
.comment-author:hover { color: var(--accent-hover); }
.comment-body p { font-size: 0.9rem; margin: 4px 0; color: var(--text-secondary); }
.comment-date { font-size: 0.72rem; color: var(--text-muted); }
.text-muted { color: var(--text-muted); font-size: 0.88rem; }
.empty-state { text-align: center; padding: 40px 0; color: var(--text-muted); }
.empty-state p { font-size: 1rem; }

/* --- Footer --- */
.footer { background: #0a0a0a; color: var(--text-muted); text-align: center; padding: 25px 0; margin-top: auto; border-top: 1px solid var(--border); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-focus); }

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

/* --- Responsive --- */
@media (max-width: 768px) {
  .feed-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .navbar .container { flex-direction: column; gap: 10px; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  .profile-stats { flex-wrap: wrap; gap: 15px; }
}
