/* =============================================
   NotumBurda — Design System & Global Styles
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Colors — Dark Theme */
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-tertiary: #1a1a3e;
  --bg-card: rgba(26, 26, 62, 0.6);
  --bg-card-hover: rgba(35, 35, 80, 0.8);
  --bg-input: rgba(20, 20, 50, 0.8);
  --bg-glass: rgba(26, 26, 62, 0.4);

  --border-color: rgba(99, 102, 241, 0.15);
  --border-hover: rgba(99, 102, 241, 0.35);
  --border-active: rgba(129, 140, 248, 0.6);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #a5b4fc;

  --accent-primary: #6366f1;
  --accent-primary-hover: #818cf8;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  --accent-gradient-hover: linear-gradient(135deg, #818cf8, #a78bfa, #c084fc);

  --upvote: #22c55e;
  --downvote: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --category-ders-notu: #22d3ee;
  --category-cikmis-soru: #fb923c;
  --category-soru-cevap: #a78bfa;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-base: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 2rem;
  --font-4xl: 2.5rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --shadow-glow-lg: 0 0 40px rgba(99, 102, 241, 0.2);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --max-width: 1280px;
  --sidebar-width: 300px;
  --navbar-height: 64px;
}

/* ── Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(139, 92, 246, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(99, 102, 241, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-primary-hover);
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

/* ── Utility Classes ── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: box-shadow var(--transition-base);
}

.navbar.scrolled {
  box-shadow: var(--shadow-lg);
}

.navbar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: var(--space-lg);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-xl);
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-lg);
  box-shadow: var(--shadow-glow);
}

.navbar-brand .brand-text span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search Bar */
.search-wrapper {
  flex: 1;
  max-width: 560px;
  position: relative;
}

.search-bar {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-md) 0 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--font-sm);
  transition: all var(--transition-base);
  outline: none;
}

.search-bar::placeholder {
  color: var(--text-muted);
}

.search-bar:focus {
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow);
  background: var(--bg-tertiary);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--font-base);
  pointer-events: none;
}

/* Navbar Actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.navbar-actions .nav-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: var(--font-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.navbar-actions .nav-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-card);
}

.navbar-actions .nav-btn.primary {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-glow);
}

.navbar-actions .nav-btn.primary:hover {
  background: var(--accent-gradient-hover);
  box-shadow: var(--shadow-glow-lg);
  transform: translateY(-1px);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-sm);
  color: #fff;
  cursor: pointer;
  transition: transform var(--transition-fast);
  border: 2px solid transparent;
  flex-shrink: 0;
}

.user-avatar:hover {
  transform: scale(1.08);
  border-color: var(--accent-primary-hover);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-base);
  z-index: 100;
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  transition: all var(--transition-fast);
  width: 100%;
  text-align: left;
}

.user-dropdown .dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.user-dropdown .dropdown-separator {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-xs) 0;
}

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  padding: 8px;
  color: var(--text-secondary);
  font-size: var(--font-xl);
}

/* ── Main Layout ── */
.main-layout {
  display: flex;
  gap: var(--space-xl);
  padding-top: calc(var(--navbar-height) + var(--space-xl));
  position: relative;
  z-index: 1;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--navbar-height) + var(--space-xl));
  height: fit-content;
  max-height: calc(100vh - var(--navbar-height) - var(--space-2xl));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

.sidebar-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  transition: border-color var(--transition-base);
}

.sidebar-card:hover {
  border-color: var(--border-hover);
}

