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

:root {
  --font-serif: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  --font-sans: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-navy: #0c172d;
  --bg-navy-dark: #070e1d;
  --accent-gold: #f59e0b;
  --accent-gold-hover: #d97706;
  --gold-glow: rgba(245, 158, 11, 0.25);
  --shadow-antigravity: 0 16px 40px -10px rgba(12, 23, 45, 0.09), 0 4px 12px rgba(12, 23, 45, 0.03);
  --shadow-hover: 0 20px 48px -12px rgba(12, 23, 45, 0.16), 0 6px 16px rgba(12, 23, 45, 0.06);
}

body {
  font-family: var(--font-sans);
  background-color: #f8fafc;
  color: #1e293b;
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.serif-heading {
  font-family: var(--font-serif);
  letter-spacing: -0.02em;
}

.app-shell {
  width: min(100% - 48px, 1780px);
  margin: 0 auto;
  box-sizing: border-box;
}

.app-header {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  height: 88px;
  background: var(--bg-navy) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
}

.header-shell {
  width: 100%;
  max-width: none;
  padding-left: 24px;
  padding-right: 24px;
  height: 100%;
  display: grid;
  grid-template-columns: 340px 1fr auto;
  align-items: center;
  gap: 24px;
}

.header-shell .brand {
  grid-column: 1;
  grid-row: 1;
}

.header-shell .main-nav {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
}

.header-right-controls {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-mark {
  width: 52px;
  height: 56px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 26px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}
.brand strong {
  display: block;
  font-family: var(--font-serif);
  color: #ffffff !important;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.2px;
}
.brand-white { color: #ffffff !important; }
.brand-accent { color: var(--accent-gold) !important; }
.brand small { display: block; color: #94a3b8 !important; margin-top: 5px; font-size: 12px; font-weight: 500; }

/* Mobile Offcanvas Drawer */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 14, 29, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-drawer-overlay[hidden] {
  display: none;
}
.mobile-drawer-overlay.show {
  opacity: 1;
  visibility: visible;
}

.mobile-offcanvas-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: #0c172d;
  z-index: 1060;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}
.mobile-offcanvas-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mobile-drawer-header .brand strong {
  font-size: 18px;
}
.mobile-drawer-header .brand-mark {
  width: 38px;
  height: 38px;
  font-size: 18px;
}
.mobile-drawer-close {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mobile-drawer-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.mobile-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mobile-drawer-nav a,
.mobile-drawer-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  text-align: left;
  transition: all 0.2s ease;
  min-height: 44px;
}
.mobile-drawer-nav a i,
.mobile-drawer-nav button i {
  width: 18px;
  flex: 0 0 18px;
  color: #93b5f6;
  text-align: center;
}
.mobile-drawer-nav a:hover,
.mobile-drawer-nav button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}
.mobile-drawer-nav a.active {
  background: rgba(245, 158, 11, 0.16);
  color: var(--accent-gold);
  border-left: 3px solid var(--accent-gold);
  font-weight: 700;
}

.mobile-drawer-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-drawer-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0c172d;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
  min-height: 48px;
}

.btn-drawer-auth.secondary {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e6eefc;
  box-shadow: none;
}

.btn-drawer-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-weight: 700;
  font-size: 14px;
  min-height: 44px;
  cursor: pointer;
}

