:root {
  --primary: #F9F9FA;
  --accent: #f53333;
  --text: #1E1E2F;
  --secondary: #2C2C3E;
  --blue: #667eea;
  --blue-hover: #5a67d8;
  --bg: #EFF2F7;
  --card-bg: #ffffff;
  --border: #e1e5e9;
  --muted: #888;
}

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

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

/* ===== HEADER — exact match to courses page ===== */
.header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  background-color: var(--text);
  color: var(--primary);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  z-index: 1000;
  padding: 0 5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100px;
}

.landing-page-container-codemate-logo {
  flex: 1;
  display: flex;
  align-items: center;
}

.landing-page-container-codemate-logo a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.navbar { flex: 1; display: flex; align-items: center; justify-content: center; gap: 25px; flex-wrap: wrap; }
.nav-link { text-decoration: none; color: inherit; font-size: 0.95rem; }
.nav-link:hover { color: var(--accent); }

.header-profile { flex: 1; display: flex; justify-content: flex-end; align-items: center; }
.header-profile-pic {
  border-radius: 50%; width: 40px; height: 40px;
  border: 2px solid #fff; cursor: pointer;
  transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

.dropdown {
  position: absolute; top: 108px; right: 5rem;
  background: #fff; border-radius: 10px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
  width: 220px; display: none; z-index: 1001;
  padding: 0.8rem 0.5rem;
}
.dropdown.show { display: block; }
.dropdown a {
  display: flex; align-items: center;
  padding: 0.8rem 1rem; text-decoration: none;
  color: #333; transition: background 0.2s; cursor: pointer;
}
.dropdown a:hover { background: #f0f0f0; }
.dropdown a i { margin-right: 10px; color: #666; }
hr { margin: 0.5rem 0.7rem; }

.topnav { display: none; align-items: center; cursor: pointer; flex-shrink: 0; }
.menu-icon { width: 28px; height: 28px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; cursor: pointer; }
.menu-icon span { background: white; display: block; height: 3px; width: 100%; border-radius: 2px; transition: all 0.3s ease; transform-origin: center; }
.menu-icon.active .bar1 { transform: translateY(9px) rotate(45deg); }
.menu-icon.active .bar2 { opacity: 0; transform: scaleX(0); }
.menu-icon.active .bar3 { transform: translateY(-9px) rotate(-45deg); }

#myLinks {
  display: none; position: fixed; top: 100px; left: 0;
  width: 100%; background: #1E1E2F; z-index: 998;
  flex-direction: column;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
#myLinks.show { display: flex; }
#myLinks a { padding: 1rem 2rem; color: white; text-decoration: none; font-weight: 500; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,0.07); transition: background 0.2s; }
#myLinks a:hover { background: rgba(255,255,255,0.05); }

/* ===== COMMUNITY HOME ===== */
.discussion-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 120px 20px 60px;
  width: 100%;
}

.discussion-page-header {
  text-align: center;
  margin-bottom: 3rem;
  margin-top: 3rem;
}

.discussion-page-heading {
  font-size: 3.5rem;
  font-weight: 850;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.discussion-page-subtitle {
  font-size: 1.1rem;
  color: var(--secondary);
  margin: 0;
  margin-top: 2rem;
}

/* ===== TOP BAR ===== */
.top-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-filters {
  display: flex;
  gap: 1rem;
  flex: 1;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 14px 20px;
  border: 2px solid var(--border);
  border-radius: 25px;
  font-size: 1rem;
  transition: border-color 0.3s;
  background: white;
  font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--blue); }

.category-filter {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 25px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
  color: #444;
  font-family: inherit;
}

.new-discussion-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.new-discussion-btn:hover { background: #d63030; transform: translateY(-1px); }

/* ===== CREATE PANEL ===== */
.create-panel {
  display: none;
  margin-bottom: 24px;
  animation: slideDown 0.25s ease;
}
.create-panel.open { display: block; }

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

.create-panel-inner {
  background: white;
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border: 2px solid var(--blue);
}

.create-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.create-panel-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.create-panel-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: #888; padding: 4px 8px;
  border-radius: 6px; transition: background 0.2s;
}
.create-panel-close:hover { background: #f0f0f0; color: #333; }

.form-row { display: flex; gap: 16px; }
.form-group { display: flex; flex-direction: column; flex: 1; margin-bottom: 14px; }
.form-group--narrow { flex: 0 0 200px; }

.form-group label {
  font-size: 0.82rem; font-weight: 600; margin-bottom: 6px;
  color: #444; text-transform: uppercase; letter-spacing: 0.4px;
}

.discuss-form input,
.discuss-form select,
.discuss-form textarea {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
  width: 100%;
}
.discuss-form select { color: #444; }
.discuss-form textarea { resize: vertical; min-height: 100px; }
.discuss-form input:focus,
.discuss-form select:focus,
.discuss-form textarea:focus { outline: none; border-color: var(--blue); }

.form-actions {
  display: flex; justify-content: flex-end;
  gap: 10px; margin-top: 4px;
}

.btn-cancel {
  background: transparent; border: 2px solid var(--border);
  color: #555; padding: 10px 22px; border-radius: 10px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: border-color 0.2s, background 0.2s; font-family: inherit;
}
.btn-cancel:hover { border-color: #aaa; background: #f5f5f5; }

.btn-submit {
  background: var(--blue); color: white; border: none;
  padding: 10px 24px; border-radius: 10px; font-weight: 600;
  font-size: 0.95rem; cursor: pointer; transition: background 0.2s;
  font-family: inherit;
}
.btn-submit:hover { background: var(--blue-hover); }

/* ===== DISCUSSION LIST ===== */
.discussion-list {
  display: grid;
  gap: 20px;
  opacity: 0;
}
.discussion-list.loaded { opacity: 1; transition: opacity 0.15s ease; }

.discussion-item {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,0.2);
}
.discussion-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}
.discussion-item.editing {
  border: 2px solid var(--blue);
  background: rgba(102,126,234,0.04);
}

.discussion-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.discussion-title { flex: 1; }

.discussion-title h3 {
  font-size: 1.3rem;
  color: #333;
  margin: 0 0 8px;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1.35;
}
.discussion-title h3:hover { color: var(--blue); }

.discussion-meta {
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
  color: #666;
  flex-wrap: wrap;
  align-items: center;
}

/* Author with avatar in discussion card meta */
.meta-author {
  display: flex;
  align-items: center;
  gap: 6px;
}
.meta-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.discussion-category {
  background-color: var(--blue);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.discussion-preview {
  color: #666;
  line-height: 1.6;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.discussion-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.like-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  transition: color 0.3s;
  font-size: 0.9rem;
  font-family: inherit;
  padding: 0;
}
.like-btn.liked { color: #e53e3e; }
.like-btn:hover { color: #e53e3e; }

.expand-btn {
  background: rgba(102,126,234,0.1);
  color: var(--blue);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  font-family: inherit;
}
.expand-btn:hover { background: rgba(102,126,234,0.2); }

.reply-quick-btn {
  background: rgba(102,126,234,0.1);
  color: var(--blue);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  font-family: inherit;
}
.reply-quick-btn:hover { background: rgba(102,126,234,0.2); }

.discussion-stats {
  display: flex;
  gap: 18px;
  font-size: 0.9rem;
  color: #888;
  align-items: center;
}

/* Inline expanded responses */
.expanded-content {
  display: none;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 2px solid #f0f2f5;
}
.expanded-content.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.response {
  background: rgba(248,250,252,0.8);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
  border-left: 4px solid var(--blue);
}
.response:last-child { margin-bottom: 0; }

.response-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

/* Small avatar for inline expanded responses */
.response-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.response-author-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.response-author { font-weight: 600; color: #333; font-size: 0.9rem; }
.response-time { font-size: 0.8rem; color: #888; }
.response p { line-height: 1.6; color: #555; margin: 0; font-size: 0.92rem; }

/* Edit controls within card */
.edit-controls { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.edit-input {
  width: 100%; padding: 8px 12px;
  border: 2px solid var(--blue); border-radius: 8px;
  font-size: 1.2rem; font-weight: 600; margin-bottom: 10px;
  font-family: inherit;
}
.edit-textarea {
  width: 100%; padding: 10px 12px;
  border: 2px solid var(--blue); border-radius: 8px;
  resize: vertical; min-height: 80px;
  font-family: inherit; font-size: 0.95rem; line-height: 1.5;
}
.edit-category-select {
  padding: 5px 12px; border: 2px solid var(--blue);
  border-radius: 20px; font-size: 0.78rem; font-weight: 600;
  background: white; color: #333; cursor: pointer; font-family: inherit;
}

.save-btn {
  background: #219b4e9d; color: white; border: none;
  padding: 7px 16px; border-radius: 6px; cursor: pointer;
  font-weight: 600; font-size: 0.85rem; font-family: inherit;
}
.save-btn:hover { background: #16a34a; }

.cancel-edit-btn {
  background: transparent; color: var(--text);
  border: 2px solid var(--blue); padding: 7px 16px;
  border-radius: 6px; cursor: pointer; font-weight: 600;
  font-size: 0.85rem; font-family: inherit;
}
.cancel-edit-btn:hover { background: rgba(102,126,234,0.1); }

.delete-btn {
  background: transparent; border: 2px solid var(--blue);
  color: var(--text); padding: 7px 16px; border-radius: 6px;
  cursor: pointer; font-weight: 600; font-size: 0.85rem; font-family: inherit;
}
.delete-btn:hover { background: #eb1717c5; color: white; border-color: #eb1717c5; }

.edit-btn-top-right {
  background: none; border: none; cursor: pointer;
  padding: 4px 8px; border-radius: 6px; transition: background 0.15s;
  flex-shrink: 0; align-self: flex-start;
}
.edit-btn-top-right:hover { background: #f0f0f0; }

/* Pagination */
.pagination {
  display: flex; justify-content: center; gap: 10px; margin-top: 24px;
}
.page-btn {
  padding: 10px 15px; border: 2px solid var(--border);
  background: white; border-radius: 8px; cursor: pointer;
  font-size: 0.9rem; transition: all 0.3s; font-family: inherit;
}
.page-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.page-btn:hover:not(.active) { border-color: var(--blue); color: var(--blue); }

.no-results { text-align: center; padding: 40px; color: #666; font-size: 1rem; }

/* ===== DETAIL PAGE ===== */
.discussion-detail-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 120px 20px 80px;
  width: 100%;
}

.detail-container { display: flex; flex-direction: column; gap: 20px; }

.detail-question-card {
  background: rgba(255,255,255,0.95);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid rgba(255,255,255,0.2);
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.detail-title-row h2 {
  margin: 0; font-size: 1.6rem; font-weight: 700;
  color: var(--text); flex: 1; line-height: 1.3;
}

.detail-content-text {
  font-size: 1rem;
  line-height: 1.7;
  color: #333;
  margin: 0 0 18px;
  white-space: pre-wrap;
}

.detail-meta-row {
  display: flex;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--muted);
  flex-wrap: wrap;
  align-items: center;
}

.detail-actions-row {
  margin-top: 14px;
}

.detail-like-btn {
  background: rgba(102,126,234,0.1);
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: #666;
  transition: all 0.3s;
  font-family: inherit;
}
.detail-like-btn.liked { color: #e53e3e; }
.detail-like-btn:hover { background: rgba(102,126,234,0.2); }

/* ===== REPLY TRIGGER BAR (collapsed) ===== */
.reply-trigger-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
  cursor: text;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.reply-trigger-bar:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 10px rgba(102,126,234,0.1);
}
.reply-trigger-placeholder {
  color: #aaa;
  font-size: 0.95rem;
  font-family: inherit;
  user-select: none;
  flex: 1;
}
.reply-avatar-sm {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

/* ===== REPLY BOX (expanded) ===== */
.inline-reply-box {
  background: white;
  border: 2px solid var(--blue);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 4px 16px rgba(102,126,234,0.1);
  animation: slideDown 0.2s ease;
}

.inline-reply-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.reply-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.reply-composer-name { font-weight: 700; font-size: 0.95rem; color: var(--text); }

.reply-textarea {
  width: 100%; padding: 12px 14px;
  border: 2px solid var(--border); border-radius: 10px;
  font-size: 0.95rem; font-family: inherit; line-height: 1.5;
  resize: vertical; min-height: 100px; transition: border-color 0.3s;
}
.reply-textarea:focus { outline: none; border-color: var(--blue); }

.inline-reply-footer {
  display: flex; justify-content: space-between;
  align-items: center; margin-top: 10px;
}
.char-count { font-size: 0.78rem; color: var(--muted); }

/* ===== ANSWERS SECTION ===== */
.answers-section {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid rgba(255,255,255,0.2);
}

.answers-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  background: rgba(248,250,252,0.8); flex-wrap: wrap;
}
.answers-count-label { font-size: 1rem; font-weight: 700; color: var(--text); flex: 1; }
.answers-sort { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: #555; }
.sort-select {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 8px; font-size: 0.85rem; background: white; cursor: pointer;
}
.answer-btn {
  background: var(--blue); color: white; border: none;
  padding: 8px 18px; border-radius: 8px; font-weight: 600;
  font-size: 0.85rem; cursor: pointer; transition: background 0.2s; font-family: inherit;
}
.answer-btn:hover { background: var(--blue-hover); }

.responses-list { padding: 0; }

/* Response card in detail view — avatar left of name */
.response-card {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.response-card:last-child { border-bottom: none; }
.response-card:hover { background: #fafbff; }

.response-card .response-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: nowrap;
}

/* Avatar in detail response card */
.response-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.response-author-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.response-card .response-author { font-weight: 700; font-size: 0.88rem; color: var(--text); }
.response-card .response-time { font-size: 0.8rem; color: var(--muted); }
.response-card .response-text { font-size: 0.93rem; line-height: 1.6; color: #333; margin: 0; white-space: pre-wrap; }

/* Response card edit/delete controls */
.response-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  padding: 4px 8px;
  border-radius: 6px;
  margin-left: auto;
  transition: background 0.15s, color 0.15s;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.response-menu-btn:hover { background: #f0f0f0; color: #555; }

.response-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.response-edit-btn {
  background: rgba(102,126,234,0.1);
  color: var(--blue);
  border: none;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  font-family: inherit;
  transition: background 0.2s;
}
.response-edit-btn:hover { background: rgba(102,126,234,0.2); }

.response-delete-btn {
  background: rgba(235,23,23,0.08);
  color: #c0392b;
  border: none;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  font-family: inherit;
  transition: background 0.2s;
}
.response-delete-btn:hover { background: rgba(235,23,23,0.18); }

.response-edit-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--blue);
  border-radius: 10px;
  font-size: 0.93rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  margin-top: 4px;
}
.response-edit-textarea:focus { outline: none; }

.response-edit-controls {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* Back button */
.back-btn {
  background: var(--blue); color: white; border: none;
  padding: 10px 22px; border-radius: 20px; cursor: pointer;
  font-weight: 600; font-size: 0.95rem; transition: background 0.3s;
  align-self: flex-start; font-family: inherit;
}
.back-btn:hover { background: var(--blue-hover); }

/* Notification */
.notification {
  position: fixed; top: 110px; right: 20px;
  background: rgba(34,197,94,0.1); color: #166534;
  border: 1px solid rgba(34,197,94,0.3); padding: 12px 20px;
  border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  display: flex; align-items: center; gap: 10px; z-index: 2000;
  animation: notifFadeIn 0.3s ease;
}
.notification.hidden { display: none; }
.notification.error { background: rgba(239,68,68,0.1); color: #991b1b; border-color: rgba(239,68,68,0.3); }
.notification button { background: transparent; border: none; font-size: 1.1rem; cursor: pointer; color: inherit; padding: 0 4px; }

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

/* ===== RESPONSIVE — exact courses page breakpoints ===== */
@media (min-width: 1000px) and (max-width: 1406px) {
  .header { padding: 0 2rem; }
  .navbar { flex-wrap: nowrap; white-space: nowrap; gap: 15px; }
}

@media (max-width: 1000px) {
  .header { padding: 0 1rem 0 2rem; }
  .navbar { flex-wrap: nowrap; white-space: nowrap; gap: 15px; }
  .landing-page-container-codemate-logo { flex: 0 0 250px; margin-right: 2rem; }
  .landing-page-container-codemate-logo a span { font-size: 1.5rem !important; }
  .landing-page-container-codemate-logo a img { height: 48px !important; width: 48px !important; }
}

@media (max-width: 1024px) {
  .header { padding: 0 2rem; }
  .dropdown { right: 2rem; }
  .landing-page-container-codemate-logo a span { font-size: 1.4rem !important; }
}

@media (max-width: 900px) {
  .landing-page-container-codemate-logo { margin-right: 0.5rem; }
}

@media (max-width: 850px) {
  .header { padding: 0 1.2rem; height: 70px; }
  .landing-page-container-codemate-logo { flex: 1; }
  .navbar { display: none; }
  .header-profile { flex: 0; margin-right: 1rem; }
  .topnav { display: flex; }
  #myLinks { top: 70px; }
  .dropdown { right: 1rem; top: 60px; }

  .discussion-page { padding: 90px 12px 50px; }
  .discussion-page-heading { font-size: 2.2rem; }
  .discussion-detail-page { padding: 90px 12px 60px; }

  .form-row { flex-direction: column; }
  .form-group--narrow { flex: 1; }
  .top-bar { flex-wrap: wrap; }
  .new-discussion-btn { width: 100%; justify-content: center; }
  .search-filters { width: 100%; flex-direction: column; }
  .discussion-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .reply-quick-btn, .expand-btn { flex: 1; }
  .discussion-stats { gap: 12px; }
}

@media (max-width: 480px) {
  .header { padding: 0 1rem; }
  .discussion-page-heading { font-size: 1.8rem; }
  .detail-title-row h2 { font-size: 1.2rem; }
  .discussion-category { font-size: 0.7rem; padding: 3px 8px; }
}

/* ===== RESPONSE CARD DROPDOWN (matches discussion edit-btn-top-right style) ===== */
.response-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  padding: 4px 8px;
  border-radius: 6px;
  margin-left: auto;
  transition: background 0.15s, color 0.15s;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.response-menu-btn:hover { background: #f0f0f0; color: #555; }

.response-dropdown {
  position: absolute;
  top: 44px;
  right: 22px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.13);
  width: 160px;
  z-index: 100;
  padding: 6px 5px;
  border: 1px solid rgba(0,0,0,0.07);
  animation: notifFadeIn 0.15s ease;
}

.response-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: #333;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
}
.response-dropdown-item:hover { background: #f0f0f0; }
.response-dropdown-item i { font-size: 0.82rem; color: #666; width: 14px; }

.response-dropdown-item.danger { color: #c0392b; }
.response-dropdown-item.danger i { color: #c0392b; }
.response-dropdown-item.danger:hover { background: rgba(235,23,23,0.08); }

.response-dropdown-divider {
  margin: 4px 8px;
  border: none;
  border-top: 1px solid rgba(0,0,0,0.08);
} 