/* =====================================================
   RAGEWALLS - FORTUNE 500 PROFESSIONAL DESIGN  
   Modern, Clean, Mobile-First, Glassmorphism
   ===================================================== */

/* =====================================================
   CRITICAL FIX - MODAL VISIBILITY
   ===================================================== */
   
/* Hide all modals by default */
.modal {
  display: none !important;
}

/* Show modal when active */
.modal.active {
  display: flex !important;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 9998;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}


:root {
  /* Dark Theme - Professional */
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141a;
  --bg-tertiary: #1a1a24;
  --bg-card: rgba(26, 26, 36, 0.8);
  --bg-glass: rgba(20, 20, 26, 0.7);
  
  /* Borders & Dividers */
  --border-color: #2a2a35;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(255, 51, 102, 0.2);
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #a0a0b0;
  --text-dim: #707080;
  
  /* Brand Colors */
  --primary: #ff3366;
  --primary-hover: #ff4477;
  --primary-dark: #cc2952;
  --primary-glow: rgba(255, 51, 102, 0.3);
  
  /* Semantic Colors */
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.2);
  --warning: #f59e0b;
  --info: #3b82f6;
  
  /* Layout */
  --header-height: 60px;
  --nav-height: 70px;
  --max-width: 800px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px var(--primary-glow);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

/* =====================================================
   RESET & BASE STYLES
   ===================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 
               'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Animated background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 51, 102, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(147, 51, 255, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

p {
  margin-bottom: var(--spacing-md);
}

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

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

/* =====================================================
   LOGO WITH PREMIUM GLOW EFFECT
   ===================================================== */

.logo {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--primary);
  text-shadow: 
    0 0 20px var(--primary-glow),
    0 0 40px var(--primary-glow);
  animation: logoPulse 4s ease-in-out infinite;
  cursor: pointer;
  user-select: none;
  text-align: center;
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, var(--primary) 0%, #ff6699 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes logoPulse {
  0%, 100% {
    text-shadow: 
      0 0 20px var(--primary-glow),
      0 0 40px var(--primary-glow);
  }
  50% {
    text-shadow: 
      0 0 30px var(--primary-glow),
      0 0 60px var(--primary-glow),
      0 0 80px rgba(255, 51, 102, 0.2);
  }
}

.tagline {
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: -var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  font-weight: 500;
}

/* =====================================================
   HEADER - TOP BAR
   ===================================================== */

.top-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--header-height);
  box-shadow: var(--shadow-sm);
}

.header-content {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-md);
}

.header-logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--primary);
  text-shadow: 0 0 15px var(--primary-glow);
  margin: 0;
}

/* =====================================================
   BOTTOM NAVIGATION - FORTUNE 500 STYLE
   ===================================================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-glass);
  backdrop-filter: blur(30px) saturate(180%);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  padding: 0 var(--spacing-sm);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  min-height: 54px;
  border-radius: var(--radius-md);
  max-width: 120px;
  margin: 0 2px;
}

/* Hover effect */
.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

/* Active indicator line */
.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
  box-shadow: 0 2px 8px var(--primary-glow);
}

.nav-item.active::before {
  width: 40px;
}

.nav-item.active {
  color: var(--primary);
  background: rgba(255, 51, 102, 0.08);
}

.nav-item:active {
  transform: scale(0.95);
}

/* Navigation Icons - Large and Visible */
.nav-icon {
  font-size: 1.5rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Navigation Labels - Clear and Readable */
.nav-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  color: inherit;
}

/* =====================================================
   MAIN CONTENT AREA
   ===================================================== */

.screen {
  display: none;
  animation: fadeIn 0.3s ease;
}

.screen[style*="display: block"] {
  display: block;
}

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

.main-content {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--header-height) - var(--nav-height));
  padding-bottom: calc(var(--nav-height) + var(--spacing-lg));
  padding-top: var(--header-height);
}

.feed-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md) var(--spacing-lg);
  animation: fadeIn 0.3s ease;
}

