/* ================================================
   SEARCH.CSS - Viewport-Based Positioning Solution - NAVBAR HEIGHT FIXED
   Version: 5.11 - Responsive Padding Architecture Implemented
   
   SOLUTION: Use CSS custom properties for consistent responsive padding
   - Integrated with existing design system (--container-padding)
   - All breakpoints now use responsive padding
   - Eliminates padding inconsistencies across viewport sizes
   - Search content width matches page content width at all sizes
   ================================================ */

/* Typography Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ================================================
   SEARCH MODE ACTIVATION - NAVBAR TRANSFORMATION
   ================================================ */

/* Search mode state - transforms entire navbar */
.navbar-search-mode {
  background: linear-gradient(135deg, var(--bg-dark, #1e293b) 0%, #0f172a 100%);
  box-shadow: var(--shadow-2xl, 0 25px 50px -12px rgba(0, 0, 0, 0.25));
  transition: all var(--transition-slow, 300ms ease);
}

/* Hide regular navigation when search is active */
.navbar-search-mode .navbar-collapse {
  display: none;
}

/* ================================================
   SEARCH CONTAINER - VIEWPORT OPTIMIZED
   ================================================ */

/* Main search container - replaces navbar content */
.navbar-search-container {
  display: none; /* Hidden by default, shown by JavaScript */
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--navbar-height);
  min-height: var(--navbar-height);
  padding: 0 var(--container-padding);
  position: relative;
  z-index: var(--z-modal, 40);
  background: transparent;
  box-sizing: border-box;
}

/* Search form - responsive centering with max-width */
.navbar-search-form {
  width: 100%;
  max-width: none;
  position: relative;
  margin: 0 auto;
}

/* ================================================
   SEARCH INPUT GROUP - ARCHITECTURAL TRANSITION CONTROL
   ================================================ */

/* Input group container - ARCHITECTURAL SOLUTION */
.navbar-search-input-group {
  display: flex;
  align-items: center;
  background: var(--bg-white, #ffffff);
  border-radius: var(--radius-xl, 12px);
  box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1)), 
              0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  position: relative;
  border: 2px solid transparent;
  backdrop-filter: blur(10px);
  height: 45px;
  min-height: 45px;
  box-sizing: border-box;
  /* Smooth transitions enabled by default */
  transition: border-color var(--transition-base, 200ms ease), 
              box-shadow var(--transition-base, 200ms ease);
}

/* ARCHITECTURAL: State class for transition control during search opening */
.navbar-search-input-group.no-transitions {
  transition: none !important;
}

/* Enhanced focus state - smooth transitions */
.navbar-search-input-group:focus-within {
  border-color: var(--primary-blue, #0061ff);
  box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1)), 
              0 0 0 4px rgba(0, 97, 255, 0.1),
              0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ================================================
   SEARCH BUTTONS - CONSISTENT STYLING
   ================================================ */

/* Base button styling - WITH SMOOTH TRANSITIONS */
.navbar-search-btn {
  background: none;
  border: none;
  padding: var(--space-5, 20px);
  cursor: pointer;
  transition: background-color var(--transition-base, 200ms ease), 
              color var(--transition-base, 200ms ease);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg, 1.125rem);
  color: var(--text-muted, #9ca3af);
  min-width: 45px;
  width: 45px;
  height: 45px;
  min-height: 45px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.navbar-search-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 97, 255, 0.1), transparent);
  transition: left var(--transition-slow, 300ms ease);
}

