/* Top navigation bar — shared across landing, catalog, design view, profile */

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(20, 20, 20, 0.97);
  border-bottom: 1px solid #181818;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Push page content below the fixed nav on all pages that use it */
body:has(.top-nav) {
  padding-top: 60px;
}

.top-nav-inner {
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Logo */
.top-nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.top-nav-logo img {
  height: 30px;
  width: auto;
}

/* Nav links */
.top-nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
}

.top-nav-link {
  color: #555;
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.top-nav-link:hover,
.top-nav-link.active {
  color: #d8d8d8;
  background: #181818;
}

/* Auth section */
.top-nav-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.top-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.top-nav-btn-ghost {
  background: transparent;
  color: #555;
  border: 1px solid #222;
}

.top-nav-btn-ghost:hover {
  color: #d8d8d8;
  background: #181818;
  border-color: #2e2e2e;
}

.top-nav-btn-primary {
  background: #c8a96e;
  color: #141414;
  font-weight: 600;
}

.top-nav-btn-primary:hover {
  opacity: 0.88;
}

/* Avatar */
.top-nav-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid #222;
  text-decoration: none;
  transition: border-color 0.15s;
}

.top-nav-avatar:hover {
  border-color: #c8a96e;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initials {
  font-size: 0.72rem;
  font-weight: 600;
  color: #c8a96e;
  background: #181818;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* User dropdown */
.nav-user-menu {
  position: relative;
}

.nav-user-trigger {
  background: none;
  border: 1px solid #222;
  cursor: pointer;
  padding: 0;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #141414;
  border: 1px solid #222;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200;
  overflow: hidden;
}

.nav-dropdown-user {
  padding: 0.65rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-dropdown-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #d8d8d8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dropdown-username {
  font-size: 0.7rem;
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dropdown-divider {
  height: 1px;
  background: #1e1e1e;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.9rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  color: #888;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
  box-sizing: border-box;
}

.nav-dropdown-item:hover {
  background: #1a1a1a;
  color: #d8d8d8;
}

.nav-dropdown-signout:hover {
  color: #c0392b;
}

/* Notification badge on avatar */
.nav-notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: #e53e3e;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  border-radius: 7px;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  box-sizing: border-box;
  z-index: 1;
}

.nav-notif-badge.is-visible {
  display: flex;
}

/* Notification section in dropdown */
.nav-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.9rem;
}

.nav-notif-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-notif-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: #e53e3e;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  border-radius: 7px;
  line-height: 1;
  box-sizing: border-box;
}

.nav-notif-mark-read {
  font-size: 0.65rem;
  color: #444;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s;
  padding: 0;
}

.nav-notif-mark-read:hover {
  color: #888;
}

.nav-notif-item {
  font-size: 0.75rem;
  line-height: 1.4;
  align-items: flex-start;
  white-space: normal;
  min-width: 200px;
  max-width: 260px;
}

.nav-notif-text {
  display: block;
}

.nav-notif-actor {
  color: #d8d8d8;
  font-weight: 600;
}

.nav-notif-item em {
  color: #c8a96e;
  font-style: normal;
}

.nav-notif-unread {
  background: rgba(52, 148, 124, 0.06);
}

.nav-notif-unread:hover {
  background: rgba(52, 148, 124, 0.11);
}

.nav-notif-loading,
.nav-notif-empty {
  padding: 0.5rem 0.9rem;
  font-size: 0.72rem;
  color: #444;
}

/* Hamburger button (hidden on desktop) */
.top-nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.top-nav-hamburger:hover {
  color: #d8d8d8;
  background: #181818;
}

.nav-hamburger-close {
  display: none;
}

.top-nav-hamburger[aria-expanded="true"] .nav-hamburger-icon {
  display: none;
}

.top-nav-hamburger[aria-expanded="true"] .nav-hamburger-close {
  display: block;
}

/* Mobile nav panel (hidden by default) */
.top-nav-mobile-menu {
  display: none;
  flex-direction: column;
  border-top: 1px solid #181818;
  padding: 0.4rem 0;
}

.top-nav-mobile-link {
  padding: 0.7rem 1.25rem;
  color: #888;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

.top-nav-mobile-link:hover {
  background: #181818;
  color: #d8d8d8;
}

/* Mobile */
@media (max-width: 600px) {
  .top-nav-links {
    display: none;
  }

  .top-nav-inner {
    gap: 0.5rem;
    padding: 0 1.25rem;
  }

  .top-nav-auth {
    margin-left: auto;
  }

  .top-nav-hamburger {
    display: flex;
  }

  .top-nav-mobile-menu.is-open {
    display: flex;
  }
}

/* ==========================================================================
   Publish modal
   ========================================================================== */

.publish-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 1rem;
}