.main-nav { display: flex; justify-content: flex-start; align-items: stretch; height: 100%; gap: 24px; }
.main-nav a {
  display: flex;
  align-items: center;
  color: #cbd5e1 !important;
  font-weight: 600;
  font-size: 14px;
  position: relative;
  white-space: nowrap;
  transition: all .2s ease;
  opacity: 0.9;
}
.main-nav a:hover { color: #ffffff !important; opacity: 1; }
.main-nav a.active { color: var(--accent-gold) !important; opacity: 1; font-weight: 750; }
.main-nav a.active::after {
  content: "";
  position: absolute;
  height: 3px;
  border-radius: 8px 8px 0 0;
  background: var(--accent-gold) !important;
  box-shadow: 0 0 10px var(--accent-gold);
  left: 0;
  right: 0;
  bottom: 0;
}

.nav-category-menu {
  position: relative;
  display: flex;
  align-items: stretch;
}

.main-nav .nav-category-trigger {
  gap: 6px;
}

.main-nav .nav-category-trigger i {
  font-size: 11px;
  transition: transform 0.18s ease;
}

.nav-category-panel {
  position: absolute;
  top: calc(100% - 6px);
  left: 50%;
  z-index: 1050;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 4px;
  width: min(480px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(8px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.nav-category-menu:hover .nav-category-panel,
.nav-category-menu:focus-within .nav-category-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.nav-category-menu:hover .nav-category-trigger i,
.nav-category-menu:focus-within .nav-category-trigger i {
  transform: rotate(180deg);
}

.main-nav .nav-category-panel a {
  min-height: 42px;
  gap: 9px;
  padding: 10px 11px;
  border-radius: 7px;
  color: #172033 !important;
  font-size: 13px;
  font-weight: 750;
  opacity: 1;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav .nav-category-panel a:hover {
  background: #f1f6ff;
  color: #0d6efd !important;
}

.main-nav .nav-category-panel a::after {
  display: none;
}

.main-nav .nav-category-panel i {
  width: 18px;
  color: #0d6efd;
  font-size: 16px;
}

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

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  border: 0;
  background: transparent;
  color: #061f50;
  font-size: 24px;
  position: relative;
  border-radius: 10px;
  transition: background .18s ease, color .18s ease;
}

.icon-btn:hover {
  background: #f1f6ff;
  color: var(--primary);
}

.app-header .icon-btn {
  color: #e6eefc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.app-header .icon-btn:hover,
.app-header .icon-btn:focus-visible {
  color: #ffffff;
  background: rgba(13, 95, 232, 0.95);
  border-color: rgba(255, 255, 255, 0.2);
}

.notification-btn {
  color: #e6eefc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.notification-btn:hover {
  color: #fff;
  background: #0d5fe8;
  border-color: rgba(255, 255, 255, 0.2);
}

.header-search-btn {
  color: #25466f;
  background: #fff;
  border: 1px solid #dbe5f1;
}

.notification-btn span {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: #ef3030;
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.header-notification {
  position: relative;
}

.notification-popover {
  top: calc(100% + 12px) !important;
  right: -6px !important;
  left: auto !important;
  width: min(390px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d7e1ee;
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(8, 40, 92, .2);
}

.notification-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 10px;
}

.notification-popover-head h2 {
  margin: 0;
  color: #08285c;
  font-size: 22px;
}

.notification-popover-head form {
  margin: 0;
}

.notification-popover-head button {
  padding: 4px;
  color: #0d5fe8;
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 800;
}

.notification-popover-head button:hover {
  text-decoration: underline;
}

.notification-popover-head button:disabled {
  color: #9aa7b8;
  text-decoration: none;
  cursor: default;
}

.notification-filters {
  display: flex;
  gap: 6px;
  padding: 0 18px 10px;
  border-bottom: 1px solid #e3e9f1;
}

.notification-filters button {
  min-height: 34px;
  padding: 0 12px;
  color: #53657d;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.notification-filters button:hover {
  color: #0d5fe8;
  background: #f2f6fc;
}

.notification-filters button.active {
  color: #0d5fe8;
  background: #e9f2ff;
}

.notification-popover-list {
  max-height: min(440px, calc(100vh - 190px));
  overflow-y: auto;
  padding: 6px;
}

.notification-popover-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 10px;
  align-items: start;
  gap: 11px;
  padding: 10px;
  color: #17335c;
  border-radius: 6px;
  transition: background .15s ease;
}

.notification-popover-item:hover {
  color: #17335c;
  background: #f2f6fb;
}

.notification-popover-item.unread {
  background: #edf5ff;
}

.notification-popover-item.unread:hover {
  background: #e2efff;
}

.notification-popover-item[hidden] {
  display: none;
}

.notification-item-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #0960de;
  background: #dcecff;
  border-radius: 50%;
  font-size: 18px;
}

.notification-item-icon.reaction {
  color: #a65d00;
  background: #fff0cf;
}

.notification-item-icon.achievement {
  color: #7a3db4;
  background: #f0e5fb;
}

.notification-item-icon.moderation {
  color: #16804d;
  background: #ddf5e9;
}

.notification-item-copy {
  min-width: 0;
}

.notification-item-copy strong,
.notification-item-copy small,
.notification-item-copy time {
  display: block;
}

.notification-item-copy strong {
  color: #0b2855;
  font-size: 13px;
  line-height: 1.35;
}

.notification-item-copy small {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  color: #5d6d83;
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-item-copy time {
  margin-top: 4px;
  color: #0d5fe8;
  font-size: 11px;
  font-weight: 750;
}

.notification-unread-dot {
  align-self: center;
  width: 8px;
  height: 8px;
  background: #0d5fe8;
  border-radius: 50%;
}

.notification-popover-empty {
  min-height: 205px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  color: #687991;
  text-align: center;
}

.notification-popover-empty[hidden] {
  display: none;
}

.notification-popover-empty>i {
  margin-bottom: 5px;
  color: #88a2c3;
  font-size: 30px;
}

.notification-popover-empty strong {
  color: #17335c;
  font-size: 14px;
}

.notification-popover-empty span {
  font-size: 12px;
  line-height: 1.45;
}

.notification-popover-footer {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #0d5fe8;
  background: #f8fafc;
  border-top: 1px solid #e2e9f2;
  font-size: 13px;
  font-weight: 800;
}

.notification-popover-footer:hover {
  color: #084db8;
  background: #f1f6fc;
}

.profile-toggle {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff !important;
  border-radius: 30px;
  padding: 6px 16px 6px 8px;
  backdrop-filter: blur(10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
  font-size: 18px;
}

.profile-toggle strong {
  display: block;
  text-align: left;
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.profile-toggle small {
  display: block;
  text-align: left;
  color: #94a3b8 !important;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

.profile-toggle i.bi-chevron-down {
  color: #cbd5e1;
  font-size: 12px;
  margin-left: 2px;
}

.profile-toggle:hover strong,
.profile-toggle:focus-visible strong {
  color: #ffffff !important;
}

.profile-toggle:hover small,
.profile-toggle:focus-visible small,
.profile-toggle:hover i.bi-chevron-down,
.profile-toggle:focus-visible i.bi-chevron-down {
  color: #e2e8f0 !important;
}

.auth-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #f8fafc !important;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.auth-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.34);
  transform: translateY(-1px);
}

.auth-link.primary {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

.auth-link.primary:hover {
  color: white;
  background: #0754d9;
  border-color: #0754d9;
}

.guest-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: #e6eefc;
  background: rgba(255, 255, 255, 0.08);
  font-size: 20px;
}

.logout-form {
  margin: 0;
}

.logout-form .dropdown-item {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
}

.page-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 360px;
  gap: 24px;
  padding: 22px 0 24px;
}

.home-grid {
  grid-template-columns: 280px minmax(0, 1fr) 310px;
}

.ilanlar-grid {
  grid-template-columns: 300px minmax(0, 1fr) 330px;
}

.left-rail,
.right-rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.main-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.app-footer {
  background: linear-gradient(90deg, #08285c, #061e48);
  color: white;
  min-height: 60px;
}

.footer-shell {
  min-height: 60px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.footer-shell nav {
  display: flex;
  gap: 42px;
}

.footer-shell .socials {
  justify-self: end;
  display: flex;
  gap: 28px;
  font-size: 22px;
}

@media (max-width: 1320px) {
  .header-shell {
    grid-template-columns: 270px minmax(0, 1fr) auto;
    gap: 12px;
  }

  .brand strong {
    font-size: 21px;
  }

  .brand small {
    font-size: 12px;
  }

  .main-nav {
    gap: 10px;
  }

  .main-nav a {
    font-size: 13px;
  }

  .header-actions {
    gap: 8px;
  }

  .profile-toggle span:not(.avatar) {
    display: none;
  }
}