.feed-header {
  position: sticky;
  top: var(--header-height);
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--spacing-md);
  margin: 0 calc(-1 * var(--spacing-md)) var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  border-radius: 0;
}

.feed-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

/* =====================================================
   BUTTONS - PROFESSIONAL STYLE
   ===================================================== */

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition-base);
  font-weight: 600;
  border-radius: var(--radius-md);
  -webkit-appearance: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 12px 24px;
  font-size: 1rem;
  box-shadow: 
    var(--shadow-md),
    0 0 20px var(--primary-glow);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 
    var(--shadow-lg),
    0 0 30px var(--primary-glow);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 10px 20px;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
}

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

.btn-compose {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: var(--shadow-md), 0 0 15px var(--primary-glow);
  border: none;
  white-space: nowrap;
}

.btn-compose:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg), 0 0 25px var(--primary-glow);
}

.btn-icon {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1px solid var(--border-color);
  padding: 0;
}

.btn-icon:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  transform: rotate(180deg);
}

.btn-danger {
  background: var(--error);
  color: white;
  padding: 8px 16px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm), 0 0 10px var(--error-glow);
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: var(--shadow-md), 0 0 20px var(--error-glow);
}

/* =====================================================
   CARDS & POSTS - PREMIUM GLASSMORPHISM
   ===================================================== */

.post-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  animation: slideUp 0.4s ease;
  animation-fill-mode: both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(255, 51, 102, 0.1);
  transform: translateY(-2px);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-md);
  gap: var(--spacing-md);
}

.post-author {
  flex: 1;
}

.post-username {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: var(--spacing-xs);
}

.post-location {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.post-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--spacing-xs);
}

.post-state-of-mind {
  background: linear-gradient(135deg, rgba(255, 51, 102, 0.2), rgba(255, 51, 102, 0.1));
  color: var(--primary);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid var(--border-accent);
  white-space: nowrap;
}

.post-boosted-badge {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.post-text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  word-wrap: break-word;
  white-space: pre-wrap;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-time, .post-expires {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* =====================================================
   POST ACTIONS - REACTIONS & OPTIONS
   ===================================================== */

.post-actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.reaction-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  width: 100%;
}

.reaction-btn:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--border-accent);
  color: var(--text-secondary);
  transform: scale(1.02);
}

.reaction-btn.active {
  background: linear-gradient(135deg, rgba(255, 51, 102, 0.15), rgba(255, 51, 102, 0.05));
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.reaction-count {
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 30px;
  text-align: center;
  color: var(--text-primary);
}

.reaction-btn.active .reaction-count {
  background: var(--primary);
  color: white;
}

.post-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
}

.option-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.option-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-accent);
  color: var(--primary);
}

/* =====================================================
   FORMS & INPUTS - MODERN STYLE
   ===================================================== */

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--transition-base);
  margin-bottom: var(--spacing-md);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-md);
  background: var(--bg-secondary);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* =====================================================
   PROFILE CARD - PREMIUM DESIGN
   ===================================================== */

.profile-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-lg);
}

.profile-info {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.profile-info h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: var(--spacing-xs);
}

.profile-info p {
  color: var(--text-muted);
  font-size: 1rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.stat {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  text-align: center;
  transition: all var(--transition-base);
}

.stat:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* =====================================================
   TOAST NOTIFICATIONS - SLEEK & MODERN
   ===================================================== */

.toast {
  position: fixed;
  top: calc(var(--header-height) + var(--spacing-md));
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  color: var(--text-primary);
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 10000;
  pointer-events: none;
  transition: transform var(--transition-base);
  max-width: 90%;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast-success {
  border-color: var(--success);
  box-shadow: var(--shadow-xl), 0 0 20px var(--success-glow);
}

.toast-error {
  border-color: var(--error);
  box-shadow: var(--shadow-xl), 0 0 20px var(--error-glow);
}

.toast-info {
  border-color: var(--info);
  box-shadow: var(--shadow-xl), 0 0 20px rgba(59, 130, 246, 0.2);
}

/* =====================================================
   EMPTY STATES & LOADING
   ===================================================== */

.empty-state,
.loading-state,
.error-state {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  color: var(--text-muted);
  font-size: 1rem;
}

.empty-state {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
}

.loading-state {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* =====================================================
   MODALS - PROFESSIONAL OVERLAY
   ===================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
  position: relative;
}

.modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--bg-secondary);
}

