/**
 * Modern Smart Header v2.0
 * Kompakt, glassmorphic design med micro-interactions
 */

:root {
  /* Header dimensions */
  --header-height: 90px;
  --header-height-scrolled: 70px;
  --header-z-index: 1050;
  
  /* Logo */
  --logo-width: 240px;
  --logo-height: 60px;
  --logo-width-mobile: 160px;
  --logo-height-mobile: 43px;
  
  /* Colors - Light mode */
  --header-bg: rgba(255, 255, 255, 0.8);
  --header-border: rgba(0, 0, 0, 0.05);
  --header-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  --header-shadow-scrolled: 0 2px 30px rgba(0, 0, 0, 0.12);
  
  --primary: #334155;
  --primary-light: #475569;
  --secondary: #1e293b;
  --gradient-primary: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --border-color: rgba(0, 0, 0, 0.1);
  --hover-bg: rgba(51, 65, 85, 0.08);
  --active-bg: rgba(51, 65, 85, 0.12);
  
  /* Badge colors */
  --badge-danger: #ef4444;
  --badge-success: #10b981;
  --badge-warning: #f59e0b;
  --badge-info: #3b82f6;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: 15px;
  --font-size-sm: 13px;
  --font-size-xs: 11px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Dropdown */
  --dropdown-width: 280px;
  --dropdown-max-height: 500px;
  --notification-width: 380px;
}

/* Dark mode variables */
body.dark-mode {
  --header-bg: rgba(15, 23, 42, 0.8);
  --header-border: rgba(255, 255, 255, 0.1);
  --header-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  --header-shadow-scrolled: 0 2px 30px rgba(0, 0, 0, 0.4);
  
  --text-primary: #ffffff;
  --text-secondary: #f1f5f9;
  --text-muted: #cbd5e1;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --hover-bg: rgba(148, 163, 184, 0.15);
  --active-bg: rgba(148, 163, 184, 0.25);
  
  --primary: #f1f5f9;
  --primary-light: #cbd5e1;
}

/* Dark mode - Gör loggan vit */
body.dark-mode .header-logo img {
  filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(255, 255, 255, 0.2));
}

/* Dark mode - Body & content styling now handled by dark-mode-global.css */
/* Removed blocking CSS that forced white backgrounds and dark text */

/* Dark mode - Header text explicit vit */
body.dark-mode .header-modern,
body.dark-mode .header-nav-link,
body.dark-mode .header-actions,
body.dark-mode .mobile-menu,
body.dark-mode .user-name,
body.dark-mode .notification-btn,
body.dark-mode .quick-btn,
body.dark-mode .mobile-menu-item,
body.dark-mode .user-chevron,
body.dark-mode .header-nav-icon {
  color: #ffffff !important;
}