.sidebar-card h3 {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

/* Filter inputs in sidebar */
.filter-group {
  margin-bottom: var(--space-md);
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group label {
  display: block;
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-select,
.filter-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-sm);
  transition: all var(--transition-fast);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Category pills in sidebar */
.category-pills {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.category-pill {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  width: 100%;
  text-align: left;
}

.category-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.category-pill.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-accent);
  border-color: rgba(99, 102, 241, 0.2);
}

.category-pill .pill-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.category-pill[data-category="all"] .pill-dot {
  background: var(--accent-primary);
}

.category-pill[data-category="ders-notu"] .pill-dot {
  background: var(--category-ders-notu);
}

.category-pill[data-category="cikmis-soru"] .pill-dot {
  background: var(--category-cikmis-soru);
}

.category-pill[data-category="soru-cevap"] .pill-dot {
  background: var(--category-soru-cevap);
}

/* Sort tabs */
.sort-tabs {
  display: flex;
  gap: var(--space-xs);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.sort-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
  background: transparent;
  border: none;
}

.sort-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.sort-tab.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* ── Post Cards ── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.post-card {
  display: flex;
  gap: var(--space-md);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  transition: all var(--transition-base);
  cursor: pointer;
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

.post-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Vote column */
.vote-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  min-width: 40px;
}

.vote-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  font-size: var(--font-lg);
}

.vote-btn:hover {
  background: var(--bg-card-hover);
}

.vote-btn.upvote:hover,
.vote-btn.upvote.active {
  color: var(--upvote);
  background: rgba(34, 197, 94, 0.1);
}

.vote-btn.downvote:hover,
.vote-btn.downvote.active {
  color: var(--downvote);
  background: rgba(239, 68, 68, 0.1);
}

.vote-count {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  padding: 4px 0;
}

