/* ==========================================================================
   NAVIGATION, HEADER, SEARCH MODAL & GLASSMORPHIC CATEGORY PILLS
   Minimalist Luxury Streetwear Styling (Zero Emojis, Pure Vector Icons)
   ========================================================================== */

/* Main Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-subtle);
  transition: transform 0.2s ease;
  contain: paint layout;
}

@media (min-width: 769px) {
  .site-header {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}

@media (max-width: 768px) {
  .site-header {
    background: var(--bg-surface);
  }
}

/* Edge-to-Edge Fluid Header (Dragged to Left Edge & Perfectly Aligned) */
.site-header {
  width: 100%;
}

.site-header .header-inner,
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  width: 100% !important;
  max-width: 100% !important;
  padding-left: clamp(0.75rem, 1.5vw, 1.5rem) !important;
  padding-right: clamp(0.75rem, 1.5vw, 1.5rem) !important;
  box-sizing: border-box;
}

/* Brand Logo - Linear Row Aligned with Menu Button */
.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

.brand-logo .logo-main {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  line-height: 1;
  gap: 0.2rem;
  white-space: nowrap;
}

.brand-logo .logo-cipher-part {
  display: inline;
}

.brand-logo .logo-atelier-part {
  display: inline;
}

.brand-logo .logo-main .accent-dot {
  color: #3b82f6;
  font-weight: 900;
  margin-left: 1px;
}

.brand-logo .logo-sub {
  display: none;
}

/* Mobile (< 768px): Show ONLY "ATELIER //" on top navbar because space is tight */
@media (max-width: 768px) {
  .brand-logo .logo-cipher-part {
    display: none !important;
  }
  .brand-logo .logo-atelier-part {
    display: inline !important;
  }
  .brand-logo .logo-main {
    font-size: 1.35rem;
    white-space: nowrap;
    letter-spacing: -0.02em;
  }
}

/* Desktop Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  position: relative;
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-blue);
  border-radius: var(--radius-full);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.search-trigger-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.search-shortcut-badge {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.action-icon-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  position: relative;
  transition: all var(--transition-fast);
}

.action-icon-btn:hover {
  border-color: var(--accent-blue);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.action-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-orange);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   GLASSMORPHISM CATEGORY PILLS BAR
   Floating, Frosted, Rounded Pills with Smooth Indicators
   ========================================================================== */
.category-filter-bar {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 0;
  position: sticky;
  top: var(--header-height);
  z-index: 990;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.category-pills-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  width: 100%;
}

.category-pills-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.35rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}

.category-pills-list::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid transparent;
  font-family: var(--font-pill);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.filter-pill svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  transition: transform 0.2s ease;
}

.filter-pill:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.filter-pill.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.filter-pill.active svg {
  stroke: var(--bg-primary);
}

.filter-controls-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.sort-select-pill {
  padding: 0.38rem 1.85rem 0.38rem 0.85rem !important;
  font-size: 0.76rem !important;
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  width: auto !important;
  max-width: 135px !important;
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-medium) !important;
  border-radius: var(--radius-full) !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.65rem center !important;
  background-size: 11px 11px !important;
  box-shadow: var(--shadow-sm) !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  transition: border-color 0.15s ease !important;
}

.sort-select-pill:hover,
.sort-select-pill:focus {
  border-color: var(--text-primary) !important;
  outline: none !important;
  box-shadow: none !important;
}

@media (max-width: 860px) {
  .category-filter-bar {
    padding: 0.5rem 0;
  }
  .category-pills-wrap {
    flex-direction: row;
    padding: 0;
  }
  .category-pills-list {
    width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.1rem 0;
    gap: 0.4rem;
  }
  .filter-pill {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    padding: 0.42rem 0.9rem;
    font-size: 0.78rem;
    box-shadow: var(--shadow-sm);
  }
  .filter-pill.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
  }
  .filter-controls-right {
    display: none !important;
  }
}

/* Search Modal Overlay */
.search-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 9, 12, 0.85);
  backdrop-filter: blur(16px);
  z-index: 99999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

