/* ==========================================================
   Marketing Sidebar — Client Routes (/clients/<id>/*)
   Scoped to .marketing-sidebar to avoid global sidebar conflicts
   ========================================================== */

/* ---- Font ---- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400;1,9..40,500&display=swap');

/* ---- Topbar adjustments when marketing sidebar is active ---- */
body.has-marketing-sidebar .topbar-title {
  display: flex !important;
}

/* ---- Sidebar Container ---- */
.marketing-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: #1a1a1a;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1010;
  font-family: 'DM Sans', sans-serif;
  padding-top: 0.5rem;
  padding-bottom: 1rem;
  transition: width 0.3s ease, transform 0.3s ease;
}

.marketing-sidebar::-webkit-scrollbar {
  width: 4px;
}
.marketing-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.marketing-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
.marketing-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ---- Brand ---- */
.marketing-sidebar__brand {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  min-height: 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.marketing-sidebar__brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 0.625rem;
}
.marketing-sidebar__brand-icon i {
  font-size: 1.125rem;
  color: #ffffff;
}

.marketing-sidebar__brand-logo {
  height: 32px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  filter: brightness(1);
}

/* ---- Back to Clients ---- */
.marketing-sidebar__back {
  display: flex;
  align-items: center;
  padding: 0.625rem 1.25rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease, background 0.2s ease;
  border-radius: 10px;
  margin: 0 0.25rem;
  font-family: 'DM Sans', sans-serif;
}
.marketing-sidebar__back:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}
.marketing-sidebar__back i {
  margin-right: 0.5rem;
  font-size: 1rem;
}

.marketing-sidebar__divider {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0.5rem 0;
}

/* ---- Navigation Container ---- */
.marketing-sidebar__nav {
  padding: 0.25rem 0;
}

/* ---- Primary Nav Items ---- */
.marketing-sidebar__item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  border-radius: 10px;
  margin: 1px 0.25rem;
  line-height: 20px;
  user-select: none;
}
.marketing-sidebar__item:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}
.marketing-sidebar__item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* ---- Icon (primary items) ---- */
.marketing-sidebar__icon {
  width: 16px;
  height: 16px;
  margin-right: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.marketing-sidebar__icon i {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1;
}
.marketing-sidebar__item.active .marketing-sidebar__icon i,
.marketing-sidebar__item:hover .marketing-sidebar__icon i {
  color: rgba(255, 255, 255, 0.8);
}

/* ---- Expand Arrow ---- */
.marketing-sidebar__arrow {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.marketing-sidebar__arrow i {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  transition: transform 0.2s ease;
}
.marketing-sidebar__item.expanded .marketing-sidebar__arrow i {
  transform: rotate(90deg);
}

/* ---- Submenu ---- */
.marketing-sidebar__submenu {
  display: none;
  margin-left: 1rem;
  padding-left: 0.8125rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}
.marketing-sidebar__submenu.show {
  display: block;
}

/* ---- Sub-items ---- */
.marketing-sidebar__subitem {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.625rem;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin: 1px 0;
  line-height: 16px;
  font-family: 'DM Sans', sans-serif;
}
.marketing-sidebar__subitem:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}
.marketing-sidebar__subitem.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

/* ---- Sub-item Icon ---- */
.marketing-sidebar__subicon {
  width: 14px;
  height: 14px;
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.marketing-sidebar__subicon i {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1;
}
.marketing-sidebar__subitem.active .marketing-sidebar__subicon i,
.marketing-sidebar__subitem:hover .marketing-sidebar__subicon i {
  color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================
   Breadcrumbs (inside topbar)
   ========================================================== */
.marketing-breadcrumbs {
  padding: 0;
  margin: 0;
  font-size: 0.8125rem;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.marketing-breadcrumbs a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.15s ease;
}
.marketing-breadcrumbs a:hover {
  color: #374151;
  text-decoration: underline;
}
.marketing-breadcrumbs .separator {
  color: #9ca3af;
  margin: 0 0.375rem;
  font-size: 0.75rem;
}
.marketing-breadcrumbs .current {
  color: #1a1a1a;
  font-weight: 600;
}

/* Dark mode breadcrumbs */
[data-theme="dark"] .marketing-breadcrumbs a {
  color: #99a1af;
}
[data-theme="dark"] .marketing-breadcrumbs a:hover {
  color: #e5e7eb;
}
[data-theme="dark"] .marketing-breadcrumbs .separator {
  color: #4a5565;
}
[data-theme="dark"] .marketing-breadcrumbs .current {
  color: #ffffff;
}

/* ==========================================================
   Mobile Responsive
   ========================================================== */
@media (max-width: 768px) {
  .marketing-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .marketing-sidebar.show {
    transform: translateX(0);
  }

  body.has-marketing-sidebar .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  body.has-marketing-sidebar .topbar {
    left: 0 !important;
  }

}

/* ---- Marketing Sidebar Toggle (in topbar) ---- */
body.has-marketing-sidebar .sidebar-toggle {
  display: flex !important;
  color: #1a1a1a;
  text-decoration: none;
}
body.has-marketing-sidebar .sidebar-toggle:hover {
  background: #f3f4f6;
}

/* ==========================================================
   Collapsed State (desktop)
   ========================================================== */
.marketing-sidebar.collapsed {
  width: 70px;
  overflow: hidden;
}
.marketing-sidebar.collapsed .marketing-sidebar__brand-logo {
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}
.marketing-sidebar.collapsed .marketing-sidebar__brand-icon {
  margin-right: 0;
}
.marketing-sidebar.collapsed .marketing-sidebar__back {
  justify-content: center;
  padding: 0.625rem;
}
.marketing-sidebar.collapsed .marketing-sidebar__back span,
.marketing-sidebar.collapsed .marketing-sidebar__back .back-text {
  display: none;
}
.marketing-sidebar.collapsed .marketing-sidebar__item {
  justify-content: center;
  padding: 0.5rem 0.75rem;
}
.marketing-sidebar.collapsed .marketing-sidebar__item span:not(.marketing-sidebar__icon) {
  display: none;
}
.marketing-sidebar.collapsed .marketing-sidebar__arrow {
  display: none;
}
.marketing-sidebar.collapsed .marketing-sidebar__submenu {
  display: none !important;
}

/* Shift topbar and main content when marketing sidebar collapses */
body.marketing-sidebar-collapsed .topbar {
  left: 70px;
}
body.marketing-sidebar-collapsed .main-content {
  margin-left: 70px;
  width: calc(100% - 70px);
}