/* =====================================================
   SHAKE ANIMATION FOR VALIDATION
   ===================================================== */

.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* =====================================================
   RESPONSIVE - DESKTOP ENHANCEMENTS
   ===================================================== */

@media (min-width: 768px) {
  .bottom-nav {
    max-width: var(--max-width);
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
  }
  
  .nav-item {
    padding: var(--spacing-md);
  }
  
  .nav-icon {
    font-size: 1.75rem;
  }
  
  .nav-label {
    font-size: 0.75rem;
  }
  
  .post-card {
    padding: var(--spacing-lg);
  }
  
  .profile-stats {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .feed-header {
    border-radius: var(--radius-md);
    margin: 0 0 var(--spacing-lg);
  }
}

@media (min-width: 1024px) {
  .nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
  }
  
  .nav-item:hover .nav-icon {
    transform: scale(1.1);
  }
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

.hide { display: none !important; }
.show { display: block !important; }
.text-center { text-align: center; }
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-md { margin-top: var(--spacing-md) !important; }
.p-0 { padding: 0 !important; }

/* =====================================================
   SCROLLBAR STYLING
   ===================================================== */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-color);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-tertiary) var(--bg-secondary);
}

/* =====================================================
   AUTH SCREENS - CLEAN & MODERN
   ===================================================== */

.auth-container {
  max-width: 420px;
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-md);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-container {
  margin-bottom: var(--spacing-xl);
}

.auth-form {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.4s ease;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  color: var(--text-primary);
}

.username-row {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.username-row input {
  flex: 1;
  margin-bottom: var(--spacing-md);
}

.username-row button {
  width: 50px;
  height: 50px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: var(--spacing-md);
}

.switch-auth {
  text-align: center;
  margin-top: var(--spacing-md);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.forgot-password {
  text-align: center;
  margin: var(--spacing-md) 0;
  font-size: 0.9rem;
}

.terms-gate {
  background: rgba(255, 51, 102, 0.05);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin: var(--spacing-lg) 0;
}

.terms-explainer {
  margin-top: var(--spacing-md);
  font-size: 0.85rem;
  line-height: 1.6;
}

.terms-explainer ul {
  margin: var(--spacing-sm) 0;
  padding-left: var(--spacing-lg);
}

.terms-explainer li {
  margin: var(--spacing-xs) 0;
  color: var(--text-muted);
}

/* Checkbox styling */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

/* =====================================================
   VERIFICATION & ONBOARDING SCREENS
   ===================================================== */

.verification-container,
.onboarding-container {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-md);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.verification-icon {
  font-size: 4rem;
  margin-bottom: var(--spacing-lg);
  animation: pulse 2s ease-in-out infinite;
}

.verification-message,
.verification-instructions {
  margin: var(--spacing-md) 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.verification-message strong,
.verification-instructions strong {
  color: var(--text-primary);
}

.verification-actions {
  display: flex;
  gap: var(--spacing-md);
  margin: var(--spacing-xl) 0;
}

.verification-actions button {
  flex: 1;
}

.verification-note {
  margin-top: var(--spacing-xl);
  font-size: 0.9rem;
}

/* =====================================================
   COMMENTS MODAL & THREAD
   ===================================================== */

.comments-modal .modal {
  max-width: 600px;
}

.comments-post-preview {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.comments-post-author {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.comments-post-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-md);
}

.comments-post-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.comments-thread {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: var(--spacing-lg);
  padding-right: 2px;
}

/* ── Facebook-style comment card ── */
.comment-card {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  animation: slideUp 0.2s ease;
  background: none;
  border: none;
  padding: 0;
}

/* Avatar circle — auto-coloured by first char of handle */
.comment-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-top: 2px;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

/* Bubble containing author + text */
.comment-bubble {
  display: inline-block;
  max-width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
  padding: 8px 12px;
  word-wrap: break-word;
}

.comment-author {
  display: block;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.85rem;
  margin-bottom: 3px;
}

.comment-text {
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.5;
  word-wrap: break-word;
  margin: 0;
}

/* Meta row: time · Reply · Delete */
.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  padding-left: 4px;
}

.comment-time {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.comment-action-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
  line-height: 1;
}

.comment-action-btn:hover {
  color: var(--primary);
}

.comment-action-btn.danger {
  color: var(--text-dim);
}

.comment-action-btn.danger:hover {
  color: var(--error);
}

/* ── Reply threading — ONE level max (cap nesting visually) ── */
.comment-replies {
  margin-top: 10px;
  padding-left: 16px;
  border-left: 2px solid var(--border-color);
}

/* Prevent deeper nesting from going further inward */
.comment-replies .comment-replies {
  margin-left: 0;
  padding-left: 12px;
  border-left: 1px solid var(--border-subtle);
}

/* =====================================================
   INLINE COMMENTS — Facebook-style expanding section
   ===================================================== */

.inline-comments {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border-subtle);
  margin-top: 4px;
  background: var(--bg-secondary);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
}

.inline-comments.open {
  display: flex;
}

.inline-comments-thread {
  max-height: 320px;
  overflow-y: auto;
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.inline-comments-thread::-webkit-scrollbar {
  width: 4px;
}
.inline-comments-thread::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.inline-comments-empty,
.inline-comments-loading {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
  padding: 12px 0;
}

.inline-reply-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 51, 102, 0.08);
  border-top: 1px solid var(--border-accent);
  padding: 6px 14px;
  font-size: 0.85rem;
}

