/**
 * Modern Sidebar CSS for 66socialproof
 * Ported from PopupSnap.com navigation design
 * Bootstrap 4.6.2 compatible
 *
 * RTL-FIRST DESIGN: This site is primarily Arabic
 * Sidebar on RIGHT side for RTL (default)
 * Sidebar on LEFT side for LTR
 */

/* ==========================================
   SHELL LAYOUT - RTL FIRST (Arabic)
   ========================================== */
.ps-shell {
  display: flex;
  flex-direction: row-reverse; /* RTL: sidebar on right */
  min-height: 100vh;
  width: 100%;
}

.ps-shell__sidebar {
  position: fixed;
  top: 0;
  right: 0; /* RTL: sidebar on right */
  left: auto;
  width: var(--ps-sidebar-width, 16rem);
  height: 100vh;
  z-index: 1100;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 0; /* Let the inner ps-sidebar fill the entire shell */
  /* Ensure gradient fills entire sidebar wrapper */
  background: var(--ps-gradient-primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
}

.ps-shell__main {
  flex: 1;
  min-width: 0;
  margin-right: var(--ps-sidebar-width, 16rem); /* RTL: margin on right */
  margin-left: 0;
  transition: margin 0.3s ease;
  background-color: #f8fafc;
}

.ps-shell__canvas {
  background-color: #f8fafc;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ps-shell__content {
  flex: 1;
}

/* Desktop layout */
@media (min-width: 1024px) {
  body.ps-sidebar-visible .ps-shell__sidebar {
    transform: translateX(0) !important;
  }

  body.ps-sidebar-visible .ps-shell__main {
    margin-right: var(--ps-sidebar-width, 16rem);
    margin-left: 0;
  }
}

/* Mobile: sidebar hidden by default, main content full width */
@media (max-width: 1023px) {
  .ps-shell__sidebar {
    transform: translateX(100%); /* Hidden to the right */
  }

  .ps-shell__sidebar.active {
    transform: translateX(0);
  }

  .ps-shell__main {
    margin-right: 0 !important;
    margin-left: 0 !important;
    width: 100%;
  }
}

/* ==========================================
   LTR OVERRIDE (for English/other languages)
   ========================================== */
[dir="ltr"] .ps-shell,
html:not([dir="rtl"]):not(:lang(ar)) .ps-shell {
  flex-direction: row; /* LTR: sidebar on left */
}

[dir="ltr"] .ps-shell__sidebar,
html:not([dir="rtl"]):not(:lang(ar)) .ps-shell__sidebar {
  right: auto;
  left: 0; /* LTR: sidebar on left */
}

[dir="ltr"] .ps-shell__main,
html:not([dir="rtl"]):not(:lang(ar)) .ps-shell__main {
  margin-left: var(--ps-sidebar-width, 16rem); /* LTR: margin on left */
  margin-right: 0;
}

@media (max-width: 1023px) {
  [dir="ltr"] .ps-shell__sidebar,
  html:not([dir="rtl"]):not(:lang(ar)) .ps-shell__sidebar {
    transform: translateX(-100%); /* Hidden to the left for LTR */
  }

  [dir="ltr"] .ps-shell__sidebar.active,
  html:not([dir="rtl"]):not(:lang(ar)) .ps-shell__sidebar.active {
    transform: translateX(0);
  }
}

/* ==========================================
   CSS VARIABLES
   ========================================== */
:root {
  /* Colors */
  --ps-primary: #4f46e5;
  --ps-primary-dark: #3730a3;
  --ps-secondary: #6366f1;
  --ps-success: #10b981;
  --ps-warning: #f59e0b;
  --ps-danger: #ef4444;

  /* Gradient Theme System */
  --ps-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --ps-gradient-primary-light: linear-gradient(135deg, #7c8bf7 0%, #8557b8 100%);
  --ps-gradient-primary-dark: linear-gradient(135deg, #5a6fd8 0%, #673d8c 100%);
  --ps-gradient-secondary: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
  --ps-gradient-mid: #6f77c4;

  /* Navigation Colors */
  --ps-nav-bg: var(--ps-gradient-primary);
  --ps-nav-bg-light: var(--ps-gradient-primary-light);
  --ps-nav-bg-solid: var(--ps-gradient-mid);
  --ps-nav-text: #ffffff;
  --ps-nav-text-muted: rgba(255, 255, 255, 0.8);
  --ps-nav-accent: var(--ps-primary);
  --ps-nav-hover: rgba(255, 255, 255, 0.1);
  --ps-nav-active: rgba(255, 255, 255, 0.2);

  /* Spacing */
  --ps-sidebar-width: 16rem;
  --ps-sidebar-collapsed: 4rem;

  /* Shadows */
  --ps-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --ps-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --ps-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* Transitions */
  --ps-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --ps-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   SIDEBAR CONTAINER (Inner navigation)
   RTL-FIRST: Default positioning for Arabic
   ========================================== */
.ps-sidebar,
.unified-sidebar,
.modern-sidebar {
  width: 100%;
  height: 100%;
  background: var(--ps-nav-bg);
  box-shadow: var(--ps-shadow-lg), 0 8px 24px rgba(102, 126, 234, 0.15);
  overflow-y: auto;
  overflow-x: hidden;
  transition: var(--ps-transition);
  direction: rtl; /* RTL-first: Arabic text direction */
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* LTR: Override for English/other languages */
[dir="ltr"] .ps-sidebar,
[dir="ltr"] .unified-sidebar,
[dir="ltr"] .modern-sidebar {
  direction: ltr;
  border-left: none;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scrollbar styling */
.ps-sidebar,
.unified-sidebar,
.modern-sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.ps-sidebar::-webkit-scrollbar,
.unified-sidebar::-webkit-scrollbar,
.modern-sidebar::-webkit-scrollbar {
  width: 6px;
}

.ps-sidebar::-webkit-scrollbar-track,
.unified-sidebar::-webkit-scrollbar-track,
.modern-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.ps-sidebar::-webkit-scrollbar-thumb,
.unified-sidebar::-webkit-scrollbar-thumb,
.modern-sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.ps-sidebar::-webkit-scrollbar-thumb:hover,
.unified-sidebar::-webkit-scrollbar-thumb:hover,
.modern-sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* ==========================================
   SIDEBAR HEADER
   ========================================== */
.ps-sidebar-header,
.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.ps-sidebar-brand,
.sidebar-brand {
  display: inline-block;
  text-decoration: none;
  transition: var(--ps-transition);
}

.ps-sidebar-brand:hover,
.sidebar-brand:hover {
  transform: scale(1.05);
}

.ps-sidebar-logo,
.sidebar-logo {
  max-width: 100%;
  height: auto;
  filter: brightness(1.1);
}

/* ==========================================
   NAVIGATION CONTAINER
   ========================================== */
.ps-sidebar-nav,
.sidebar-nav {
  padding: 1rem 0;
  flex: 1;
}

/* ==========================================
   NAVIGATION SECTIONS
   ========================================== */
.nav-section {
  margin-bottom: 0.5rem;
}

/* ==========================================
   NAVIGATION ITEM HEADERS (COLLAPSIBLE)
   ========================================== */
.nav-item-header {
  width: 100%;
  background: none;
  border: none;
  color: var(--ps-nav-text);
  text-align: right;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: var(--ps-transition);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0 0.75rem 0.75rem 0;
  margin-left: 1rem;
}

.nav-item-header:hover {
  background-color: var(--ps-nav-hover);
  color: var(--ps-primary);
  transform: translateX(-2px);
}

.nav-item-header:focus {
  outline: none;
}

/* Navigation item content wrapper */
.nav-item-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

/* Navigation icons */
.nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-icon i {
  font-size: 1.125rem;
}

/* Navigation text */
.nav-text {
  flex: 1;
  text-align: right;
}

/* Chevron icon */
.nav-chevron {
  font-size: 0.75rem;
  transition: var(--ps-transition);
  flex-shrink: 0;
}

/* Rotate chevron when expanded */
.nav-item-header[aria-expanded="true"] .nav-chevron,
.nav-item-header:not(.collapsed) .nav-chevron {
  transform: rotate(180deg);
}

/* ==========================================
   SINGLE NAVIGATION ITEMS (NO SUBMENU)
   ========================================== */
.nav-item-single {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--ps-nav-text);
  text-decoration: none;
  transition: var(--ps-transition);
  font-size: 0.875rem;
  border-radius: 0 0.75rem 0.75rem 0;
  margin-left: 1rem;
  border-right: 3px solid transparent;
}

.nav-item-single:hover {
  background-color: var(--ps-nav-hover);
  color: var(--ps-primary);
  text-decoration: none;
  transform: translateX(-2px);
}

.nav-item-single.active {
  background-color: var(--ps-nav-active);
  color: var(--ps-primary);
  border-right-color: var(--ps-primary);
}

/* ==========================================
   SUBMENU
   ========================================== */
.nav-submenu {
  background-color: rgba(0, 0, 0, 0.15);
  margin-left: 1rem;
  border-radius: 0 0 0.75rem 0.75rem;
  overflow: hidden;
}

.nav-submenu.collapse:not(.show) {
  display: none;
}

.nav-submenu.collapsing {
  transition: height 0.2s ease;
}

/* Submenu items */
.nav-subitem {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--ps-nav-text-muted);
  text-decoration: none;
  transition: var(--ps-transition);
  font-size: 0.875rem;
  border-right: 3px solid transparent;
}

.nav-subitem:hover {
  color: var(--ps-nav-text);
  background-color: var(--ps-nav-hover);
  border-right-color: var(--ps-primary);
  text-decoration: none;
  transform: translateX(-2px);
}

.nav-subitem.active {
  color: var(--ps-nav-text);
  background-color: var(--ps-nav-active);
  border-right-color: var(--ps-primary);
}

/* Featured submenu items */
.nav-subitem.featured {
  background: linear-gradient(135deg, var(--ps-warning), #fb923c);
  color: white;
  font-weight: 600;
}

.nav-subitem.featured:hover {
  background: linear-gradient(135deg, #f59e0b, var(--ps-warning));
  transform: translateX(-2px) scale(1.02);
  border-right-color: transparent;
}

/* Video Help link - prominent style */
.nav-item-single.nav-video-help {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(124, 58, 237, 0.15));
  border: 1px solid rgba(79, 70, 229, 0.3);
  border-radius: 0.5rem;
  margin: 0.5rem 0.75rem;
  padding: 0.75rem 1rem;
}

.nav-item-single.nav-video-help .nav-icon {
  color: #a5b4fc;
}

.nav-item-single.nav-video-help .nav-text {
  color: #e0e7ff;
}

.nav-item-single.nav-video-help:hover {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.25), rgba(124, 58, 237, 0.25));
  border-color: rgba(79, 70, 229, 0.5);
  transform: translateY(-1px);
}

/* Submenu icons */
.nav-subicon {
  width: 1rem;
  height: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-subicon i {
  font-size: 0.875rem;
}

/* Submenu text */
.nav-subtext {
  flex: 1;
  text-align: right;
}

/* ==========================================
   BADGES & INDICATORS
   ========================================== */
.nav-badge {
  background-color: var(--ps-warning);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  margin-left: 0.5rem;
}

.nav-badge.new {
  background-color: var(--ps-success);
}

.nav-badge.beta {
  background-color: var(--ps-primary);
}

/* ==========================================
   NAVIGATION DIVIDERS
   ========================================== */
.nav-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  margin: 0.75rem 1.5rem;
}

/* Section titles */
.nav-section-title {
  color: var(--ps-nav-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1.5rem;
  margin-top: 0.5rem;
}

/* ==========================================
   LTR Navigation Styling Override
   (RTL is default - see RTL-first rules above)
   ========================================== */
[dir="ltr"] .nav-item-header,
[dir="ltr"] .nav-item-single {
  border-radius: 0.75rem 0 0 0.75rem;
  margin-right: 1rem;
  margin-left: 0;
  text-align: left;
}

[dir="ltr"] .nav-item-header:hover,
[dir="ltr"] .nav-item-single:hover {
  transform: translateX(2px);
}

[dir="ltr"] .nav-text,
[dir="ltr"] .nav-subtext {
  text-align: left;
}

[dir="ltr"] .nav-item-content {
  flex-direction: row-reverse;
}

[dir="ltr"] .nav-submenu {
  margin-right: 1rem;
  margin-left: 0;
}

[dir="ltr"] .nav-subitem {
  border-left: 3px solid transparent;
  border-right: none;
}

[dir="ltr"] .nav-subitem:hover {
  transform: translateX(2px);
  border-left-color: var(--ps-primary);
}

[dir="ltr"] .nav-subitem.active {
  border-left-color: var(--ps-primary);
}

/* ==========================================
   RESPONSIVE DESIGN
   Navigation content styling for different screens
   (Shell layout handled at top of file)
   ========================================== */

/* Tablet and Mobile (1023px and below) */
@media (max-width: 1023px) {
  /* Smaller font sizes for mobile */
  .nav-item-header,
  .nav-item-single {
    font-size: 0.8125rem;
  }

  .nav-subitem {
    font-size: 0.8125rem;
    padding: 0.625rem 1.25rem;
  }
}

/* Mobile (575px and below) */
@media (max-width: 575px) {
  .ps-shell__sidebar {
    width: 85vw;
    max-width: 320px;
  }

  /* Compact spacing for mobile */
  .ps-sidebar-header,
  .sidebar-header {
    padding: 1rem;
  }

  .nav-item-header,
  .nav-item-single {
    padding: 0.625rem 1.25rem;
  }

  .nav-subitem {
    padding: 0.625rem 1.25rem 0.625rem 2rem;
  }
}

/* ==========================================
   SIDEBAR OVERLAY
   ========================================== */
.ps-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 850;
  transition: var(--ps-transition);
}

.ps-sidebar-overlay.active {
  display: block;
}

/* Prevent body scroll when sidebar is open on mobile */
@media (max-width: 1023px) {
  body.ps-sidebar-open {
    overflow: hidden;
  }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

/* Focus styles */
.nav-item-header:focus,
.nav-item-single:focus,
.nav-subitem:focus {
  outline: 2px solid var(--ps-primary);
  outline-offset: -2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .ps-sidebar,
  .unified-sidebar,
  .modern-sidebar,
  .nav-item-header,
  .nav-item-single,
  .nav-subitem,
  .nav-chevron,
  .nav-submenu {
    transition: none;
  }
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
  .ps-sidebar,
  .unified-sidebar,
  .modern-sidebar,
  .ps-sidebar-overlay {
    display: none !important;
  }
}

/* ==========================================
   DASHBOARD BACKGROUND & CARDS
   ========================================== */

/* Dashboard cards with gradient background */
.ps-dashboard-card,
.card-body.bg-primary {
  background: var(--ps-gradient-primary) !important;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
  border: none;
}

/* Card text color override for gradient cards */
.ps-dashboard-card,
.ps-dashboard-card *,
.card-body.bg-primary,
.card-body.bg-primary * {
  color: #ffffff !important;
}

/* Card links within gradient cards */
.ps-dashboard-card a,
.card-body.bg-primary a {
  color: rgba(255, 255, 255, 0.9) !important;
  text-decoration: underline;
}

.ps-dashboard-card a:hover,
.card-body.bg-primary a:hover {
  color: #ffffff !important;
}

/* Ensure icons in cards are white */
.ps-dashboard-card i,
.card-body.bg-primary i {
  color: #ffffff !important;
}

/* RTL Support for dashboard cards */
[dir="rtl"] .ps-dashboard-card,
[dir="rtl"] .card-body.bg-primary,
html:lang(ar) .ps-dashboard-card,
html:lang(ar) .card-body.bg-primary {
  direction: rtl;
}

/* ==========================================
   FOOTER STYLING - PopupSnap Design
   ========================================== */
.ps-shell__footer,
.footer {
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 1.5rem;
  text-align: center;
  margin-top: auto;
  flex-shrink: 0;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ps-shell__footer,
.footer,
.footer * {
  color: #64748b;
  font-size: 0.875rem;
}

.ps-shell__footer a,
.footer a {
  color: #4f46e5;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ps-shell__footer a:hover,
.footer a:hover {
  color: #3730a3;
  text-decoration: underline;
}

.footer .text-muted,
.footer .font-size-little-small {
  color: #94a3b8 !important;
}

.footer-heading {
  color: #64748b !important;
}

.footer-logo {
  max-height: 2.5rem;
  width: auto;
}

/* Footer links list styling */
.footer ul.list-style-none {
  padding: 0;
  margin: 0;
  list-style: none;
}

.footer ul.list-style-none li {
  margin-bottom: 0.5rem;
}

.footer ul.list-style-none a {
  color: #4f46e5;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer ul.list-style-none a:hover {
  color: #3730a3;
  text-decoration: underline;
}

/* Social icons in footer */
.footer a[target="_blank"] i {
  color: #64748b;
  transition: color 0.2s ease;
}

.footer a[target="_blank"]:hover i {
  color: #4f46e5;
}

/* Footer dropdowns (language/currency/theme switchers) */
.footer .btn-link {
  color: #64748b !important;
  padding: 0;
}

.footer .btn-link:hover {
  color: #4f46e5 !important;
}

/* RTL Support for Footer */
[dir="rtl"] .footer,
html:lang(ar) .footer {
  text-align: center;
}

[dir="rtl"] .footer .d-flex,
html:lang(ar) .footer .d-flex {
  direction: rtl;
}

/* Responsive footer */
@media (max-width: 991px) {
  .footer {
    padding: 1.25rem;
  }

  .footer .d-flex.flex-lg-row {
    flex-direction: column !important;
  }
}

/* ==========================================
   HEADER/NAVBAR STYLING - PopupSnap Design
   ========================================== */
.ps-header,
.ps-shell__header,
.popup-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  height: 4rem;
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  direction: rtl; /* RTL default for Arabic */
  transition: all 0.3s ease;
}

/* Main content area with proper spacing for header */
.ps-shell__canvas {
  padding-top: 4rem; /* Space for fixed header (4rem height) */
}

/* LTR: Header positioning for English/other languages */
[dir="ltr"] .ps-header,
[dir="ltr"] .ps-shell__header,
[dir="ltr"] .popup-header {
  left: 0;
  right: 0;
  direction: ltr;
}

/* Header Content */
.ps-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

/* Header Right Section (Logo + Primary CTA) */
.ps-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Header Logo */
.ps-header-logo {
  display: flex;
  align-items: center;
}

/* Sidebar brand/logo tweaks */
.ps-sidebar__brand {
  margin-top: 1rem;
  text-align: center;
}

.ps-sidebar__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 600;
  font-size: 1.125rem;
  width: 100%;
  text-decoration: none;
}

.ps-sidebar__logo:hover {
  text-decoration: none;
  color: #ffffff;
}

.navbar-logo {
  max-height: 5.5rem;
  width: auto;
  transition: transform 0.3s ease;
}

.ps-sidebar__logo:hover .navbar-logo {
  transform: scale(1.05);
}

.ps-sidebar__brand-name {
  margin-top: 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  font-family: "Cairo", "Inter", "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
}

/* Sidebar scroll area - takes remaining height */
.ps-sidebar__scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0;
}

/* Sidebar footer - sticky at bottom */
.ps-sidebar__footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
  margin-top: auto;
}

.ps-sidebar__footer .btn {
  font-size: 0.875rem;
  font-weight: 500;
}

.ps-sidebar__footer .btn-outline-primary {
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.ps-sidebar__footer .btn-outline-primary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
}

.ps-sidebar__footer .btn-light {
  background: rgba(255, 255, 255, 0.9);
}

/* Header Navigation */
.ps-header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Navigation Actions Container */
.ps-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Navigation Action Links */
.ps-nav-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.ps-nav-action:hover {
  background-color: #f8fafc;
  color: #4f46e5;
  text-decoration: none;
}

.ps-nav-action:focus {
  outline: 2px solid #e0e7ff;
  outline-offset: 2px;
}

/* Ghost variant */
.ps-nav-action--ghost {
  color: #64748b;
}

.ps-nav-action--ghost:hover {
  color: #1e293b;
  background-color: #f1f5f9;
}

/* Icon-only variant */
.ps-nav-action--icon {
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  justify-content: center;
}

/* Primary Action Button (Create Campaign) */
.ps-nav-action--primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white !important;
  border-radius: 0.75rem;
  font-weight: 600;
  box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.25);
  padding: 0.625rem 1.25rem;
}