body.dark-mode .header-nav-link:hover,
body.dark-mode .header-nav-link.active,
body.dark-mode .notification-btn:hover,
body.dark-mode .quick-btn:hover {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Dark mode - Buttons i headern */
body.dark-mode .quick-btn,
body.dark-mode .notification-btn,
body.dark-mode .user-profile-trigger {
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .user-profile-trigger:hover,
body.dark-mode .notification-btn:hover,
body.dark-mode .quick-btn:hover {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Dark mode - Mobile menu text */
body.dark-mode .mobile-menu-header h3,
body.dark-mode .mobile-menu-user,
body.dark-mode .mobile-menu-close {
  color: #ffffff !important;
}

/* Dark mode - Dropdown panels */
body.dark-mode .dropdown-panel {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Dark mode - Notification dropdown */
body.dark-mode .notification-title,
body.dark-mode .notification-text,
body.dark-mode .notification-tab,
body.dark-mode .notification-footer-btn {
  color: #ffffff;
}

body.dark-mode .notification-tab:hover,
body.dark-mode .notification-tab.active {
  color: #ffffff;
}

body.dark-mode .notification-time {
  color: #cbd5e1;
}

body.dark-mode .notification-item.unread {
  background: rgba(148, 163, 184, 0.1);
}

/* Dark mode - User dropdown */
body.dark-mode .user-dropdown-name,
body.dark-mode .user-dropdown-item {
  color: #ffffff !important;
}

body.dark-mode .user-dropdown-email {
  color: #cbd5e1 !important;
}

body.dark-mode .user-dropdown-item:hover {
  color: #ffffff !important;
  background: rgba(148, 163, 184, 0.15);
}

/* Dark mode - Mobile menu toggle */
body.dark-mode .mobile-menu-toggle {
  color: #ffffff;
}

body.dark-mode .mobile-menu-toggle:hover {
  color: #f1f5f9;
}

/* Dark mode - Mobile menu */
body.dark-mode .mobile-menu {
  background: rgba(15, 23, 42, 0.95);
}

body.dark-mode .mobile-menu-item {
  color: #ffffff;
}

body.dark-mode .mobile-menu-item:hover,
body.dark-mode .mobile-menu-item.active {
  color: #ffffff;
  background: rgba(148, 163, 184, 0.15);
}

body.dark-mode .mobile-menu-close {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Dark mode - Dark mode toggle switch */
body.dark-mode .dark-mode-toggle-switch.active {
  background: #60a5fa;
}

body.dark-mode .dark-mode-toggle {
  color: #ffffff;
}

/* ============================================
   HEADER BASE
   ============================================ */

.header-modern {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--header-bg);
  /* Removed - caused grid artifacts on tablets */
  /* backdrop-filter: blur(20px); */
  /* -webkit-backdrop-filter: blur(20px); */
  box-shadow: var(--header-shadow);
  border-bottom: 1px solid var(--header-border);
  z-index: var(--header-z-index);
  transition: all var(--transition-base);
}

.header-modern.scrolled {
  height: var(--header-height-scrolled);
  box-shadow: var(--header-shadow-scrolled);
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
}

/* ============================================
   LOGO
   ============================================ */

.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.header-logo:hover {
  transform: scale(1.02);
}

.header-logo img {
  width: var(--logo-width);
  height: var(--logo-height);
  object-fit: contain;
  display: block;
  transition: all var(--transition-base);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.header-modern.scrolled .header-logo img {
  width: calc(var(--logo-width) * 0.83);
  height: calc(var(--logo-height) * 0.83);
}

/* ============================================
   NAVIGATION
   ============================================ */

.header-nav {
  display: none;
  align-items: center;
  gap: var(--spacing-sm);
  flex: 1;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-nav-item {
  position: relative;
}

.header-nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.header-nav-link:hover {
  color: var(--primary);
  background: var(--hover-bg);
  transform: translateY(-2px);
}

.header-nav-link.active {
  color: var(--primary);
  font-weight: var(--font-weight-semibold);
  background: var(--active-bg);
}

.header-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: var(--spacing-sm);
  right: var(--spacing-sm);
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
}

.header-nav-icon {
  font-size: 14px;
  opacity: 0.8;
}

/* Nav link badge */
.header-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--badge-danger);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
  margin-left: 2px;
}

/* ============================================
   RIGHT SIDE ACTIONS
   ============================================ */

.header-actions {
  display: none;
  align-items: center;
  gap: var(--spacing-sm);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

/* Plan badge i header (desktop) */
.header-plan-badge {
  display: none;
  align-items: center;
  margin-right: var(--spacing-sm);
}

.header-plan-value {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.375rem 0.75rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.header-plan-free {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
  color: white;
}

.header-plan-trial {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  animation: headerTrialPulse 2s ease-in-out infinite;
}

.header-plan-basic {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.header-plan-pro {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.header-plan-enterprise {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
}

@keyframes headerTrialPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.9;
  }
}

/* Quick Actions */
.quick-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.quick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
  pointer-events: auto;
}

.quick-btn:hover {
  background: var(--hover-bg);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Notification Button */
.notification-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
  pointer-events: auto;
}

.notification-btn:hover {
  background: var(--hover-bg);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.notification-btn.has-unread {
  color: var(--primary);
}

.notification-btn.has-new-notification {
  animation: pulse 0.5s ease-in-out 3;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7); }
  100% { transform: scale(1); box-shadow: 0 0 0 8px rgba(102, 126, 234, 0); }
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--badge-danger);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
  border: 2px solid var(--header-bg);
  animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ============================================
   FAVORITES BUTTON & DROPDOWN
   ============================================ */

.favorites-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
  pointer-events: auto;
}

.favorites-btn:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
  color: #f59e0b;
  transform: translateY(-2px);
}

.favorites-btn i {
  font-size: 18px;
}

.favorites-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: #f59e0b;
  color: white;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
  border: 2px solid var(--header-bg);
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.favorites-dropdown {
  width: 360px;
  max-height: 500px;
  overflow-y: auto;
}

/* Favorites Header */
.favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.favorites-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #92400e;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.favorites-count {
  background: #f59e0b;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
}