.inline-reply-text {
  color: var(--primary);
  font-size: 0.83rem;
}

.inline-cancel-reply {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.inline-cancel-reply:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.inline-comment-compose {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.inline-comment-input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 0.9rem;
  color: var(--text-primary);
  resize: none;
  line-height: 1.4;
  min-height: 36px;
  max-height: 100px;
  transition: border-color var(--transition-fast);
  font-family: inherit;
}

.inline-comment-input:focus {
  outline: none;
  border-color: var(--primary);
}

.inline-comment-input::placeholder {
  color: var(--text-dim);
}

.inline-send-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
  height: 36px;
  display: flex;
  align-items: center;
}

.inline-send-btn:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.inline-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Active state for the comments toggle button */
.comments-toggle-btn.active {
  background: rgba(255, 51, 102, 0.15);
  color: var(--primary);
  border-color: var(--primary);
}

/* Old modal input area — kept for any remaining modal usage */
.comment-input-area {
  position: sticky;
  bottom: 0;
  background: var(--bg-secondary);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-subtle);
}

#replying-banner {
  background: rgba(255, 51, 102, 0.1);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#replying-to-text {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 600;
}

#cancel-reply-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: var(--spacing-xs);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

#cancel-reply-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.comment-compose {
  display: flex;
  gap: var(--spacing-sm);
  align-items: flex-end;
}

#comment-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
  margin-bottom: 0;
}

#send-comment-btn {
  height: 44px;
  padding: 0 var(--spacing-lg);
  white-space: nowrap;
  margin-bottom: 0;
}

.char-counter {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: var(--spacing-xs);
}

/* =====================================================
   TROLL OF THE DAY CARD - PREMIUM DESIGN
   ===================================================== */