.ps-nav-action--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px -2px rgba(102, 126, 234, 0.35);
  color: white !important;
  background: linear-gradient(135deg, #7c8bf7 0%, #8557b8 100%);
}

/* User Menu */
.ps-user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ps-user-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #1e293b;
  font-size: 0.875rem;
  font-weight: 500;
}

.ps-user-button:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.navbar-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
}

/* User Dropdown Menu */
.ps-dropdown-menu {
  min-width: 14rem;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.ps-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  color: #1e293b;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  border-right: 3px solid transparent;
}

.ps-dropdown-item:hover {
  background-color: #f8fafc;
  color: #4f46e5;
  text-decoration: none;
  border-right-color: #4f46e5;
}

.ps-dropdown-item.active {
  background-color: #f0f0ff;
  color: #3730a3;
  border-right-color: #4f46e5;
  font-weight: 600;
}

.ps-dropdown-item.active span {
  color: #3730a3;
}

.ps-dropdown-item.active svg {
  color: #3730a3;
}

[dir="ltr"] .ps-dropdown-item {
  border-right: none;
  border-left: 3px solid transparent;
}

[dir="ltr"] .ps-dropdown-item:hover,
[dir="ltr"] .ps-dropdown-item.active {
  border-left-color: #4f46e5;
}