.publish-overlay[hidden] {
  display: none;
}

.publish-overlay.publish-overlay-visible {
  opacity: 1;
}

.publish-modal {
  background: #1a1a1a;
  border: 1px solid #222;
  border-radius: 6px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.publish-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid #1e1e1e;
}

.publish-modal-title {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #ebebeb;
  margin: 0;
  letter-spacing: -0.02em;
}

.publish-modal-close {
  background: none;
  border: none;
  color: #444;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  transition: color 0.15s;
}

.publish-modal-close:hover {
  color: #d8d8d8;
}

.publish-form {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.publish-form[hidden],
.publish-modal-header[hidden] {
  display: none;
}

.publish-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Tag pills */
.publish-tags-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  background: #141414;
  border: 1px solid #222;
  border-radius: 4px;
  padding: 0.4rem 0.5rem;
  min-height: 38px;
  cursor: text;
  transition: border-color 0.15s;
}

.publish-tags-container:focus-within {
  border-color: #c8a96e;
}

.publish-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  color: #d8d8d8;
  font-size: 0.75rem;
  padding: 0.18rem 0.45rem;
  line-height: 1;
  white-space: nowrap;
}

.publish-tag-pill[data-tag="challenge"]     { color: #e8c060; border-color: rgba(232, 192, 96,  0.4); }
.publish-tag-pill[data-tag="showcase"]      { color: #6bbf8a; border-color: rgba(107, 191, 138, 0.4); }
.publish-tag-pill[data-tag="rate my build"] { color: #6699cc; border-color: rgba(102, 153, 204, 0.4); }
.publish-tag-pill[data-tag="help wanted"]   { color: #cc7060; border-color: rgba(204, 112, 96,  0.4); }
.publish-tag-pill[data-tag="meta"]          { color: #9977bb; border-color: rgba(153, 119, 187, 0.4); }

.publish-tag-remove {
  background: none;
  border: none;
  color: #444;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.publish-tag-remove:hover {
  color: #d8d8d8;
}

.publish-tags-input {
  background: none;
  border: none;
  outline: none;
  color: #d8d8d8;
  font-family: inherit;
  font-size: 0.875rem;
  flex: 1;
  min-width: 80px;
  padding: 0.1rem 0.25rem;
}

.publish-tags-input::placeholder {
  color: #333;
}

.publish-tags-add {
  background: none;
  border: none;
  color: #555;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
  transition: color 0.15s;
  flex-shrink: 0;
}

.publish-tags-add:hover {
  color: #c8a96e;
}

.publish-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.publish-required {
  color: #c8a96e;
}

.publish-input,
.publish-textarea {
  background: #141414;
  border: 1px solid #222;
  border-radius: 4px;
  color: #d8d8d8;
  font-size: 0.875rem;
  padding: 0.55rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s;
}

.publish-input:focus,
.publish-textarea:focus {
  outline: none;
  border-color: #c8a96e;
}

.publish-input::placeholder,
.publish-textarea::placeholder {
  color: #333;
}

.publish-textarea {
  resize: vertical;
  min-height: 90px;
}

/* Type picker */
.publish-type-picker {
  display: flex;
  gap: 1px;
  background: #111;
  border: 1px solid #222;
  border-radius: 4px;
  overflow: hidden;
}

.publish-type-option {
  flex: 1;
  padding: 0.45rem 0.5rem;
  background: #141414;
  border: none;
  color: #555;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-align: center;
}

.publish-type-option:hover {
  background: #1a1a1a;
  color: #888;
}

.publish-type-option.is-active {
  background: #1e1e1e;
  color: #c8a96e;
}

/* Tag input autocomplete */
.publish-tags-field-wrapper {
  position: relative;
}

.publish-tags-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-top: none;
  border-radius: 0 0 4px 4px;
  z-index: 10;
  max-height: 180px;
  overflow-y: auto;
}

.publish-ac-item {
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  color: #666;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.publish-ac-item:hover,
.publish-ac-item.is-focused {
  background: #222;
  color: #d8d8d8;
}

.publish-ac-item mark {
  background: none;
  color: #c8a96e;
  font-weight: 600;
}

/* Tag suggestions */
.publish-tag-suggestions {
  margin-top: 0.5rem;
}

.publish-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.publish-suggestion-chip {
  background: #141414;
  border: 1px solid #1e1e1e;
  border-radius: 3px;
  color: #444;
  font-family: inherit;
  font-size: 0.72rem;
  padding: 0.18rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  line-height: 1.4;
}

.publish-suggestion-chip:hover {
  border-color: #2a2a2a;
  color: #888;
}

.publish-suggestion-chip.is-selected {
  background: rgba(200, 169, 110, 0.08);
  border-color: rgba(200, 169, 110, 0.3);
  color: #c8a96e;
}

.publish-suggestion-chip.is-category {
  border-color: #2a2520;
  color: #6b5e4a;
}

.publish-suggestion-chip.is-category:hover {
  border-color: rgba(200, 169, 110, 0.3);
  color: #a8895a;
}

.publish-suggestion-chip.is-category.is-selected {
  background: rgba(200, 169, 110, 0.1);
  border-color: rgba(200, 169, 110, 0.45);
  color: #c8a96e;
}

.publish-suggestion-chip[data-tag="showcase"] { color: #6bbf8a; border-color: rgba(107, 191, 138, 0.35); }
.publish-suggestion-chip[data-tag="showcase"]:hover { color: #88d4a4; border-color: rgba(107, 191, 138, 0.55); }
.publish-suggestion-chip[data-tag="showcase"].is-selected { background: rgba(107, 191, 138, 0.1); border-color: rgba(107, 191, 138, 0.55); color: #88d4a4; }

.publish-suggestion-chip[data-tag="rate my build"] { color: #6699cc; border-color: rgba(102, 153, 204, 0.35); }
.publish-suggestion-chip[data-tag="rate my build"]:hover { color: #88b2dd; border-color: rgba(102, 153, 204, 0.55); }
.publish-suggestion-chip[data-tag="rate my build"].is-selected { background: rgba(102, 153, 204, 0.1); border-color: rgba(102, 153, 204, 0.55); color: #88b2dd; }

.publish-suggestion-chip[data-tag="help wanted"] { color: #cc7060; border-color: rgba(204, 112, 96, 0.35); }
.publish-suggestion-chip[data-tag="help wanted"]:hover { color: #dd8878; border-color: rgba(204, 112, 96, 0.55); }
.publish-suggestion-chip[data-tag="help wanted"].is-selected { background: rgba(204, 112, 96, 0.1); border-color: rgba(204, 112, 96, 0.55); color: #dd8878; }

.publish-suggestion-chip[data-tag="meta"] { color: #9977bb; border-color: rgba(153, 119, 187, 0.35); }
.publish-suggestion-chip[data-tag="meta"]:hover { color: #b094cc; border-color: rgba(153, 119, 187, 0.55); }
.publish-suggestion-chip[data-tag="meta"].is-selected { background: rgba(153, 119, 187, 0.1); border-color: rgba(153, 119, 187, 0.55); color: #b094cc; }

.publish-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #888;
  font-size: 0.875rem;
  cursor: pointer;
}

.publish-checkbox-label input[type="checkbox"] {
  accent-color: #c8a96e;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.publish-hint {
  color: #444;
  font-size: 0.78rem;
}


.publish-error {
  background: rgba(180, 60, 60, 0.15);
  border: 1px solid rgba(180, 60, 60, 0.4);
  border-radius: 3px;
  color: #e07070;
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
}

.publish-error[hidden] {
  display: none;
}

.publish-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.publish-success {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.publish-success[hidden] {
  display: none;
}

.publish-success-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(200, 169, 110, 0.1);
  border: 1px solid rgba(200, 169, 110, 0.3);
  color: #c8a96e;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.publish-success-text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.publish-success-msg {
  color: #ebebeb;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.publish-success-sub {
  color: #555;
  font-size: 0.825rem;
  margin: 0;
}

.publish-success-actions {
  display: flex;
  gap: 0.75rem;
}

#publish-success-link,
.publish-success-actions a.hoi4-btn {
  text-decoration: none;
}

@media (max-width: 500px) {
  .publish-row {
    flex-direction: column;
  }

  .publish-success-actions {
    flex-direction: column;
    width: 100%;
  }

  .publish-success-actions .hoi4-btn {
    width: 100%;
    text-align: center;
  }
}