/* Favorites List */
.favorites-list {
  padding: 0.5rem 0;
}

/* Minimal favorite item - clickable link */
.favorite-item-minimal {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f1f5f9;
}

.favorite-item-minimal:hover {
  background: #f8fafc;
  transform: translateX(4px);
}

.favorite-item-minimal:last-child {
  border-bottom: none;
}

.favorite-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.favorite-avatar-small i {
  color: #64748b;
  font-size: 1.125rem;
}

.favorite-info-minimal {
  flex: 1;
  min-width: 0;
}

.favorite-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.9rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.favorite-rating-small {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

.favorite-arrow {
  color: #94a3b8;
  font-size: 0.875rem;
  transition: transform 0.2s ease;
}

.favorite-item-minimal:hover .favorite-arrow {
  transform: translateX(4px);
  color: #1e293b;
}

/* Favorites Footer */
.favorites-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.view-all-favorites-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.view-all-favorites-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
}

.view-all-favorites-btn i:first-child {
  font-size: 0.875rem;
}

.view-all-favorites-btn i:last-child {
  font-size: 0.75rem;
}

.view-all-link {
  display: block;
  text-align: center;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
}

.view-all-link:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* Empty State */
.favorites-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
}

/* Loading State */
.favorites-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-secondary);
}

.favorites-loading i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #f59e0b;
}

