/* ============================================================
   NewsTrp Design System — css/style.css
   Primary: #0079FF | Secondary: #FF0060
   Solid colors only — no gradients
   Fonts: Inter (body) + Outfit (headings)
   ============================================================ */

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

/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  /* Brand Colors — Solid Only */
  --primary:          #0079FF;
  --primary-dark:     #005FCC;
  --primary-light:    #E8F3FF;
  --secondary:        #FF0060;
  --secondary-dark:   #CC004D;
  --secondary-light:  #FFE0EC;

  /* Neutral Palette */
  --surface:          #FFFFFF;
  --surface-2:        #F8F9FB;
  --background:       #F2F4F7;
  --border:           #E5E7EB;
  --border-focus:     #0079FF;

  /* Text */
  --text-main:        #0F172A;
  --text-secondary:   #334155;
  --text-muted:       #64748B;
  --text-disabled:    #94A3B8;
  --text-inverse:     #FFFFFF;

  /* Semantic Colors */
  --success:          #10B981;
  --success-light:    #D1FAE5;
  --warning:          #F59E0B;
  --warning-light:    #FEF3C7;
  --error:            #EF4444;
  --error-light:      #FEE2E2;
  --info:             #3B82F6;
  --info-light:       #DBEAFE;

  /* Verification Badge Colors */
  --badge-user:       #0079FF;
  --badge-journalist: #8B5CF6;
  --badge-org:        #10B981;
  --badge-business:   #F59E0B;
  --badge-govt:       #EF4444;

  /* Category Colors */
  --cat-tech:         #3B82F6;
  --cat-ai:           #8B5CF6;
  --cat-business:     #10B981;
  --cat-politics:     #EF4444;
  --cat-sports:       #F59E0B;
  --cat-health:       #EC4899;
  --cat-science:      #06B6D4;
  --cat-entertainment:#F97316;

  /* Spacing Scale */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   20px;
  --space-6:   24px;
  --space-8:   32px;
  --space-10:  40px;
  --space-12:  48px;
  --space-16:  64px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows (solid, no blur excess) */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow:    0 2px 8px rgba(0,0,0,0.10);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);

  /* Typography */
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono:    'Fira Code', 'Courier New', monospace;

  /* Font Sizes */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */

  /* Transitions */
  --transition:      150ms ease;
  --transition-slow: 300ms ease;

  /* Layout */
  --header-height:   60px;
  --sidebar-width:   260px;
  --sidebar-right-w: 320px;
  --max-content:     680px;
  --max-page:        1280px;
}

/* ============================================================
   DARK MODE
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --surface:          #1E2028;
    --surface-2:        #252830;
    --background:       #16181E;
    --border:           #2E3040;
    --text-main:        #F1F5F9;
    --text-secondary:   #CBD5E1;
    --text-muted:       #94A3B8;
    --text-disabled:    #475569;
    --primary-light:    #0F2A4A;
    --secondary-light:  #3A0018;
    --success-light:    #052E1C;
    --error-light:      #2D0A0A;
  }
}

/* ============================================================
   CSS RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-main);
  background-color: var(--background);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--primary-dark); }

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

button { cursor: pointer; font-family: var(--font-body); }

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
}

ul, ol { list-style: none; }

/* ============================================================
   SCROLLBAR STYLE
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   LAYOUT SYSTEM
   ============================================================ */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-right-w);
  grid-template-areas: "sidebar-left main sidebar-right";
  max-width: var(--max-page);
  margin: 0 auto;
  width: 100%;
  padding: var(--space-4);
  gap: var(--space-6);
  padding-top: calc(var(--header-height) + var(--space-4));
}

.sidebar-left {
  grid-area: sidebar-left;
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
  height: fit-content;
  max-height: calc(100vh - var(--header-height) - var(--space-8));
  overflow-y: auto;
}

.main-content {
  grid-area: main;
  min-width: 0;
}

.sidebar-right {
  grid-area: sidebar-right;
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
  height: fit-content;
  max-height: calc(100vh - var(--header-height) - var(--space-8));
  overflow-y: auto;
}

