/* ============================================ */
/* COLOR SCHEME VARIABLES */
/* Define all colors here for easy customization */
/* ============================================ */
:root {
  /* Primary brand colors */
  --primary-color: #2563eb;        /* Main blue */
  --primary-hover: #1d4ed8;        /* Darker blue for hover states */
  --primary-light: #dbeafe;        /* Light blue for backgrounds */
  
  /* Secondary accent colors */
  --secondary-color: #7c3aed;      /* Purple accent */
  --secondary-hover: #6d28d9;      /* Darker purple for hover */
  
  /* Neutral colors */
  --background: #f8fafc;           /* Page background (light gray) */
  --surface: #ffffff;              /* Card/surface backgrounds (white) */
  --text-primary: #1e293b;         /* Main text color (dark gray) */
  --text-secondary: #64748b;       /* Secondary text (lighter gray) */
  --border: #e2e8f0;               /* Border color (very light gray) */
  
  /* Status colors */
  --success: #10b981;              /* Green for success states */
  --error: #ef4444;                /* Red for errors/likes */
  --warning: #f59e0b;              /* Orange for warnings */
  
  /* Shadow definitions */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* ============================================ */
/* RESET AND BASE STYLES */
/* ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--background) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* Hide elements with .hidden class */
.hidden {
  display: none !important;
}

/* ============================================ */
/* AUTHENTICATION SCREENS (Login/Register) */
/* ============================================ */
.auth-screen {
  background: var(--surface);
  padding: 40px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;;
  max-width: 420px;
  animation: fadeIn 0.5s ease-in;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Auth screen headings */
.auth-screen h2 {
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Auth form styles */
.auth-screen form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-screen label {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 6px;
  display: block;
}

.main-container{
  flex: 1;
  width: 100%;
  border-radius: 3px;
}

.auth-screen input[type="email"],
.auth-screen input[type="text"],
.auth-screen input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface);
  transition: all 0.3s ease;
  outline: none;
}

.auth-screen input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.auth-screen input:hover {
  border-color: var(--primary-color);
}

/* Auth buttons */
.auth-screen button[type="submit"] {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 12px;
  box-shadow: var(--shadow-md);
}

.auth-screen button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.auth-screen button[type="submit"]:active {
  transform: translateY(0);
}

/* Toggle text between login/register */
.auth-toggle {
  text-align: center;
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-toggle .link {
  color: var(--primary-color);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease;
}

.auth-toggle .link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Terms / checkbox row */
.terms-row {
  display: flex;
  align-items: center; /* centers everything vertically */
  gap: 8px;
  margin-top: 8px;
  line-height: 1; /* prevents text from pushing vertically */
}

/* Reset default margins and align baseline */
.terms-row span,
.terms-row label {
  margin: 0;
  display: flex;
  align-items: center;
}

/* Checkbox styling */
.terms-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Terms label text */
.terms-label {
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

/* Clickable "vilkårene" link */
.terms-link {
  color: var(--primary-color);
  cursor: pointer;
  text-decoration: underline;
  margin-left: 6px;
  outline: none;
  border-radius: 4px;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
}

.terms-link:focus,
.terms-link:focus-visible {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}


/* Terms text box */
.terms-text {
  max-width: 560px;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.4;
  box-shadow: var(--shadow-sm);
  transition: opacity 180ms ease, transform 180ms ease;
}

/* show/hide handled via .hidden class already in file */
@media (max-width: 640px) {
  .terms-text { padding: 10px 12px; font-size: 0.92rem; }
}

/* ============================================ */
/* MAIN PAGE - NAVIGATION BAR */
/* Sticky header at the top of the page */
/* ============================================ */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;                /* Sticks to top when scrolling */
  top: 0;
  z-index: 100;                    /* Stays above other content */
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

/* Logo text with gradient */
.logo {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}

/* ============================================ */
/* FEED TABS (Recent/Popular) */
/* Toggle between different feed views */
/* ============================================ */
.feed-tabs {
  display: flex;
  gap: 8px;
  background: var(--background);
  padding: 4px;
  border-radius: 10px;
}

.tab-btn {
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap; /* Prevent text wrapping */
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--surface);
}

/* Active tab styling */
.tab-btn.active {
  background: var(--surface);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

/* ============================================ */
/* NAVIGATION ACTIONS */
/* School selector and profile button */
/* ============================================ */
.nav-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* School filter dropdown */
.school-selector {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.school-selector:hover {
  border-color: var(--primary-color);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #e74c3c;
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 0.15rem 0.35rem;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  line-height: 1;
}

/* Profile button (circular with initials) - fixed size to prevent stretch */

/* Profile dropdown */
.profile-wrapper { position: relative; }
.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 8px 6px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-menu.hidden { display: none !important; }
.profile-menu-item {
  background: transparent;
  border: none;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 600;
  transition: background 0.15s, transform 0.08s;
}
.profile-menu-item:hover,
.profile-menu-item:focus {
  background: var(--primary-light);
  transform: translateY(-1px);
  outline: none;
}
.profile-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
  border-radius: 2px;
}

.profile-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.profile-btn:hover {
  transform: scale(1.05);
}

/* ============================================ */
/* MAIN CONTAINER */
/* Two-column grid layout for feed and sidebar */
/* ============================================ */
.main-container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 300px;    /* Feed takes remaining space, sidebar is 300px */
  gap: 24px;
  background: var(--background);
}

/* ============================================ */
/* FEED SECTION */
/* Left column containing threads */
/* ============================================ */
.feed-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ============================================ */
/* CREATE THREAD BOX */
/* Input area for posting new threads */
/* ============================================ */
.create-thread {
  background: var(--surface);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  margin-top: 10px;
}

.create-thread-input {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

/* User avatar (circular with initials) */
.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;                      /* Prevents avatar from shrinking */
}

/* Textarea for thread content */
.create-thread textarea {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: all 0.3s ease;
}

.create-thread textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Action buttons container */
.create-thread-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ============================================ */
/* BUTTONS */
/* Reusable button styles */
/* ============================================ */
.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Primary button with gradient */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================ */
/* THREAD CARD */
/* Individual thread post container */
/* ============================================ */
.thread-card {
  background: var(--surface);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  max-width: 900px;
  width: auto;
}

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

/* Thread header with user info */
.thread-header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.thread-user-info {
  flex: 1;
}

/* Username styling */
.thread-username {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

/* Timestamp and metadata */
.thread-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

/* School badge showing which school user is from */
.thread-school-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

/* Thread text content */
.thread-content {
  margin-bottom: 16px;
  line-height: 1.6;
}
.thread-content {
  width: 100%; /* Ensure it takes full container width */
  word-wrap: break-word; /* Break long words to wrap */
  overflow-wrap: break-word; /* Modern equivalent of word-wrap */
  white-space: normal; /* Allow text to wrap naturally */
}

/* ============================================ */
/* THREAD ACTIONS */
/* Like, comment, share buttons */
/* ============================================ */
.thread-actions {
  display: flex;
  gap: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Individual action button (like, comment, share) */
.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s ease;
}

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

/* Liked state (red heart) */
.action-btn.liked {
  color: var(--error);
}

/* ============================================ */
/* SIDEBAR */
/* Right column with trending and stats */
/* ============================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Sidebar card container */
.sidebar-card {
  background: var(--surface);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

/* Sidebar section title */
.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* ============================================ */
/* TRENDING TOPICS */
/* Popular hashtags section */
/* ============================================ */
.trending-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
}

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

.trending-item:hover {
  color: var(--primary-color);
  transform: translateX(5px);
}

/* Hashtag text */
.trending-topic {
  font-weight: 600;
  margin-bottom: 4px;
}

/* Thread count for each topic */
.trending-count {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================ */
/* SCHOOL STATS */
/* Active schools section */
/* ============================================ */
.school-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.school-info:last-child {
  border-bottom: none;
}

/* School name */
.school-name {
  font-weight: 600;
}

/* Online user count */
.school-count {
  font-size: 14px;
  color: var(--text-secondary);
}

.post-school-selector {
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-primary);
  transition: all 0.3s ease;
  font-weight: 500;
}

.post-school-selector:hover {
  border-color: var(--primary-color);
}

.post-school-selector:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.Threads{
  max-height: 65vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* ============================================ */
/* RESPONSIVE DESIGN */
/* Mobile and tablet adjustments */
/* ============================================ */

/* Large tablet: Stack sidebar on top */
@media (max-width: 968px) {
  .main-container {
    grid-template-columns: 1fr;        /* Single column layout */
  }

  .sidebar {
    order: -1;                         /* Move sidebar above feed */
  }
}

/* Tablet and smaller: Adjust navbar for better stacking */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
  }

  .logo {
    order: -1;
    font-size: 20px;
  }

  .feed-tabs {
    order: 1;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .tab-btn {
    flex: 1;
    min-width: 120px;
    max-width: 160px;
  }

  .nav-actions {
    order: 2;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .notification-btn {
    order: 2;
    flex-shrink: 0;
  }

  .profile-btn {
    order: 3;
    flex-shrink: 0;
  }
}



/* Mobile: Adjust navigation and layout */
@media (max-width: 640px) {
  /* Auth screens take more space on mobile */
  .auth-screen {
    padding: 28px;
    border-radius: 12px;
    max-width: 90%;
  }
  
  .auth-screen h2 {
    font-size: 24px;
    margin-bottom: 24px;
  }
  
  .auth-screen input[type="email"],
  .auth-screen input[type="text"],
  .auth-screen input[type="password"] {
    padding: 10px 14px;
    font-size: 14px;
  }
  
  .auth-screen button[type="submit"] {
    padding: 12px 20px;
    font-size: 15px;
  }

  /* Navigation adjustments */
  .nav-container {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* Make tabs full width on mobile */
  .feed-tabs {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .tab-btn {
    flex: 1;
    min-width: 120px;
  }

  /* Smaller school selector on mobile */
  .school-selector {
    font-size: 12px;
    padding: 6px 12px;
    min-width: 140px;
  }

  /* Stack avatar and textarea vertically on mobile */
  .create-thread-input {
    flex-direction: column;
  }

  .user-avatar {
    align-self: flex-start;
  }

  /* Allow action buttons to wrap on mobile */
  .thread-actions {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
  }

  .action-btn {
    flex: 1;
    min-width: 100px;
    justify-content: center;
  }

  /* Reduce padding on cards for mobile */
  .thread-card,
  .sidebar-card,
  .create-thread {
    padding: 16px;
  }

  /* Sidebar: Reduce padding and font sizes */
  .sidebar-title {
    font-size: 16px;
  }

  .trending-topic {
    font-size: 15px;
  }

  .trending-count,
  .school-name,
  .school-count {
    font-size: 12px;
  }

  /* Threads container: Adjust max-height for mobile */
  .Threads {
    max-height: 50vh;
  }

  /* Main container padding */
  .main-container {
    padding: 0 16px;
    margin: 16px auto;
    gap: 16px;
  }
}

/* Small mobile: Extra adjustments for very narrow screens */
@media (max-width: 480px) {
  .nav-actions {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 4px;
    width: 100%;
  }

  .notification-btn {
    order: 2;
    flex: 0 0 auto;
  }

  .profile-btn {
    order: 3;
    flex: 0 0 auto;
  }

  .school-selector,
  .notification-btn,
  .profile-btn {
    width: auto;
  }

  .profile-btn {
    min-width: 40px;
  }

  .feed-tabs {
    flex-wrap: wrap;
  }

  .tab-btn {
    min-width: auto;
    padding: 8px 12px;
  }

  .btn-primary,
  .action-btn {
    width: 100%;
    margin-bottom: 8px;
  }

  /* Auth forms: Reduce gaps */
  .auth-screen form {
    gap: 16px;
  }

  /* Comments: Ensure stacking */
  .comment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .comment-user-info {
    width: 100%;
  }

  .nested-comment {
    margin-left: 0;
    border-left: none;
    padding-left: 0;
    background-color: var(--background);
  }
}

.comments-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.comments-section.expanded {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Comment form */
.comment-form {
  margin-bottom: 16px;
}

.comment-input-container {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.comment-input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  outline: none;
  transition: all 0.3s ease;
}

.comment-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.comment-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Individual comment */
.comment-card {
  padding: 16px;
  background: var(--background);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.nested-comments {
  margin-top: 12px;
}

/* Comment header */
.comment-header {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.comment-user-info {
  flex: 1;
}

.comment-username {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 2px;
}

.comment-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.comment-school-badge {
  display: inline-block;
  padding: 1px 6px;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}

/* Comment content */
.comment-content {
  margin-bottom: 12px;
  line-height: 1.5;
  font-size: 14px;
  color: var(--text-primary);
}

/* Comment actions */
.comment .comment-actions {
  display: flex;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  justify-content: flex-start;
}

.comment .action-btn.small {
  padding: 4px 8px;
  font-size: 12px;
  gap: 4px;
}

/* Small avatar for comments */
.user-avatar.small {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

/* Comment toggle button active state */
.comment-toggle.active {
  color: var(--primary-color);
  background: var(--primary-light);
}

.nested-comment {
  margin-left: 1.5rem;
  border-left: 2px solid #e1e5e9;
  padding-left: 1rem;
  background-color: #f8f9fa;
  border-radius: 0 8px 8px 0;
}

.comments-section .comments-section {
  margin-left: 1rem;
}

.nested-comments-list {
  margin-top: 0.5rem;
}

/* ============================================ */
/* NOTIFICATION SYSTEM */
/* ============================================ */


.notification-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #e74c3c;
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 0.15rem 0.35rem;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

.notification-panel {
  position: absolute;
  top: 60px;
  right: 80px;
  width: 400px;
  max-width: 90vw;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 500px;
  display: flex;
  flex-direction: column;
}

.notification-panel.hidden {
  display: none;
}

.notification-header {
  padding: 1rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.mark-all-read {
  background: none;
  border: none;
  color: #3498db;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.mark-all-read:hover {
  background-color: rgba(52, 152, 219, 0.1);
}

.notification-list {
  overflow-y: auto;
  max-height: 420px;
}

.notification-item {
  padding: 1rem;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  gap: 0.75rem;
}

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

.notification-item:hover {
  background-color: #f8f9fa;
}

.notification-item.unread {
  background-color: #e3f2fd;
}

.notification-item.unread:hover {
  background-color: #d1e7fd;
}

.notification-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.notification-content {
  flex: 1;
}

.notification-text {
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.notification-text strong {
  font-weight: 600;
  color: #000;
}

.notification-time {
  font-size: 0.75rem;
  color: #888;
}

.notification-empty {
  padding: 2rem;
  text-align: center;
  color: #999;
  font-size: 0.9rem;
}

/* Bakgrunns-laget */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

/* Selve adminpanelet */
.adminpanel {
  background: rgba(20, 20, 35, 0.95);
  border: 1px solid rgba(100, 100, 255, 0.25);
  border-radius: 12px;
  padding: 25px;
  width: 400px;
  color: #fff;
  font-family: "Inter", sans-serif;
  box-shadow: 0 0 20px rgba(100, 100, 255, 0.2);
  text-align: center;
  animation: popIn 0.25s ease;
}

/* Tittel */
.adminpanel h2 {
  margin-bottom: 16px;
  color: #7b7bff;
  text-shadow: 0 0 8px #7b7bff;
}

/* Knapper */
.admin-controls button {
  background: linear-gradient(90deg, #4b4bff, #7b7bff);
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  color: white;
  cursor: pointer;
  font-weight: 600;
  margin: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-controls button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(123, 123, 255, 0.6);
}

.vote {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
}

.vote img {
  width: 22px;
  height: 22px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  opacity: 0.8;
}

.vote img:hover {
  transform: scale(1.15);
  opacity: 1;
  filter: brightness(1.2);
}

.vote img:active {
  transform: scale(1.05);
  filter: brightness(0.9);
}

.vote img.active {
  background-color: rgba(0,0,0,0.1);
}

/* Image upload section */
.image-upload-section {
  padding: 0 1rem 0.5rem 1rem;
}

.btn-secondary {
  background: #ecf0f1;
  color: #2c3e50;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background: #d5dbdb;
}

.image-preview {
  margin-top: 0.5rem;
  position: relative;
  display: inline-block;
}

.image-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  display: block;
}

.image-preview .remove-image {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(231, 76, 60, 0.9);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 0.7rem;
}

.image-preview.hidden {
  display: none;
}

/* Thread images */
.thread-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  margin-top: 0.5rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.thread-image:hover {
  opacity: 0.9;
}

/* Animasjoner */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}


/* Highlight animation for thread when clicked from notification */
@keyframes highlight {
  0% {
    background-color: rgba(52, 152, 219, 0.2);
  }
  100% {
    background-color: transparent;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .notification-panel {
    right: 10px;
    width: calc(100vw - 20px);
  }
}
/* ============================================ */
/* POLL SECTION - Create Thread Form */
/* ============================================ */
.poll-section {
  margin-top: 12px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--background);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.poll-section:has(#poll-toggle:checked) {
  border-color: var(--primary-color);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.poll-section label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  user-select: none;
}

#poll-toggle {
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

/* Poll Form Container */
#poll-form {
  margin-top: 12px;
  animation: slideDown 0.3s ease;
}

#poll-form.hidden {
  display: none;
}

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

/* Poll Question Input */
#poll-question {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  transition: all 0.3s ease;
  outline: none;
}

#poll-question:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

#poll-question::placeholder {
  color: var(--text-secondary);
}

/* Poll Options Container */
#poll-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

/* Individual Poll Option */
.poll-option {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.poll-option input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  transition: all 0.3s ease;
  outline: none;
}

.poll-option input[type="text"]:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.poll-option input[type="text"]::placeholder {
  color: var(--text-secondary);
}

/* Remove Option Button */
.remove-option {
  padding: 8px 12px;
  background: var(--error);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.remove-option:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.remove-option:active {
  transform: scale(0.98);
}

/* Add Option Button */
#add-option {
  margin-top: 4px;
  padding: 8px 16px;
  background: var(--primary-light);
  color: var(--primary-color);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

#add-option:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

#add-option:active {
  transform: translateY(0);
}

/* ============================================ */
/* POLL DISPLAY - In Thread Cards */
/* ============================================ */
.poll-container {
  margin-top: 16px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--background) 100%);
  box-shadow: var(--shadow-sm);
}

.poll-container > div:first-child {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* Poll Options List in Display */
.poll-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Individual Poll Option in Display (Not Voted) */
.poll-options > div {
  position: relative;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--surface);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
}

.poll-options > div:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.poll-options > div:active {
  transform: translateX(2px) scale(0.98);
}

/* Poll Option After Voting (With Results) */
.poll-options > div[style*="cursor: default"] {
  cursor: default !important;
  border-color: transparent;
  background: var(--surface);
  padding: 8px 12px;
}

.poll-options > div[style*="cursor: default"]:hover {
  transform: none;
  border-color: transparent;
  background: var(--surface);
}

/* Progress Bar Fill Animation */
.poll-options > div > div > div {
  animation: progressSlide 0.6s ease;
}

@keyframes progressSlide {
  from {
    width: 0 !important;
  }
}

/* Poll Result Text */
.poll-options > div > div:last-child {
  font-size: 14px;
  color: var(--text-primary);
}

.poll-options > div > div:last-child strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* Vote Success Animation */
.poll-options > div[style*="background: var(--success)"] {
  animation: voteSuccess 0.5s ease;
}

@keyframes voteSuccess {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
  }
  100% {
    transform: scale(1);
  }
}

/* ============================================ */
/* RESPONSIVE - MOBILE ADJUSTMENTS */
/* ============================================ */
@media (max-width: 640px) {
  .poll-section {
    padding: 12px;
  }

  #poll-question {
    padding: 10px;
    font-size: 13px;
  }

  .poll-option input[type="text"] {
    padding: 8px 10px;
    font-size: 13px;
  }

  .remove-option {
    padding: 6px 10px;
    font-size: 12px;
  }

  #add-option {
    padding: 6px 12px;
    font-size: 13px;
  }

  .poll-container {
    padding: 12px;
  }

  .poll-options > div {
    padding: 10px 12px;
    font-size: 14px;
  }

  .poll-options > div[style*="cursor: default"] {
    padding: 6px 10px;
  }
}

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

/* Focus visible for keyboard navigation */
#poll-toggle:focus-visible,
.poll-option input[type="text"]:focus-visible,
#poll-question:focus-visible,
#add-option:focus-visible,
.remove-option:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Disabled state for max options */
#add-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--border);
  color: var(--text-secondary);
}

#add-option:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ============================================ */
/* TOAST NOTIFICATION SYSTEM */
/* Modern toast notifications to replace alerts */
/* ============================================ */

/* Toast Container - Fixed position for all toasts */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

/* Individual Toast */
.toast {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary-color);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: auto;
  animation: slideInRight 0.3s ease, fadeIn 0.3s ease;
  transition: all 0.3s ease;
}

/* Toast variants */
.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--error);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.info {
  border-left-color: var(--primary-color);
}