/* User Profile Trigger */
.user-profile-trigger {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 4px 4px 4px 12px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.user-profile-trigger:hover {
  background: var(--hover-bg);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.user-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid transparent;
  background: var(--gradient-primary);
  padding: 2px;
  transition: all var(--transition-fast);
}

.user-profile-trigger:hover .user-avatar {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
  transform: scale(1.05);
}

.user-chevron {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 8px;
  transition: transform var(--transition-fast);
}

.user-profile-trigger.open .user-chevron {
  transform: rotate(180deg);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 28px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-menu-toggle:hover {
  color: var(--primary);
  transform: scale(1.1);
}

/* ============================================
   DROPDOWNS (Base)
   ============================================ */

.dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: var(--dropdown-width);
  max-height: var(--dropdown-max-height);
  background: #ffffff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-base);
  overflow: hidden;
  z-index: 1001;
  pointer-events: none; /* Prevent interaction when hidden */
}

.dropdown-panel.show,
.dropdown-panel.open {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important; /* Allow interaction when visible */
}

/* ============================================
   NOTIFICATION DROPDOWN
   ============================================ */

.notification-dropdown {
  width: var(--notification-width);
}

.notification-header {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.notification-tabs {
  display: flex;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

.notification-tab {
  padding: var(--spacing-xs) var(--spacing-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.notification-tab:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.notification-tab.active {
  background: var(--active-bg);
  color: var(--primary);
  font-weight: var(--font-weight-semibold);
}

.notification-list {
  max-height: 400px;
  overflow-y: auto;
  padding: var(--spacing-sm);
}

.notification-item {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.notification-item:hover {
  background: var(--hover-bg);
}

.notification-item.unread {
  background: rgba(51, 65, 85, 0.05);
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 80%;
  background: var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.notification-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 16px;
}

.notification-icon.quote { background: rgba(102, 126, 234, 0.1); color: var(--primary); }
.notification-icon.project { background: rgba(78, 205, 196, 0.1); color: #4ecdc4; }
.notification-icon.message { background: rgba(255, 165, 0, 0.1); color: #ffa500; }
.notification-icon.system { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); }

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-text {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-time {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.notification-footer {
  padding: var(--spacing-md);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.notification-footer-btn {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.notification-footer-btn:hover {
  background: var(--hover-bg);
  border-color: var(--primary);
  color: var(--primary);
}

.notification-empty {
  padding: var(--spacing-xl);
  text-align: center;
  color: var(--text-muted);
}

.notification-empty i {
  font-size: 48px;
  margin-bottom: var(--spacing-md);
  opacity: 0.3;
}

/* Enhanced notification styles */
.notification-item {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.2s ease;
  position: relative;
}

.notification-item.unread {
  background: #f8fafc;
  border-left: 3px solid #1e293b;
}

.notification-item:hover {
  background: #f1f5f9;
}

.notification-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.notification-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1e293b;
}

.notification-message {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.notification-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.notif-meta-price {
  background: #10b981;
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.notif-meta-tag {
  background: #e0e7ff;
  color: #4c51bf;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.notif-meta-urgent {
  background: #fef3c7;
  color: #92400e;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.notif-meta-location {
  color: #64748b;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.notification-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.notif-action-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  display: inline-block;
}

.notif-action-btn.primary {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
}

.notif-action-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.3);
}

.notif-action-btn.secondary {
  background: white;
  border: 1px solid #e2e8f0;
  color: #1e293b;
}

.notif-action-btn.secondary:hover {
  background: #f8fafc;
  border-color: #1e293b;
}

.notification-unread-dot {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
}

/* Enhanced notification icon colors */
.notification-icon.new_quote { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.notification-icon.quote_accepted { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.notification-icon.quote_rejected { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.notification-icon.new_project { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.notification-icon.project_invitation { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.notification-icon.review_received { background: rgba(251, 191, 36, 0.1); color: #fbbf24; }
.notification-icon.reminder_quote { background: rgba(249, 115, 22, 0.1); color: #f97316; }
.notification-icon.reminder_deadline { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.notification-icon.company_viewed { background: rgba(99, 102, 241, 0.1); color: #6366f1; }

/* ============================================
   USER DROPDOWN
   ============================================ */

.user-dropdown {
  width: var(--dropdown-width);
}

.user-dropdown-header {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.user-dropdown-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid transparent;
  background: var(--gradient-primary);
  padding: 2px;
}

.user-dropdown-info {
  flex: 1;
  min-width: 0;
}

.user-dropdown-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-email {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-menu {
  padding: var(--spacing-sm);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  font-size: var(--font-size-sm);
}

.user-dropdown-item:hover {
  background: var(--hover-bg);
  color: var(--primary);
}

.user-dropdown-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--spacing-sm) 0;
}

/* Dark mode toggle */
.dark-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
}

.dark-mode-toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dark-mode-toggle-switch.active {
  background: var(--primary);
}

.dark-mode-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark-mode-toggle-switch.active .dark-mode-toggle-thumb {
  transform: translateX(22px);
}

/* ============================================
   MOBILE MENU
   ============================================ */

.mobile-menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 1099;
}

.mobile-menu-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: -4px 0 40px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform var(--transition-base);
  overflow-y: auto;
  z-index: 1100;
}

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

.mobile-menu-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-menu-header h3 {
  font-size: 16px !important;
}

.mobile-menu-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-menu-close:hover {
  background: var(--badge-danger);
  border-color: var(--badge-danger);
  color: white;
  transform: rotate(90deg);
}

.mobile-menu-user {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-user .user-dropdown-avatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50%;
}

.mobile-menu-user .user-dropdown-name {
  font-size: 14px;
  font-weight: 600;
}

.mobile-menu-user .user-dropdown-email {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Plan badge i mobilmeny */
.mobile-plan-badge-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.mobile-plan-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.mobile-plan-badge {
  display: inline-flex;
}

.mobile-plan-badge .header-plan-value {
  font-size: 0.688rem;
  padding: 0.25rem 0.625rem;
}

.mobile-menu-nav {
  padding: 8px 12px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-fast);
  position: relative;
}

.mobile-menu-item:hover {
  background: var(--hover-bg);
  color: var(--primary);
}

.mobile-menu-item.active {
  background: var(--active-bg);
  color: var(--primary);
  font-weight: var(--font-weight-semibold);
}

.mobile-menu-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.mobile-menu-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--badge-danger);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
}

.mobile-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--spacing-md) 0;
}

/* ============================================
   SEARCH MODAL
   ============================================ */

.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 2000;
}

.search-modal.open {
  opacity: 1;
  visibility: visible;
}

.search-modal-content {
  width: 100%;
  max-width: 640px;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform var(--transition-base);
}

.search-modal.open .search-modal-content {
  transform: translateY(0);
}

.search-input-wrapper {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.search-input-wrapper i {
  font-size: 20px;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 18px;
  color: var(--text-primary);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-shortcut {
  padding: 4px 8px;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
}

.search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: var(--spacing-sm);
}

.search-result-group {
  margin-bottom: var(--spacing-md);
}

.search-result-group-title {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-result-item:hover {
  background: var(--hover-bg);
}

.search-result-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--hover-bg);
  color: var(--primary);
  font-size: 18px;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.search-empty {
  padding: var(--spacing-xl);
  text-align: center;
  color: var(--text-muted);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet and up */
@media (min-width: 1181px) {
  .header-container {
    padding: 0 var(--spacing-xl);
  }
  
  .mobile-menu {
    width: 360px;
  }
}

/* Desktop */
@media (min-width: 1181px) {
  .header-nav {
    display: flex;
  }
  
  .header-actions {
    display: flex;
  }
  
  .mobile-menu-toggle {
    display: none;
  }
  
  .header-logo img {
    width: var(--logo-width);
    height: var(--logo-height);
  }
}

/* Large desktop - show quick actions */
@media (min-width: 1280px) {
  .quick-actions {
    display: flex;
  }
}

/* Mobile and tablet adjustments */
@media (max-width: 1180px) {
  .header-logo img {
    width: var(--logo-width-mobile);
    height: var(--logo-height-mobile);
  }
  
  .header-modern.scrolled .header-logo img {
    width: calc(var(--logo-width-mobile) * 0.88);
    height: calc(var(--logo-height-mobile) * 0.88);
  }
}

/* ============================================
   UTILITIES
   ============================================ */

/* Scrollbar styling */
.notification-list::-webkit-scrollbar,
.search-results::-webkit-scrollbar,
.mobile-menu::-webkit-scrollbar {
  width: 8px;
}

.notification-list::-webkit-scrollbar-track,
.search-results::-webkit-scrollbar-track,
.mobile-menu::-webkit-scrollbar-track {
  background: transparent;
}

.notification-list::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb,
.mobile-menu::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

.notification-list::-webkit-scrollbar-thumb:hover,
.search-results::-webkit-scrollbar-thumb:hover,
.mobile-menu::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, 
    var(--hover-bg) 25%, 
    var(--active-bg) 50%, 
    var(--hover-bg) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
  overflow: hidden;
}

/* ========== Primary CTA Button for Customers in Header ========== */
.header-cta-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
  border-radius: 9999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
  animation: pulse-glow 2s ease-in-out infinite;
}

.header-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 41, 59, 0.5);
  background: linear-gradient(135deg, #334155 0%, #475569 100%);
}

.header-cta-btn i {
  font-size: 16px;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
  }
  50% {
    box-shadow: 0 4px 20px rgba(30, 41, 59, 0.6);
  }
}

/* Highlight navigation link (in nav bar) */
.header-nav-link-highlight {
  color: #1e293b !important;
  font-weight: 700 !important;
  background: rgba(30, 41, 59, 0.1);
  border-radius: 8px;
  padding: 8px 16px !important;
}

.header-nav-link-highlight:hover {
  background: rgba(30, 41, 59, 0.15);
}

/* Mobile menu highlight item */
.mobile-menu-item-highlight {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white !important;
  font-weight: 700;
  border-radius: 12px;
  padding: 16px !important;
  margin-bottom: 12px;
}

.mobile-menu-item-highlight:hover {
  background: linear-gradient(135deg, #334155 0%, #475569 100%);
  transform: translateX(4px);
}

.mobile-menu-item-highlight i {
  color: white;
}

/* ============================================
   CALCULATOR SIDEBAR TOGGLE
   ============================================ */

.calculator-sidebar-toggle {
  display: none; /* Hidden by default */
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  margin-left: 1rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
  white-space: nowrap;
  position: relative;
  z-index: 1050; /* Högre än sidebar (999) */
  pointer-events: auto; /* Försäkra att den är klickbar */
}

.calculator-sidebar-toggle:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.calculator-sidebar-toggle:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

.calculator-sidebar-toggle .toggle-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.calculator-sidebar-toggle .toggle-text {
  display: inline-block;
}

/* Show on tablet and desktop, but hide on mobile */
@media (min-width: 768px) {
  .calculator-sidebar-toggle {
    display: flex;
  }
}

/* Hide on desktop (>1024px) where sidebar is always visible */
@media (min-width: 1025px) {
  .calculator-sidebar-toggle {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }
}

/* Tablet specific adjustments (768-1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .calculator-sidebar-toggle {
    display: flex;
    margin-left: 0.75rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
  }
  
  .calculator-sidebar-toggle .toggle-icon {
    width: 16px;
    height: 16px;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .header-cta-btn {
    display: none; /* Hide in mobile, show in mobile menu instead */
  }
}