.feed-container {
  max-width: var(--max-content);
  width: 100%;
  margin: 0 auto;
}

.container {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 var(--space-4);
  width: 100%;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  gap: var(--space-4);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-page);
  margin: 0 auto;
  gap: var(--space-4);
}

.brand-logo {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.5px;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity var(--transition);
}

.brand-logo:hover { opacity: 0.85; color: var(--primary); }

.header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: var(--space-2) var(--space-4) var(--space-2) 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-main);
  font-size: var(--text-sm);
  transition: border-color var(--transition), background var(--transition);
}

.header-search input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  transition: background var(--transition), color var(--transition);
  position: relative;
  text-decoration: none;
}

.header-icon-btn:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.header-icon-btn .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--secondary);
  border-radius: 50%;
  border: 2px solid var(--surface);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.8; }
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  border: 2px solid var(--border);
}

.avatar-md {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  border: 2px solid var(--border);
}

.avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  border: 3px solid var(--surface);
}

.avatar-xl {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  border: 4px solid var(--surface);
}

/* ============================================================
   CATEGORY BAR
   ============================================================ */
.category-bar {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  background: var(--surface);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border);
  gap: var(--space-1);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-bar::-webkit-scrollbar { display: none; }

.category-item {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  border: 2px solid transparent;
  flex-shrink: 0;
}

.category-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.category-item.active {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}

/* ============================================================
   FEED TABS
   ============================================================ */
.feed-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  margin-bottom: 0;
}

.feed-tab {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -2px;
}

.feed-tab:hover { color: var(--primary); }

.feed-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--text-inverse);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--text-inverse);
  border-color: var(--secondary);
}

.btn-secondary:hover {
  background: var(--secondary-dark);
  border-color: var(--secondary-dark);
  color: var(--text-inverse);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-inverse);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text-main);
}

.btn-danger {
  background: var(--error);
  color: var(--text-inverse);
  border-color: var(--error);
}

.btn-success {
  background: var(--success);
  color: var(--text-inverse);
  border-color: var(--success);
}

.btn-sm { padding: 6px 14px; font-size: var(--text-xs); }
.btn-lg { padding: 14px 28px; font-size: var(--text-base); }
.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius);
}

/* ============================================================
   FOLLOW / UNFOLLOW BUTTON STATES
   ============================================================ */
.btn-follow {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}

.btn-follow.following {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-follow.following:hover {
  background: var(--error-light);
  color: var(--error);
  border-color: var(--error);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.card:hover { box-shadow: var(--shadow); }

.card-body { padding: var(--space-4); }

.card-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: var(--text-base);
  font-weight: 700;
}

/* ============================================================
   POST CARD
   ============================================================ */
.post-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.post-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-light);
}

.post-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.post-card-meta {
  flex: 1;
  min-width: 0;
}

.post-card-publisher {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-main);
  text-decoration: none;
}

.post-card-publisher:hover { color: var(--primary); }

.post-card-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.post-card-category {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}

.post-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: var(--space-2);
  text-decoration: none;
  display: block;
}

.post-card-title:hover { color: var(--primary); }

.post-card-body {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-media {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: var(--space-3) 0;
}

.post-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.action-btn:hover { background: var(--surface-2); color: var(--primary); }
.action-btn.liked { color: var(--secondary); }
.action-btn.bookmarked { color: var(--primary); }

.action-btn .action-count {
  font-size: var(--text-xs);
  font-weight: 700;
}

.action-spacer { flex: 1; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-breaking {
  background: var(--secondary);
  color: var(--text-inverse);
  animation: blink-badge 1.5s infinite;
}

@keyframes blink-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.badge-primary { background: var(--primary); color: var(--text-inverse); }
.badge-success { background: var(--success); color: var(--text-inverse); }
.badge-warning { background: var(--warning); color: var(--text-inverse); }
.badge-error   { background: var(--error); color: var(--text-inverse); }
.badge-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-muted); }

/* Verification Checkmarks */
.verify-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  color: var(--text-inverse);
  flex-shrink: 0;
}