[data-theme="light"] .search-modal-overlay {
  background: rgba(15, 23, 42, 0.6);
}

.search-modal-overlay.active {
  display: flex;
}

.search-modal-box {
  width: 90%;
  max-width: 650px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.search-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-primary);
}

.search-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.search-trending-tags {
  padding: 1rem 1.5rem;
  background: var(--bg-card-hover);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  transition: all var(--transition-fast);
}

.tag-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.back-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.back-nav-btn:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
}


/* Mobile Menu Overlay Styles */
/* ==========================================================================
   MODERN HALF-SCREEN SIDE DRAWER MENU (SLIDE FROM LEFT)
   ========================================================================== */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: block !important;
}

.mobile-menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 82%;
  max-width: 320px;
  height: 100%;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-medium);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 35px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.mobile-menu-overlay.active .mobile-drawer,
.mobile-drawer.open {
  transform: translateX(0) !important;
}

.drawer-header {
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  scrollbar-width: none;
}
.drawer-body::-webkit-scrollbar {
  display: none;
}

/* Profile / VIP Card */
.drawer-profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.drawer-profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
}

.drawer-profile-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.drawer-profile-title {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.drawer-profile-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Nav Section */
.drawer-nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.drawer-section-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.drawer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.drawer-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  transition: background 0.15s ease, transform 0.15s ease;
}

.drawer-nav-link:hover,
.drawer-nav-link:active {
  background: var(--bg-card);
}

.drawer-nav-link.highlight {
  color: #a855f7;
}

.drawer-badge-new {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 800;
  background: #a855f7;
  color: #ffffff;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.drawer-nav-list.secondary .drawer-nav-link-sub {
  display: block;
  padding: 0.45rem 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.drawer-nav-list.secondary .drawer-nav-link-sub:hover {
  color: var(--text-primary);
}

/* Drawer Footer */
.drawer-footer {
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.drawer-theme-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-theme-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.drawer-theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-pill);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}


/* Header Hamburger Menu Button (Always Available) */
.mobile-menu-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.mobile-menu-btn:hover {
  background: var(--bg-surface);
  border-color: var(--text-primary);
  transform: scale(1.05);
}


/* Compact 2-Column Grid for Assistance & Policies (Saves 70% Space) */
.drawer-policies-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.drawer-policy-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.38rem 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-policy-chip:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.drawer-policy-chip svg {
  flex-shrink: 0;
  opacity: 0.75;
}


/* Mobile Drawer - Ultra Compact Viewport Optimization */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, 86vw);
  height: 100%;
  max-height: 100dvh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-medium);
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.drawer-body {
  padding: 0.65rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.drawer-profile-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
}

.drawer-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-profile-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.drawer-profile-title {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-profile-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.drawer-nav-section {
  display: flex;
  flex-direction: column;
}

.drawer-section-title {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.drawer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.drawer-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.42rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
}

.drawer-nav-link:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.drawer-nav-link.highlight {
  color: #a855f7;
}

.drawer-badge-new {
  margin-left: auto;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border-radius: var(--radius-full);
}

/* 4 KPI Policy Chips 2x2 */
.drawer-policies-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.drawer-policy-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.drawer-policy-chip:hover {
  border-color: #3b82f6;
  color: var(--text-primary);
}

/* Inline Theme Segmented Bar (Directly Under 4 KPI Chips) */
.drawer-theme-segmented-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.32rem 0.55rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.drawer-theme-pill-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.drawer-theme-toggle-pills {
  display: inline-flex;
  background: var(--bg-surface);
  border-radius: 9999px;
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--border-subtle);
}

.drawer-theme-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

/* CSS-Driven Instant Highlight (0ms delay) */
[data-theme="light"] #theme-pill-light {
  background: #000000 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

[data-theme="light"] #theme-pill-dark {
  background: transparent !important;
  color: #64748b !important;
}

[data-theme="dark"] #theme-pill-dark {
  background: #3b82f6 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(59,130,246,0.3);
}

[data-theme="dark"] #theme-pill-light {
  background: transparent !important;
  color: #94a3b8 !important;
}