/* Toast icon */
.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.error .toast-icon {
  color: var(--error);
}

.toast.warning .toast-icon {
  color: var(--warning);
}

.toast.info .toast-icon {
  color: var(--primary-color);
}

/* Toast content */
.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.4;
}

.toast-message {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Close button */
.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background: var(--background);
  color: var(--text-primary);
}

/* Progress bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 0 0 12px 12px;
  animation: toastProgress 3s linear;
}

.toast.success .toast-progress {
  background: var(--success);
}

.toast.error .toast-progress {
  background: var(--error);
}

.toast.warning .toast-progress {
  background: var(--warning);
}

/* Animations */
@keyframes slideInRight {
  from {
    transform: translateX(400px);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

@keyframes toastProgress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* Removing toast */
.toast.removing {
  animation: slideOutRight 0.3s ease forwards;
}

/* Hover pause progress */
.toast:hover .toast-progress {
  animation-play-state: paused;
}

/* ============================================ */
/* MOBILE RESPONSIVE */
/* ============================================ */
@media (max-width: 640px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .toast {
    min-width: auto;
    max-width: 100%;
    padding: 14px 16px;
  }

  .toast-title {
    font-size: 14px;
  }

  .toast-message {
    font-size: 13px;
  }

  @keyframes slideInRight {
    from {
      transform: translateY(-100px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @keyframes slideOutRight {
    from {
      transform: translateY(0);
      opacity: 1;
    }
    to {
      transform: translateY(-100px);
      opacity: 0;
    }
  }
}

/* ============================================ */
/* FOOTER */
/* Simple footer with contact and copyright */
/* ============================================ */
.main-container {
  flex: 1;
}

.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  margin-top: 40px;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.footer-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-contact-label {
  font-weight: 600;
  color: var(--text-primary);
}

.footer-email {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.footer-email:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.footer-copyright {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */
@media (max-width: 640px) {
  .footer {
    padding: 20px 16px;
    margin-top: 32px;
  }

  .footer-content {
    gap: 10px;
  }

  .footer-contact {
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
  }

  .footer-copyright {
    font-size: 12px;
  }
}

.thread-content.truncated {
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Adjust line count as needed */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.see-more {
  color: #007bff;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 8px;
  display: inline-block;
}

.gray{
  color: gray;
  font-size: 0.8rem;
  align-self:center;
  margin:0;
}

.suggestion-box {
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  max-height: 150px;
  overflow-y: auto;
  z-index: 10;
}
.suggestion-item {
  padding: 8px;
  cursor: pointer;
}
.suggestion-item:hover {
  background: #f0f0f0;
}
.mention-link {
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
}
.mention-link:hover {
  text-decoration: underline;
}

/* Clickable username for threads and comments */
.clickable-username {
  cursor: pointer;
  color: var(--primary, #007bff);
  text-decoration: none;
  transition: color 0.2s ease;
}

.clickable-username:hover {
  color: var(--primary-dark, #0056b3);
  text-decoration: underline;
}

/* Profile page container */
.profile-page {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  background: var(--background, #fff);
  min-height: calc(100vh - 60px); /* Adjust for navbar height */
}

/* Profile header */
.profile-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border, #e0e0e0);
}

.profile-header h1 {
  font-size: 2rem;
  color: var(--text, #333);
  margin: 0 0 10px;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  font-size: 1rem;
  color: var(--text, #333);
}

.profile-stats div {
  background: var(--surface, #f5f5f5);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 500;
}

/* Back to feed button */
#backToFeed {
  display: block;
  margin: 0 auto 20px;
  padding: 10px 20px;
  background: var(--primary, #007bff);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s ease;
}

#backToFeed:hover {
  background: var(--primary-dark, #0056b3);
}

/* Profile threads */
.profile-threads {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.profile-threads .thread-card {
  background: var(--background, #fff);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: background 0.2s ease;
  width: 100%;
}

.profile-threads .thread-card:hover {
  background: var(--surface, #f5f5f5);
}

.profile-threads .thread-content {
  font-size: 0.9rem;
  color: var(--text, #333);
  margin-bottom: 8px;
}

.profile-threads .thread-meta {
  font-size: 0.8rem;
  color: var(--text-muted, #666);
}

/* Empty state for no threads */
.profile-threads p {
  text-align: center;
  color: var(--text-muted, #666);
  font-size: 1rem;
  padding: 20px;
}

/* Highlight animation for threads */
@keyframes highlight {
  0% { background: var(--success, #2ecc71); }
  100% { background: none; }
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .profile-page {
    padding: 10px;
  }
  .profile-header h1 {
    font-size: 1.5rem;
  }
  .profile-stats {
    flex-direction: column;
    gap: 10px;
  }
  .profile-stats div {
    padding: 6px 12px;
  }
}
/* ============================================ */
/* MOBILE OPTIMIZATION - REDDIT-STYLE LAYOUT */
/* Add these styles to your styles.css */
/* ============================================ */

/* Hamburger Menu Button (Mobile Only) */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
  transition: transform 0.2s ease;
}

.hamburger-btn:active {
  transform: scale(0.95);
}

/* Mobile Sidebar Drawer */
.mobile-sidebar-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transition: left 0.3s ease;
  overflow-y: auto;
  padding: 20px;
}

.mobile-sidebar-drawer.open {
  left: 0;
}

/* Overlay for drawer */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drawer-overlay.visible {
  display: block;
  opacity: 1;
}

/* Close button in drawer */
.drawer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 8px;
}

/* Compact info row (hashtags + online users) */
.compact-info-row {
  display: none;
  background: var(--surface);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.compact-section {
  margin-bottom: 12px;
}

.compact-section:last-child {
  margin-bottom: 0;
}

.compact-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.compact-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compact-hashtag {
  background: var(--primary-light);
  color: var(--primary-color);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.compact-hashtag:active {
  transform: scale(0.95);
}

.compact-schools {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.compact-school {
  flex: 1;
  text-align: center;
  padding: 6px;
  background: var(--background);
  border-radius: 8px;
  font-size: 11px;
}

.compact-school.active{
  background-color: var(--primary-light);
}

.compact-school-name {
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

.compact-school-count {
  color: var(--success);
  font-weight: 600;
}

/* Mobile control row wrapper */
.mobile-control-row {
  display: none;
}

/* Keep original nav-actions visible on desktop */
.nav-actions {
  display: flex;
}

/* ============================================ */
/* MOBILE RESPONSIVE (640px and below) */
/* ============================================ */
@media (max-width: 640px) {
  /* Show hamburger menu */
  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Show mobile control row */
  .mobile-control-row {
    display: flex;
  }

  /* Hide original nav-actions on mobile (use cloned version in control row) */
  .nav-container > .nav-actions {
    display: none;
  }

  /* Adjust navbar for mobile */
  .nav-container {
    padding: 8px 12px;
  }

  /* Hide desktop sidebar */
  .sidebar {
    display: none !important;
  }

  /* Show compact info row on mobile */
  .compact-info-row {
    display: block;
  }

  /* Make main container single column with more space */
  .main-container {
    grid-template-columns: 1fr;
    padding: 0 12px;
    margin: 12px auto;
    gap: 0;
  }

  /* Expand feed section to full width */
  .feed-section {
    max-width: 100%;
    width: 100%;
  }

  /* Larger thread cards on mobile */
  .thread-card {
    padding: 16px;
    margin-bottom: 12px;
    font-size: 15px;
  }

  .thread-content {
    font-size: 15px;
    line-height: 1.6;
  }

  /* Larger avatars */
  .user-avatar {
    width: 48px;
    height: 48px;
    font-size: 16px;
  }

  /* Better spacing for thread actions */
  .thread-actions {
    padding-top: 14px;
    gap: 16px;
  }

  .action-btn {
    font-size: 15px;
    padding: 8px 14px;
  }

  /* Improve create thread box */
  .create-thread {
    padding: 14px;
    margin-bottom: 16px;
  }

  .create-thread textarea {
    font-size: 15px;
    min-height: 100px;
  }

  /* Hide school selector from navbar on mobile */
  .nav-actions .school-selector {
    display: none;
  }

  /* Full width notification panel on mobile */
  .notification-panel {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    top: 56px;
    max-height: calc(100vh - 56px);
  }

  /* Remove max-height from threads container */
  .Threads {
    max-height: none;
  }

  /* Better comment nesting on mobile */
  .nested-comment {
    margin-left: 12px;
    padding-left: 12px;
  }

  /* Optimize navbar layout - Logo on top, controls below */
  .nav-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    padding: 12px;
  }

  /* Logo centered at the top */
  .logo {
    order: 1;
    text-align: center;
    font-size: 20px;
    width: 100%;
  }

  /* Control row: hamburger, notification, profile */
  .mobile-control-row {
    order: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 8px;
  }

  .hamburger-btn {
    order: 1;
  }

  .nav-actions {
    order: 2;
    display: flex;
    gap: 12px;
    align-items: center;
    width: auto;
  }

  /* Feed tabs full width at bottom */
  .feed-tabs {
    order: 3;
    width: 100%;
    margin-top: 4px;
  }
}

/* Extra small screens */
@media (max-width: 380px) {
  .thread-card {
    padding: 12px;
  }

  .create-thread {
    padding: 12px;
  }

  .compact-hashtag {
    font-size: 11px;
    padding: 3px 8px;
  }

  .compact-school {
    font-size: 10px;
    padding: 4px;
  }
}

/* Mobile Profile Menu */
.mobile-profile-menu {
  position: fixed;
  z-index: 10000;
  min-width: 180px;
}

.mobile-profile-menu.hidden {
  display: none !important;
}

/* Ensure mobile profile menu is visible above everything */
@media (max-width: 640px) {
  .mobile-profile-menu {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  }
}


/* ============================================ */
/* NOTIFICATION BUTTON & BADGE - FIXED */
/* Remove ALL other .notification-badge rules and use only this */
/* ============================================ */

/* NOTIFICATION BUTTON & BADGE - FIXED */
.notification-btn {
  position: relative;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.notification-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: #dc3545;
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  z-index: 10;
  text-align: center;
}

.notification-badge.hidden {
  display: none !important;
}

.notification-badge {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.mention-link{
  color: #007bff; text-decoration: underline; cursor: pointer;
}

/* Mobile: Adjust navigation and layout */
@media (max-width: 640px) {
  /* Auth screens take more space on mobile */
  .auth-screen {
    padding: 28px;
    border-radius: 12px;
    max-width: 90%;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }}

.gray-little {
  color: gray;
  font-size: 0.75rem;
  margin-top: 4px;
}