.verify-check.user       { background: var(--badge-user); }
.verify-check.journalist { background: var(--badge-journalist); }
.verify-check.org        { background: var(--badge-org); }
.verify-check.business   { background: var(--badge-business); }
.verify-check.govt       { background: var(--badge-govt); }

/* ============================================================
   POST COMPOSER
   ============================================================ */
.composer-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 2px solid var(--primary);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.composer-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.composer-identity-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.composer-identity-name {
  font-weight: 700;
  color: var(--primary);
}

.composer-title-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-main);
  background: var(--surface-2);
  margin-bottom: var(--space-2);
  transition: border-color var(--transition);
}

.composer-title-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

.composer-body-input {
  width: 100%;
  min-height: 100px;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-base);
  color: var(--text-main);
  background: var(--surface-2);
  resize: vertical;
  line-height: 1.6;
  transition: border-color var(--transition);
}

.composer-body-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

.composer-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.composer-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: none;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition);
}

.composer-tool-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.composer-type-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-main);
  background: var(--surface-2);
  cursor: pointer;
}

.composer-submit {
  margin-left: auto;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-label.required::after {
  content: ' *';
  color: var(--error);
}

.input-field {
  width: 100%;
  padding: 10px var(--space-4);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-base);
  color: var(--text-main);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,121,255,0.15);
}

.input-field.error { border-color: var(--error); }
.input-field.success { border-color: var(--success); }

.input-field::placeholder { color: var(--text-disabled); }

.textarea-field {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-base);
  color: var(--text-main);
  background: var(--surface);
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
  transition: border-color var(--transition);
}

.textarea-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,121,255,0.15);
}

.select-field {
  width: 100%;
  padding: 10px var(--space-4);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-base);
  color: var(--text-main);
  background: var(--surface);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.select-field:focus {
  outline: none;
  border-color: var(--primary);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ============================================================
   SIDEBAR COMPONENTS
   ============================================================ */
.sidebar-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.sidebar-card-title {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  font-size: var(--text-base);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  margin: 2px var(--space-2);
}

.sidebar-nav-item:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.sidebar-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.sidebar-nav-item .nav-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.sidebar-nav-item .nav-badge {
  margin-left: auto;
  background: var(--secondary);
  color: var(--text-inverse);
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Who to follow widget */
.who-to-follow-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.who-to-follow-info { flex: 1; min-width: 0; }

.who-to-follow-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.who-to-follow-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Trending widget */
.trending-item {
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

.trending-item:last-child { border-bottom: none; }

.trending-item:hover { background: var(--surface-2); }

.trending-rank {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 2px;
}

.trending-topic {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-main);
}

.trending-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--primary-light);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.profile-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.profile-info {
  padding: 0 var(--space-6) var(--space-4);
  position: relative;
}

.profile-avatar-wrap {
  margin-top: -50px;
  margin-bottom: var(--space-3);
}

.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.profile-display-name {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.profile-username {
  color: var(--text-muted);
  font-size: var(--text-base);
  margin-top: 2px;
}

.profile-bio {
  color: var(--text-secondary);
  margin: var(--space-3) 0;
  line-height: 1.6;
}

.profile-stats {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-3);
}

.profile-stat {
  text-align: center;
  cursor: pointer;
}

.profile-stat-count {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-main);
}

.profile-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
}

/* ============================================================
   NOTIFICATION ITEM
   ============================================================ */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  transition: background var(--transition);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--primary-light); }

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.notif-icon.like     { background: var(--secondary-light); }
.notif-icon.comment  { background: var(--primary-light); }
.notif-icon.follow   { background: var(--success-light); }
.notif-icon.mention  { background: var(--warning-light); }
.notif-icon.system   { background: var(--surface-2); }

.notif-text {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.4;
}

.notif-text strong { color: var(--text-main); }

.notif-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ============================================================
   MESSAGES / CHAT
   ============================================================ */
.messages-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - var(--header-height) - var(--space-8));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.conv-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  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-info { flex: 1; min-width: 0; }

.conv-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-main);
}