.navbar-search-btn:hover {
  background-color: var(--bg-light, #f8fafc);
  color: var(--primary-blue, #0061ff);
}

.navbar-search-btn:hover::before {
  left: 100%;
}

.navbar-search-btn:focus {
  outline: 2px solid var(--primary-blue, #0061ff);
  outline-offset: 2px;
}

.navbar-search-btn:active {
  background-color: var(--bg-light, #f8fafc);
}

/* Back button - left aligned with return arrow */
.navbar-search-back {
  border-radius: var(--radius-xl, 12px) 0 0 var(--radius-xl, 12px);
  color: var(--text-secondary, #4b5563);
}

.navbar-search-back:hover {
  color: var(--text-primary, #1f2937);
}

/* Submit button - primary styling with gradient */
.navbar-search-submit {
  background: linear-gradient(135deg, var(--primary-blue, #0061ff), var(--primary-dark, #0052d9));
  color: var(--text-white, #ffffff);
  border-radius: 0 var(--radius-xl, 12px) var(--radius-xl, 12px) 0;
}

.navbar-search-submit::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.navbar-search-submit:hover {
  background: linear-gradient(135deg, var(--primary-dark, #0052d9), #003d7a);
  color: var(--text-white, #ffffff);
}

/* Clear button - conditionally visible with smooth animation */
.navbar-search-clear {
  display: none;
  color: var(--text-muted, #9ca3af);
  opacity: 0;
  transition: opacity var(--transition-base, 200ms ease);
}

.navbar-search-clear.visible {
  display: flex;
  opacity: 1;
}

.navbar-search-clear:hover {
  color: var(--error-red, #ef4444);
  background-color: #fef2f2;
}

/* ================================================
   SEARCH INPUT - ENHANCED TYPOGRAPHY - SMOOTH TRANSITIONS
   ================================================ */

/* Main search input - ARCHITECTURAL SOLUTION */
.navbar-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: var(--space-5, 20px);
  font-size: var(--text-base, 1rem);
  font-family: var(--font-primary, 'Inter', sans-serif);
  font-weight: var(--font-normal, 400);
  background: transparent;
  color: var(--text-primary, #1f2937);
  line-height: var(--leading-normal, 1.5);
  height: 45px;
  min-height: 45px;
  transition: color var(--transition-base, 200ms ease);
  box-sizing: border-box;
}

.navbar-search-input::placeholder {
  color: var(--text-muted, #9ca3af);
  font-weight: var(--font-normal, 400);
  transition: color var(--transition-base, 200ms ease);
}

.navbar-search-input:focus {
  color: var(--text-primary, #1f2937);
}

.navbar-search-input:focus::placeholder {
  color: var(--text-light, #e5e7eb);
}

/* ================================================
   SEARCH RESULTS - DROPDOWN SYSTEM
   ================================================ */

/* Results container positioned like mega dropdown */
.navbar-search-results {
  position: absolute;
  top: calc(100% + var(--space-2, 8px));
  left: 0;
  right: 0;
  background: var(--bg-white, #ffffff);
  border-radius: var(--radius-xl, 12px);
  box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1)),
              0 0 0 1px rgba(0, 0, 0, 0.05);
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: var(--z-popover, 50);
  display: none;
  border-top: 3px solid var(--primary-blue, #0061ff);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  transition: all var(--transition-slow, 300ms ease);
}

/* Show results with smooth animation */
.navbar-search-results.show {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Results content wrapper */
.search-results-content {
  padding: var(--space-2, 8px) 0;
}

/* Custom scrollbar for results */
.navbar-search-results::-webkit-scrollbar {
  width: 6px;
}

.navbar-search-results::-webkit-scrollbar-track {
  background: var(--bg-light, #f8fafc);
  border-radius: var(--radius-base, 4px);
}

.navbar-search-results::-webkit-scrollbar-thumb {
  background: var(--border-default, #cbd5e1);
  border-radius: var(--radius-base, 4px);
}

.navbar-search-results::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted, #9ca3af);
}

/* ================================================
   SEARCH STATES - LOADING, EMPTY, ERROR
   ================================================ */

/* Loading state with animated spinner */
.search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3, 12px);
  padding: var(--space-8, 32px);
  color: var(--text-secondary, #4b5563);
  font-size: var(--text-sm, 0.875rem);
  font-family: var(--font-primary, 'Inter', sans-serif);
}

/* Enhanced loading spinner */
.search-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light, #e2e8f0);
  border-top: 2px solid var(--primary-blue, #0061ff);
  border-radius: var(--radius-full, 9999px);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* No results state with icon */
.search-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10, 40px) var(--space-5, 20px);
  text-align: center;
  color: var(--text-secondary, #4b5563);
  font-family: var(--font-primary, 'Inter', sans-serif);
}

.search-no-results::before {
  content: '🔍';
  font-size: var(--text-5xl, 3rem);
  margin-bottom: var(--space-4, 16px);
  opacity: 0.5;
  display: block;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Error state */
.search-error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10, 40px) var(--space-5, 20px);
  text-align: center;
  color: var(--error-red, #ef4444);
  font-family: var(--font-primary, 'Inter', sans-serif);
}

.search-error-message::before {
  content: '⚠️';
  font-size: var(--text-5xl, 3rem);
  margin-bottom: var(--space-4, 16px);
  opacity: 0.7;
  display: block;
}

/* ================================================
   SEARCH RESULT ITEMS - ENHANCED CARD DESIGN
   ================================================ */

/* Results list */
.search-results-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

/* Individual result item with enhanced hover effects */
.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-4, 16px);
  padding: var(--space-4, 16px) var(--space-5, 20px);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-base, 200ms ease);
  border-left: 3px solid transparent;
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
  border-radius: var(--radius-lg, 8px);
  margin: var(--space-1, 4px) var(--space-2, 8px);
}

/* Enhanced hover animation with shimmer effect */
.search-result-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 97, 255, 0.08), transparent);
  transition: left var(--transition-slow, 300ms ease);
}

.search-result-item:hover {
  background-color: var(--bg-light, #f8fafc);
  border-left-color: var(--primary-blue, #0061ff);
  text-decoration: none;
  transform: translateX(5px);
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
}

.search-result-item:hover::before {
  left: 100%;
}

.search-result-item:focus {
  outline: 2px solid var(--primary-blue, #0061ff);
  outline-offset: 2px;
  background-color: var(--bg-light, #f8fafc);
}

/* Result item icon with dynamic colors */
.search-result-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--bg-light, #f8fafc), var(--border-light, #e2e8f0));
  border-radius: var(--radius-lg, 8px);
  color: var(--text-secondary, #4b5563);
  flex-shrink: 0;
  transition: all var(--transition-base, 200ms ease);
  font-size: var(--text-base, 1rem);
  position: relative;
  overflow: hidden;
}

.search-result-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity var(--transition-base, 200ms ease);
}

.search-result-item:hover .search-result-icon {
  background: linear-gradient(135deg, var(--primary-blue, #0061ff), var(--primary-dark, #0052d9));
  color: var(--text-white, #ffffff);
  transform: scale(1.1) rotate(5deg);
  box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
}

.search-result-item:hover .search-result-icon::before {
  opacity: 1;
}

/* Result item content with improved typography */
.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: var(--text-base, 1rem);
  font-weight: var(--font-semibold, 600);
  color: var(--text-primary, #1f2937);
  line-height: var(--leading-snug, 1.375);
  margin-bottom: var(--space-1, 4px);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font-primary, 'Inter', sans-serif);
  transition: color var(--transition-base, 200ms ease);
}

.search-result-item:hover .search-result-title {
  color: var(--primary-blue, #0061ff);
}

.search-result-type {
  font-size: var(--text-xs, 0.75rem);
  color: var(--text-secondary, #4b5563);
  font-weight: var(--font-medium, 500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-primary, 'Inter', sans-serif);
  opacity: 0.8;
  transition: opacity var(--transition-base, 200ms ease);
}

.search-result-item:hover .search-result-type {
  opacity: 1;
}

/* ================================================
   SEARCH RESULT TYPE VARIANTS
   ================================================ */

/* Blog post results with warm colors */
.search-result-item[data-type="blog_posts"] .search-result-icon {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #d97706;
}

.search-result-item[data-type="blog_posts"]:hover .search-result-icon {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: var(--text-white, #ffffff);
}

/* Page results with blue colors */
.search-result-item[data-type="pages"] .search-result-icon {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #2563eb;
}

.search-result-item[data-type="pages"]:hover .search-result-icon {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: var(--text-white, #ffffff);
}

/* Calculator/Tools results with green colors */
.search-result-item[data-type="calculators"] .search-result-icon,
.search-result-item[data-type="tools"] .search-result-icon {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: var(--accent-green, #10b981);
}

.search-result-item[data-type="calculators"]:hover .search-result-icon,
.search-result-item[data-type="tools"]:hover .search-result-icon {
  background: linear-gradient(135deg, var(--accent-green, #10b981), #047857);
  color: var(--text-white, #ffffff);
}

/* ================================================
   SEARCH FOOTER ACTIONS
   ================================================ */

/* View all results footer with enhanced design */
.search-view-all {
  padding: var(--space-4, 16px) var(--space-5, 20px);
  background: linear-gradient(135deg, var(--bg-light, #f8fafc), #f1f5f9);
  border-top: 1px solid var(--border-light, #e2e8f0);
  border-radius: 0 0 var(--radius-xl, 12px) var(--radius-xl, 12px);
  margin-top: var(--space-2, 8px);
}

.search-view-all a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2, 8px);
  padding: var(--space-3, 12px) var(--space-5, 20px);
  background: linear-gradient(135deg, var(--primary-blue, #0061ff), var(--primary-dark, #0052d9));
  color: var(--text-white, #ffffff);
  text-decoration: none;
  border-radius: var(--radius-lg, 8px);
  font-weight: var(--font-semibold, 600);
  font-size: var(--text-sm, 0.875rem);
  transition: all var(--transition-slow, 300ms ease);
  font-family: var(--font-primary, 'Inter', sans-serif);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.search-view-all a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-slow, 300ms ease);
}

.search-view-all a:hover {
  background: linear-gradient(135deg, var(--primary-dark, #0052d9), #003d7a);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
  text-decoration: none;
  color: var(--text-white, #ffffff);
}

.search-view-all a:hover::before {
  left: 100%;
}

.search-view-all i {
  font-size: var(--text-xs, 0.75rem);
  transition: transform var(--transition-base, 200ms ease);
}

.search-view-all a:hover i {
  transform: translateX(3px);
}

/* ================================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZATION WITH HEIGHT FIX
   ================================================ */

/* Large screens - max width constraint */
@media (min-width: 1800px) {
  .navbar-search-form {
    max-width: 1200px;
  }
}

/* Desktop screens */
@media (min-width: 992px) and (max-width: 1799px) {
  .navbar-search-container {
    padding: 0 var(--container-padding);
  }
}

/* Tablet screens */
@media (max-width: 991px) {
  .navbar-search-container {
    padding: 0 var(--container-padding);
  }
  
  .navbar-search-form {
    max-width: calc(100vw - var(--space-16, 4rem));
  }
}

/* ================================================
   MOBILE SEARCH MODE - CLEAN INTERFACE WITH HEIGHT FIX
   ================================================ */

/* Mobile screens - optimized search experience with consistent height */
@media (max-width: 991px) {
  /* NAVBAR HEIGHT FIX: Ensure navbar maintains consistent height */
  .navbar {
    height: var(--navbar-height);
    min-height: var(--navbar-height);
  }
  
  /* Mobile search mode - hide all navbar elements except search */
  .navbar-search-mode .navbar-brand,
  .navbar-search-mode .mobile-search-toggle,
  .navbar-search-mode .navbar-toggle {
    display: none;
  }
  
  /* Full-width search container on mobile with consistent height */
  .navbar-search-mode .navbar-search-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--navbar-height);
    min-height: var(--navbar-height);
    padding: 0 var(--container-padding);
    z-index: 1002;
  }
  
  /* Full-width form on mobile */
  .navbar-search-mode .navbar-search-form {
    max-width: 100%;
    width: 100%;
  }
  
  /* Mobile input group adjustments */
  .navbar-search-input-group {
    border-radius: var(--radius-lg, 8px);
    height: 44px;
    min-height: 44px;
  }
  
  .navbar-search-btn {
    padding: var(--space-4, 16px);
    min-width: 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    font-size: var(--text-base, 1rem);
  }
  
  .navbar-search-input {
    padding: var(--space-4, 16px);
    font-size: var(--text-sm, 0.875rem);
    height: 44px;
    min-height: 44px;
  }
  
  .navbar-search-results {
    border-radius: var(--radius-lg, 8px);
    max-height: 350px;
  }
  
  .search-result-item {
    padding: var(--space-3, 12px) var(--space-4, 16px);
    gap: var(--space-3, 12px);
    margin: var(--space-1, 4px) var(--space-2, 8px);
  }
  
  .search-result-item:hover {
    transform: translateX(3px);
  }
  
  .search-result-icon {
    width: 36px;
    height: 36px;
    font-size: var(--text-sm, 0.875rem);
  }
  
  .search-result-title {
    font-size: var(--text-sm, 0.875rem);
  }
  
  .search-result-type {
    font-size: 11px;
  }
  
  .search-loading,
  .search-no-results,
  .search-error-message {
    padding: var(--space-6, 24px) var(--space-4, 16px);
  }
  
  .search-view-all {
    padding: var(--space-3, 12px) var(--space-4, 16px);
  }
  
  .search-view-all a {
    padding: var(--space-2, 8px) var(--space-4, 16px);
    font-size: var(--text-xs, 0.75rem);
  }
}

/* ================================================
   DESKTOP SEARCH MODE - RESPONSIVE WIDTH CALCULATION
   ================================================ */

@media (min-width: 992px) {
  /* Desktop search mode - hide brand for clean interface */
  .navbar-search-mode .navbar-brand {
    display: none;
  }
  
  /* Search container - RESPONSIVE width with proper centering */
  .navbar.navbar-search-mode .navbar-search-container {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(var(--container-max), calc(100vw - 40px));
    max-width: calc(100vw - 40px);
    height: var(--navbar-height);
    z-index: 1002;
    padding: 0 var(--container-padding);
  }
  
  /* Form - ensure proper width inheritance */
  .navbar.navbar-search-mode .navbar-search-form {
    width: 100%;
    max-width: none;
  }
  
  /* Input group - proper navbar height */
  .navbar-search-input-group {
    height: 45px;
    min-height: 45px;
  }
  
  .navbar-search-input {
    height: 45px;
    min-height: 45px;
    padding: 0 16px;
    font-size: 16px;
  }
  
  .navbar-search-btn {
    height: 45px;
    min-height: 45px;
    min-width: 45px;
    width: 45px;
    padding: 0 16px;
  }
}

/* Small mobile screens with height consistency */
@media (max-width: 480px) {
  /* NAVBAR HEIGHT FIX: Ensure consistent height on small screens */
  .navbar {
    height: var(--navbar-height);
    min-height: var(--navbar-height);
  }
  
  .navbar-search-mode .navbar-search-container {
    padding: 0 var(--container-padding);
    height: var(--navbar-height);
    min-height: var(--navbar-height);
  }
  
  .navbar-search-btn {
    padding: var(--space-3, 12px);
    min-width: 40px;
    width: 40px;
    height: 40px;
    min-height: 40px;
  }
  
  .navbar-search-input-group {
    height: 40px;
    min-height: 40px;
  }
  
  .search-result-item {
    padding: var(--space-2, 8px) var(--space-3, 12px);
  }
  
  .search-result-icon {
    width: 32px;
    height: 32px;
  }
  
  .search-result-title {
    font-size: var(--text-xs, 0.75rem);
  }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
  .navbar-search-input-group {
    border: 2px solid var(--text-primary, #1f2937);
  }
  
  .search-result-item {
    border: 1px solid var(--border-light, #e2e8f0);
  }
  
  .search-result-item:hover {
    border-left-width: 4px;
    border-color: var(--primary-blue, #0061ff);
  }
  
  .navbar-search-results {
    border: 2px solid var(--border-default, #cbd5e1);
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .search-spinner {
    animation: none;
  }
  
  .search-no-results::before {
    animation: none;
  }
  
  .search-result-item::before,
  .navbar-search-btn::before,
  .search-view-all a::before {
    display: none;
  }
  
  .search-result-item,
  .navbar-search-btn,
  .navbar-search-input-group,
  .navbar-search-results,
  .search-result-icon,
  .search-view-all a {
    transition: none;
  }
}

/* Focus visible - modern focus management */
.navbar-search-btn:focus-visible,
.navbar-search-input:focus-visible,
.search-result-item:focus-visible {
  outline: 2px solid var(--primary-blue, #0061ff);
  outline-offset: 2px;
}

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

/* Ensure search doesn't interfere with dropdowns */
.navbar-search-mode .dropdown-menu {
  display: none;
}

/* Prevent search results from being clipped */
.navbar-search-results {
  max-height: min(420px, calc(100vh - 120px));
}

/* Smooth scrolling for results */
.navbar-search-results {
  scroll-behavior: smooth;
}

/* Prevent body scroll when search is active on mobile */
body.search-active {
  overflow: hidden;
}

@media (max-width: 991px) {
  body.search-active {
    position: fixed;
    width: 100%;
  }
}

/* Search overlay for mobile - prevents interaction with background */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: var(--z-overlay, 30);
  display: none;
  backdrop-filter: blur(4px);
}

@media (max-width: 991px) {
  .navbar-search-mode .search-overlay {
    display: block;
  }
}

/* ================================================
   SEARCH PERFORMANCE OPTIMIZATIONS
   ================================================ */

/* GPU acceleration for animations */
.navbar-search-btn,
.search-result-item,
.search-result-icon,
.navbar-search-input-group {
  will-change: transform;
  backface-visibility: hidden;
}

/* Optimize repaints */
.navbar-search-results {
  contain: layout style paint;
}

/* ================================================
   SEARCH COMPONENT STATES
   ================================================ */

/* Loading state indicator */
.navbar-search-form.loading .navbar-search-submit {
  pointer-events: none;
}

.navbar-search-form.loading .navbar-search-submit::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Error state */
.navbar-search-input-group.error {
  border-color: var(--error-red, #ef4444);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Success state */
.navbar-search-input-group.success {
  border-color: var(--accent-green, #10b981);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ================================================
   SEARCH KEYBOARD NAVIGATION
   ================================================ */

/* Highlight selected result during keyboard navigation */
.search-result-item.keyboard-selected {
  background-color: var(--primary-blue, #0061ff);
  color: var(--text-white, #ffffff);
  border-left-color: var(--text-white, #ffffff);
}

.search-result-item.keyboard-selected .search-result-title,
.search-result-item.keyboard-selected .search-result-type {
  color: var(--text-white, #ffffff);
}

.search-result-item.keyboard-selected .search-result-icon {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-white, #ffffff);
}

/* ================================================
   LEGACY BROWSER SUPPORT
   ================================================ */

/* Fallbacks for older browsers */
@supports not (backdrop-filter: blur(10px)) {
  .navbar-search-input-group,
  .navbar-search-results {
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.95);
  }
}

@supports not (display: flex) {
  .navbar-search-container {
    display: block;
    text-align: center;
  }
  
  .navbar-search-input-group {
    display: inline-block;
    width: 100%;
  }
}

/* ================================================
   PRINT STYLES
   ================================================ */

@media print {
  .navbar-search-container,
  .navbar-search-results {
    display: none;
  }
}