/* Post body */
.post-body {
  flex: 1;
  min-width: 0;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.post-category {
  font-size: var(--font-xs);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.post-category[data-cat="ders-notu"] {
  background: rgba(34, 211, 238, 0.12);
  color: var(--category-ders-notu);
}

.post-category[data-cat="cikmis-soru"] {
  background: rgba(251, 146, 60, 0.12);
  color: var(--category-cikmis-soru);
}

.post-category[data-cat="soru-cevap"] {
  background: rgba(167, 139, 250, 0.12);
  color: var(--category-soru-cevap);
}

.post-university {
  font-size: var(--font-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-author {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

.post-author strong {
  color: var(--text-accent);
  font-weight: 600;
}

.post-time {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.meta-dot {
  color: var(--text-muted);
  font-size: var(--font-xs);
}

.post-title {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-title:hover {
  color: var(--text-accent);
}

.post-excerpt {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.post-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.post-action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.post-action-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.post-action-btn.bookmarked {
  color: var(--warning);
}

/* ── Post Detail Page ── */
.post-detail {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.post-detail .post-title {
  font-size: var(--font-2xl);
  -webkit-line-clamp: unset;
  margin-bottom: var(--space-md);
}

.post-detail .post-content {
  font-size: var(--font-base);
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
}

/* ── Comments ── */
.comments-section {
  margin-top: var(--space-xl);
}

.comments-header {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.comments-header .count-badge {
  background: var(--accent-primary);
  color: #fff;
  font-size: var(--font-xs);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.comment-form {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.comment-form textarea {
  flex: 1;
  min-height: 80px;
  padding: var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
}

.comment-form textarea:focus {
  border-color: var(--border-active);
}

.comment-form .submit-comment-btn {
  align-self: flex-end;
}

.comment-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-left: 2px solid var(--border-color);
  margin-left: var(--space-md);
  margin-bottom: var(--space-md);
  transition: border-color var(--transition-fast);
  animation: fadeInUp 0.3s ease forwards;
  opacity: 0;
}

.comment-card:hover {
  border-left-color: var(--accent-primary);
}

.comment-card.reply {
  margin-left: calc(var(--space-md) + var(--space-xl));
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-xs);
  color: #fff;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-author {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-accent);
  margin-bottom: 2px;
}

.comment-time {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.comment-text {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.comment-action {
  font-size: var(--font-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-fast);
}

.comment-action:hover {
  color: var(--text-primary);
}

/* ── Auth Page ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  position: relative;
  z-index: 1;
}

.auth-container {
  width: 100%;
  max-width: 480px;
}

.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-xl);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-header .auth-logo {
  width: 56px;
  height: 56px;
  background: var(--accent-gradient);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  font-size: var(--font-2xl);
  box-shadow: var(--shadow-glow-lg);
}

.auth-header h1 {
  font-size: var(--font-2xl);
  font-weight: 800;
  margin-bottom: var(--space-xs);
}

.auth-header h1 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

/* Auth tabs */
.auth-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: var(--space-xl);
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.auth-tab.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* Form groups */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-row {
  display: flex;
  gap: var(--space-md);
}

.form-row .form-group {
  flex: 1;
}

.form-group label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--font-sm);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--font-sm);
  transition: all var(--transition-fast);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-select:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Primary Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-size: var(--font-sm);
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  box-shadow: var(--shadow-glow-lg);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 14px 28px;
  font-size: var(--font-base);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}

.btn.loading .spinner {
  display: block;
}

.btn.loading .btn-text {
  opacity: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Create Post Page ── */
.create-post-page {
  padding-top: calc(var(--navbar-height) + var(--space-2xl));
  padding-bottom: var(--space-2xl);
  position: relative;
  z-index: 1;
}

.create-post-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
}

.create-post-card h1 {
  font-size: var(--font-2xl);
  font-weight: 800;
  margin-bottom: var(--space-xl);
}

.create-post-card h1 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-textarea {
  width: 100%;
  min-height: 200px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--font-sm);
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-textarea:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea::placeholder {
  color: var(--text-muted);
}

/* Category selector as cards */
.category-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.category-option {
  position: relative;
}

.category-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.category-option .category-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.category-option .category-label:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.category-option input:checked+.category-label {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.category-option .cat-icon {
  font-size: var(--font-2xl);
}

.category-option .cat-name {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.category-option .cat-desc {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

/* ── Profile Page ── */
.profile-page {
  padding-top: calc(var(--navbar-height) + var(--space-2xl));
  padding-bottom: var(--space-2xl);
  position: relative;
  z-index: 1;
}

.profile-header-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-3xl);
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow-lg);
}

.profile-info h1 {
  font-size: var(--font-2xl);
  font-weight: 800;
  margin-bottom: 4px;
}

.profile-info .profile-uni {
  color: var(--text-accent);
  font-size: var(--font-sm);
  font-weight: 500;
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.profile-info .profile-joined {
  color: var(--text-muted);
  font-size: var(--font-xs);
}

.profile-stats {
  display: flex;
  gap: var(--space-xl);
  margin-left: auto;
}

.profile-stat {
  text-align: center;
}

.profile-stat .stat-value {
  font-size: var(--font-2xl);
  font-weight: 800;
  color: var(--text-primary);
}

.profile-stat .stat-label {
  font-size: var(--font-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Profile tabs */
.profile-tabs {
  display: flex;
  gap: var(--space-xs);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.profile-tab {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  transition: all var(--transition-fast);
  cursor: pointer;
  background: transparent;
  border: none;
}

.profile-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.profile-tab.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + var(--space-md));
  right: var(--space-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: var(--font-sm);
  color: var(--text-primary);
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 380px;
}

.toast.success {
  border-left: 3px solid var(--upvote);
}

.toast.error {
  border-left: 3px solid var(--downvote);
}

.toast.info {
  border-left: 3px solid var(--info);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg,
      var(--bg-card) 25%,
      var(--bg-card-hover) 50%,
      var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-card {
  height: 140px;
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-sm);
  width: 80%;
}

.skeleton-text.short {
  width: 40%;
}

.skeleton-text.medium {
  width: 60%;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  font-size: var(--font-sm);
  max-width: 400px;
  margin: 0 auto var(--space-lg);
}

/* ── Pagination / Load More ── */
.load-more-wrapper {
  text-align: center;
  padding: var(--space-xl) 0;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .main-layout {
    flex-direction: column;
    gap: var(--space-md);
  }

  .sidebar {
    width: 100%;
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-md);
  }

  .sidebar-card {
    flex: 1;
    min-width: 200px;
  }

  .category-pills {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .category-pill {
    width: auto;
    padding: 8px 14px;
    font-size: var(--font-xs);
  }
}

@media (max-width: 768px) {
  :root {
    --navbar-height: 56px;
  }

  .navbar-inner {
    padding: 0 var(--space-md);
  }

  /* Desktop search alanını gizle */
  .search-wrapper {
    display: none;
  }

  /* Overlay içindeki search alanını GÖSTER (Override) */
  .mobile-search-overlay .search-wrapper {
    display: flex;
    width: 100%;
    max-width: 90vw;
  }

  .navbar-brand .brand-text {
    display: none;
  }

  .navbar-actions .nav-btn .btn-label {
    display: none;
  }

  /* Logged-out durumu icon hizalaması */
  .navbar-actions .nav-btn,
  .mobile-menu-btn,
  .user-avatar {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-lg);
  }

  /* Logged-in menü boşluk hizalaması */
  #user-menu,
  #auth-buttons {
    gap: 12px !important;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .main-layout {
    /* Navbar'ın yüksekliği + biraz boşluk (fazla değil) */
    padding-top: calc(var(--navbar-height) + var(--space-xl)) !important;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .sidebar-card {
    min-width: 100%;
    padding: var(--space-md);
  }

  .sidebar-card h3 {
    font-size: var(--font-xs);
    margin-bottom: var(--space-sm);
  }

  .post-card {
    padding: var(--space-md);
  }

  .vote-column {
    min-width: 30px;
  }

  .vote-btn {
    width: 28px;
    height: 28px;
    font-size: var(--font-sm);
  }

  .post-title {
    font-size: var(--font-base);
  }

  .post-excerpt {
    -webkit-line-clamp: 2;
    font-size: var(--font-xs);
  }

  .post-meta {
    gap: var(--space-xs);
  }

  .auth-card {
    padding: var(--space-lg);
  }

  .auth-header .auth-logo {
    width: 48px;
    height: 48px;
    font-size: var(--font-xl);
  }

  .auth-header h1 {
    font-size: var(--font-xl);
  }

  .category-selector {
    grid-template-columns: 1fr !important;
  }

  .profile-header-card {
    flex-direction: column;
    text-align: center;
    padding: var(--space-lg);
  }

  .profile-avatar {
    width: 64px;
    height: 64px;
    font-size: var(--font-2xl);
  }

  .profile-stats {
    margin-left: 0;
  }

  .create-post-card {
    padding: var(--space-lg);
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .post-detail {
    padding: var(--space-md);
  }

  .post-detail .post-title {
    font-size: var(--font-xl);
  }

  .comment-form {
    flex-direction: column;
  }

  .comment-card {
    padding: var(--space-md);
    margin-left: var(--space-sm);
  }

  .comment-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.625rem;
  }

  .user-dropdown {
    right: -8px;
    min-width: 200px;
  }
}

@media (max-width: 480px) {
  .post-actions {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .comment-card.reply {
    margin-left: var(--space-md);
  }

  .profile-tabs {
    flex-direction: column;
  }

  .sidebar {
    gap: var(--space-sm);
  }

  .filter-select {
    font-size: var(--font-xs);
    padding: 8px 12px;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ── Selection ── */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

/* ── Back Button ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 500;
  margin-bottom: var(--space-lg);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.back-link:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ── Mobile Search Overlay ── */
.mobile-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 26, 0.95);
  z-index: 2000;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(var(--navbar-height) + var(--space-xl)) var(--space-md) var(--space-md);
}

.mobile-search-overlay.active {
  display: flex;
}

.mobile-search-overlay .search-bar {
  width: 100%;
  height: 50px;
  font-size: var(--font-base);
}

.mobile-search-overlay .close-search {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  color: #fff;
  font-size: 28px;
  padding: var(--space-sm);
  background: transparent;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

/* ── Reply Form ──*/
.reply-form {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.reply-form textarea {
  flex: 1;
  min-height: 60px;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-sm);
  resize: none;
  outline: none;
}

.reply-form textarea:focus {
  border-color: var(--border-active);
}

/* ── Error message ── */
.form-error {
  color: var(--downvote);
  font-size: var(--font-xs);
  margin-top: var(--space-xs);
  display: none;
}

.form-error.visible {
  display: block;
}

/* ── Auth toggle link ── */
.auth-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--text-accent);
  font-weight: 600;
}