.troll-of-the-day-card {
  background: linear-gradient(135deg, 
    rgba(255, 215, 0, 0.1) 0%, 
    rgba(255, 51, 102, 0.1) 100%);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  box-shadow: 
    var(--shadow-xl),
    0 0 40px rgba(255, 215, 0, 0.2);
  animation: crownPulse 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

@keyframes crownPulse {
  0%, 100% {
    box-shadow: 
      var(--shadow-xl),
      0 0 30px rgba(255, 215, 0, 0.2);
  }
  50% {
    box-shadow: 
      var(--shadow-xl),
      0 0 50px rgba(255, 215, 0, 0.3),
      0 0 70px rgba(255, 215, 0, 0.1);
  }
}

.troll-crown-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.crown-particles {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  font-size: 1.5rem;
}

.crown-particle {
  animation: float 3s ease-in-out infinite;
  display: inline-block;
}

.crown-particle:nth-child(2) {
  animation-delay: 0.5s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.troll-crown-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}

.crown-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

.pulse-crown {
  animation: pulse 2s ease-in-out infinite;
}

.troll-title {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.troll-timer {
  font-size: 0.85rem;
  color: #ffd700;
  font-weight: 600;
}

.troll-card-body {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
}

.king-username {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
}

.troll-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
}

.troll-stat {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: rgba(255, 215, 0, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
}

.stat-icon {
  font-size: 1.5rem;
}

.stat-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.troll-score-display {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  text-align: center;
  margin: var(--spacing-md) 0;
}

.score-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffd700;
  margin-bottom: var(--spacing-xs);
}

.score-value {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--spacing-xs);
}

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

.troll-reaction-counts {
  display: flex;
  justify-content: space-around;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.troll-reaction-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-width: 60px;
}

.troll-reaction-badge .emoji {
  font-size: 1.5rem;
}

.troll-reaction-badge .count {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mini-crown-badge {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #0a0a0f;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-bottom: var(--spacing-sm);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

/* =====================================================
   LEADERBOARDS - PROFESSIONAL RANKINGS
   ===================================================== */

.leaderboards-subhead {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.leaderboards-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-sm);
}

.leaderboards-date {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
}

.leaderboards-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.leaderboard-row {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: var(--spacing-md);
  align-items: center;
  transition: all var(--transition-base);
  animation: slideUp 0.3s ease;
  animation-fill-mode: both;
}

.leaderboard-row:nth-child(1) { animation-delay: 0s; }
.leaderboard-row:nth-child(2) { animation-delay: 0.05s; }
.leaderboard-row:nth-child(3) { animation-delay: 0.1s; }
.leaderboard-row:nth-child(4) { animation-delay: 0.15s; }
.leaderboard-row:nth-child(5) { animation-delay: 0.2s; }

.leaderboard-row:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg);
  transform: translateX(4px);
}

.leaderboard-row.top-3 {
  border-width: 2px;
  box-shadow: var(--shadow-md);
}

.leaderboard-row:nth-child(1) {
  border-color: rgba(255, 215, 0, 0.5);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
}

.leaderboard-row:nth-child(2) {
  border-color: rgba(192, 192, 192, 0.4);
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.08), rgba(192, 192, 192, 0.03));
}

.leaderboard-row:nth-child(3) {
  border-color: rgba(205, 127, 50, 0.4);
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.08), rgba(205, 127, 50, 0.03));
}

.leaderboard-rank {
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  color: var(--text-primary);
}

.leaderboard-info {
  flex: 1;
}

.leaderboard-handle {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

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

.leaderboard-stats {
  text-align: right;
}

.leaderboard-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: var(--spacing-xs);
}

.leaderboard-breakdown {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* =====================================================
   ADMIN PANEL - CLEAN & FUNCTIONAL
   ===================================================== */

.admin-tabs {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-xs);
}

.admin-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.admin-tab-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.admin-tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.admin-tab-content {
  animation: fadeIn 0.3s ease;
}

.admin-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