/* Header Auth Links (for non-logged-in users) */
.ps-header__auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Sidebar Toggle (Mobile) */
.ps-sidebar-toggle {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 2.5rem;
  height: 2.5rem;
  justify-content: center;
  align-items: center;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.ps-sidebar-toggle:hover {
  background-color: #f8fafc;
}

.ps-hamburger-line {
  width: 1.25rem;
  height: 2px;
  background-color: #1e293b;
  border-radius: 1px;
  transition: all 0.3s ease;
}

/* Notification Dropdown */
.ps-header__notification-dropdown {
  min-width: 20rem;
  max-height: 24rem;
  overflow-y: auto;
}

/* Internal notification icon badge */
.internal-notification-icon {
  color: #ef4444 !important;
}

/* Mobile Responsive Header */
@media (max-width: 1023px) {
  .ps-header,
  .ps-shell__header,
  .popup-header {
    left: 0;
    right: 0;
    height: 3.25rem;
    padding: 0 0.75rem;
  }

  .ps-shell__canvas {
    padding-top: 3.25rem; /* Match header height for mobile */
  }

  [dir="ltr"] .ps-header,
  [dir="ltr"] .ps-shell__header,
  [dir="ltr"] .popup-header {
    left: 0;
    right: 0;
  }

  .ps-sidebar-toggle {
    display: flex;
  }

  /* Hide some nav actions on mobile */
  .ps-nav-action span {
    display: none;
  }

  .ps-nav-action--primary span {
    display: inline; /* Keep primary CTA text visible */
  }

  .ps-user-button span {
    display: none;
  }

  .navbar-avatar {
    width: 1.75rem;
    height: 1.75rem;
  }
}

@media (max-width: 640px) {
  .ps-header-right {
    gap: 0.5rem;
  }

  .ps-nav-actions {
    gap: 0.25rem;
  }

  /* Hide "Back to PopupSnap" link on very small screens */
  .ps-nav-action--ghost {
    display: none;
  }

  .ps-nav-action--primary {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
  }
}