.conv-preview {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.conv-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.conv-unread {
  background: var(--primary);
  color: var(--text-inverse);
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.msg-bubble {
  max-width: 70%;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.msg-bubble.received {
  background: var(--surface-2);
  color: var(--text-main);
  border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
  align-self: flex-start;
}

.msg-bubble.sent {
  background: var(--primary);
  color: var(--text-inverse);
  border-radius: var(--radius-lg) 4px var(--radius-lg) var(--radius-lg);
  align-self: flex-end;
}

.chat-input-bar {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-2);
}

/* ============================================================
   SKELETON LOADERS
   ============================================================ */
@keyframes skeleton-shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-2) 50%, var(--border) 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 16px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-sm);
}

.skeleton-title { height: 24px; margin-bottom: var(--space-3); }
.skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.skeleton-img { width: 100%; height: 200px; border-radius: var(--radius); }

/* ============================================================
   IDENTITY SWITCHER DROPDOWN
   ============================================================ */
.identity-switcher {
  position: relative;
}

.identity-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 14px;
  background: var(--primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.identity-btn:hover { background: var(--primary-dark); }

.identity-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  width: 260px;
  box-shadow: var(--shadow-md);
  z-index: 5000;
  overflow: hidden;
}

.identity-dropdown.open { display: block; }

.identity-dropdown-section {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.identity-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-main);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.identity-dropdown-item:hover { background: var(--surface-2); color: var(--primary); }
.identity-dropdown-item.active { color: var(--primary); background: var(--primary-light); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition-slow);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.modal-close:hover { background: var(--border); color: var(--text-main); }

/* ============================================================
   SPONSORED / AD CARD
   ============================================================ */
.sponsored-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  position: relative;
}

.sponsored-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-8) 0;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  justify-content: space-between;
}

.footer-brand { max-width: 240px; }

.footer-logo {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--primary);
  margin-bottom: var(--space-3);
}

.footer-tagline {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-col-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-3);
}

.footer-link {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-link:hover { color: var(--primary); }

.footer-bottom {
  max-width: var(--max-page);
  margin: var(--space-8) auto 0;
  padding: var(--space-4) var(--space-4) 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============================================================
   MOBILE BOTTOM NAV
   ============================================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 999;
  padding: 0 var(--space-2);
}

.mobile-nav-inner {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius);
  transition: color var(--transition);
}

.mobile-nav-item .nav-icon-mobile { font-size: 22px; }
.mobile-nav-item.active { color: var(--primary); }
.mobile-nav-item:hover { color: var(--primary); }

/* ============================================================
   ALERT / TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-inverse);
  box-shadow: var(--shadow-md);
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  animation: slide-in-toast 0.3s ease;
}

@keyframes slide-in-toast {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--error); }
.toast.info    { background: var(--primary); }
.toast.warning { background: var(--warning); color: var(--text-main); }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-primary   { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-success   { color: var(--success) !important; }
.text-error     { color: var(--error) !important; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }

.fw-400 { font-weight: 400; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.font-heading { font-family: var(--font-heading); }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none  { display: none !important; }

.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-1          { flex: 1; }
.gap-2           { gap: var(--space-2); }
.gap-3           { gap: var(--space-3); }
.gap-4           { gap: var(--space-4); }
.flex-wrap       { flex-wrap: wrap; }

.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.w-full  { width: 100%; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: var(--radius-full); }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-areas: "sidebar-left main";
  }
  .sidebar-right { display: none; }
}

@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
    padding: var(--space-3);
    padding-top: calc(var(--header-height) + var(--space-3));
    padding-bottom: 70px;
  }

  .sidebar-left { display: none; }
  .mobile-nav { display: block; }

  .header-search { display: none; }

  .profile-stats { gap: var(--space-4); }

  .post-card-title { font-size: var(--text-lg); }

  .messages-layout { grid-template-columns: 1fr; }
  .conv-list { display: none; }
  .conv-list.show { display: block; }

  .toast-container {
    bottom: 70px;
    right: var(--space-3);
    left: var(--space-3);
  }
}

@media (max-width: 480px) {
  .brand-logo { font-size: var(--text-xl); }
  .modal { padding: var(--space-4); }
  .btn-lg { padding: 12px 20px; }
}