@media (max-width: 640px) {
  .admin-controls {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   LOCKED NOTICE - PREMIUM UPSELL
   ===================================================== */

.locked-notice {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  text-align: center;
  margin: var(--spacing-xl) 0;
}

.locked-notice h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.locked-notice p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* =====================================================
   EMOTION RENDERING - TEXT EFFECTS
   ===================================================== */

.caps-word {
  color: var(--primary);
  font-weight: 700;
  text-shadow: 0 0 10px var(--primary-glow);
}

.punctuation-emphasis {
  color: var(--text-primary);
  font-weight: 600;
}

.long-rant {
  font-size: 1.05rem;
  line-height: 1.8;
  padding: var(--spacing-md);
  background: rgba(255, 51, 102, 0.02);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
}

.rendered-text {
  color: var(--text-secondary);
}

/* =====================================================
   STRIPE SECTION - PROFESSIONAL MONETIZATION UI
   ===================================================== */

.stripe-section {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.stripe-section h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.stripe-section p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-md);
}

/* =====================================================
   ACCESSIBILITY IMPROVEMENTS
   ===================================================== */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* =====================================================
   PERFORMANCE OPTIMIZATIONS
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */

@media print {
  .bottom-nav,
  .top-header,
  .btn-compose,
  .post-actions,
  .modal-overlay {
    display: none !important;
  }
}
/* Add to the END of your existing styles.css */

/* =====================================================
   REACTION BUTTONS - PROFESSIONAL DESIGN
   ===================================================== */

.reaction-btn {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-base);
  width: 100%;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Hover shimmer effect */
.reaction-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.1) 50%, 
    transparent 100%);
  transition: left 0.5s ease;
}

.reaction-btn:hover::before {
  left: 100%;
}

.reaction-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-color: var(--border-accent);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.reaction-btn:active:not(:disabled) {
  transform: translateY(0);
}

.reaction-btn.active {
  background: linear-gradient(135deg, 
    rgba(255, 51, 102, 0.2) 0%, 
    rgba(255, 51, 102, 0.1) 100%);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 
    0 0 15px var(--primary-glow),
    0 4px 12px rgba(0, 0, 0, 0.3);
  font-weight: 600;
}

.reaction-btn.active::before {
  display: none;
}

.reaction-btn span {
  flex: 1;
  text-align: left;
}

.reaction-count {
  background: var(--bg-primary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 32px;
  text-align: center;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.reaction-btn.active .reaction-count {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.reaction-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =====================================================
   POST OPTIONS BUTTONS - STYLED PROPERLY
   ===================================================== */

.option-btn {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.option-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 51, 102, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.option-btn:hover {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 51, 102, 0.2);
}

.option-btn:hover::after {
  width: 120%;
  height: 120%;
}

.option-btn:active {
  transform: translateY(0);
}

/* Specific button styles */
.option-btn[data-action="comments"] {
  border-color: rgba(59, 130, 246, 0.3);
}

.option-btn[data-action="comments"]:hover {
  color: #3b82f6;
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.option-btn[data-action="delete"] {
  border-color: rgba(239, 68, 68, 0.3);
}

.option-btn[data-action="delete"]:hover {
  color: var(--error);
  border-color: var(--error);
  box-shadow: 0 2px 8px var(--error-glow);
}

.option-btn[data-action="boost"] {
  border-color: rgba(139, 92, 246, 0.3);
}

.option-btn[data-action="boost"]:hover {
  color: #8b5cf6;
  border-color: #8b5cf6;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.option-btn[data-action="tip"] {
  border-color: rgba(16, 185, 129, 0.3);
}

.option-btn[data-action="tip"]:hover {
  color: var(--success);
  border-color: var(--success);
  box-shadow: 0 2px 8px var(--success-glow);
}

/* =====================================================
   PULSING RED ANIMATION - POST CARDS & CONTAINERS
   ===================================================== */

@keyframes pulseRedGlow {
  0%, 100% {
    box-shadow: 
      0 4px 6px -1px rgba(0, 0, 0, 0.4),
      0 0 0 0 rgba(255, 51, 102, 0);
  }
  50% {
    box-shadow: 
      0 10px 15px -3px rgba(0, 0, 0, 0.5),
      0 0 20px 4px rgba(255, 51, 102, 0.3),
      0 0 40px 8px rgba(255, 51, 102, 0.15);
  }
}

/* Apply to post cards */
.post-card {
  animation: 
    slideUp 0.4s ease both,
    pulseRedGlow 3.5s ease-in-out infinite;
  animation-delay: 0s, 0.4s; /* Start pulsing after slide-up */
}

/* Apply to feed containers */
.feed-container {
  animation: 
    fadeIn 0.3s ease,
    pulseRedGlow 4s ease-in-out infinite;
  animation-delay: 0s, 0.3s;
}

/* Apply to profile card */
.profile-card {
  animation: pulseRedGlow 3.8s ease-in-out infinite;
}

/* Apply to troll of the day card (already has animation, enhance it) */
.troll-of-the-day-card {
  animation: 
    crownPulse 3s ease-in-out infinite,
    pulseRedGlow 3.5s ease-in-out infinite;
}

/* comment-card animation handled in comments section above */

/* Apply to leaderboard rows */
.leaderboard-row {
  animation: 
    slideUp 0.3s ease both,
    pulseRedGlow 3.7s ease-in-out infinite;
}

/* Enhance modal pulse */
.modal {
  animation: 
    slideUp 0.3s ease,
    pulseRedGlow 4s ease-in-out infinite;
  animation-delay: 0s, 0.3s;
}

/* Bottom nav pulse */
.bottom-nav {
  animation: pulseRedGlow 4.2s ease-in-out infinite;
}

/* Top header pulse */
.top-header {
  animation: pulseRedGlow 4s ease-in-out infinite;
}

/* =====================================================
   ENHANCED BUTTON STATES
   ===================================================== */

/* Make sure all buttons have proper styling */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition-base);
  font-weight: 600;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

/* Button click effect */
button:not(:disabled):active {
  transform: scale(0.97);
}

/* Disabled button styling */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(50%);
}

/* =====================================================
   SHARE BUTTON SPECIAL STYLING
   ===================================================== */

.option-btn[data-action="share"] {
  border-color: rgba(245, 158, 11, 0.3);
}

.option-btn[data-action="share"]:hover {
  color: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

/* =====================================================
   FLAG BUTTON SPECIAL STYLING
   ===================================================== */

.option-btn[data-action="flag"] {
  border-color: rgba(239, 68, 68, 0.2);
}

.option-btn[data-action="flag"]:hover {
  color: #fbbf24;
  border-color: #fbbf24;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.2);
}

/* =====================================================
   FOLLOW BUTTON SPECIAL STYLING
   ===================================================== */

.option-btn[data-action="follow"] {
  border-color: rgba(59, 130, 246, 0.3);
}

.option-btn[data-action="follow"]:hover {
  color: #3b82f6;
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* =====================================================
   MOBILE OPTIMIZATION
   ===================================================== */

@media (max-width: 768px) {
  .reaction-btn {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
  
  .option-btn {
    padding: 7px 12px;
    font-size: 0.8rem;
  }
  
  .reaction-count {
    padding: 3px 8px;
    font-size: 0.8rem;
    min-width: 28px;
  }
}

/* =====================================================
   NOTIFICATION BELL & PANEL
   ===================================================== */

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-wrapper {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
  line-height: 1;
}

.notif-panel {
  display: none;
  position: absolute;
  top: 100%;
  right: 16px;
  width: min(360px, calc(100vw - 32px));
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 9997;
  overflow: hidden;
  animation: slideUp 0.2s ease;
}

.notif-panel.open {
  display: block;
}

.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.notif-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.notif-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.notif-list {
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-tertiary); }

.notif-emoji {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.notif-body { flex: 1; min-width: 0; }

.notif-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.notif-time {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 3px;
}

.notif-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* =====================================================
   PERFORMANCE: REDUCE MOTION FOR ACCESSIBILITY
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
  .post-card,
  .feed-container,
  .profile-card,
  .comment-card,
  .leaderboard-row,
  .modal,
  .bottom-nav,
  .top-header {
    animation: none !important;
  }
  
  .reaction-btn::before,
  .option-btn::after {
    display: none;
  }
}