/* Search Container */
.search-container {
  width: 100%;
  max-width: 680px;
  margin-bottom: 1.5rem;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 4px rgba(27, 122, 43, 0.1), var(--shadow-md);
}

.search-icon {
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  color: var(--gray-400);
}

.search-icon svg {
  width: 22px;
  height: 22px;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 1.125rem;
  padding: 1.1rem 0;
  color: var(--gray-900);
  background: transparent;
  direction: rtl;
}

.search-input::placeholder {
  color: var(--gray-400);
}

.search-btn {
  background: var(--red-primary);
  color: var(--white);
  border: none;
  font-family: 'Noto Kufi Arabic', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 1.1rem 2rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.search-btn:hover {
  background: var(--red-dark);
}

/* Search Tabs - Professional Google-style tabs */
.search-tabs {
  margin-top: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.search-tabs-container {
  display: flex;
  gap: 0;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1rem;
}

.search-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  color: var(--gray-600);
  font-family: 'Noto Kufi Arabic', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
}

.search-tab:hover {
  color: var(--green-primary);
  background: rgba(27, 122, 43, 0.04);
}

.search-tab.active {
  color: var(--green-primary);
  border-bottom-color: var(--green-primary);
  font-weight: 600;
}

.search-tab.active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--green-primary);
  border-radius: 3px 3px 0 0;
}

.tab-icon {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.search-tab.active .tab-icon {
  opacity: 1;
}

/* AI Mode Tab - Special styling */
.search-tab.ai-mode-tab {
  background: linear-gradient(135deg, rgba(27, 122, 43, 0.08) 0%, rgba(27, 122, 43, 0.04) 100%);
  color: var(--green-primary);
  border-radius: 8px 8px 0 0;
  margin-right: 4px;
}

body.rtl .search-tab.ai-mode-tab {
  margin-right: 0;
  margin-left: 4px;
}

.search-tab.ai-mode-tab:hover {
  background: linear-gradient(135deg, rgba(27, 122, 43, 0.15) 0%, rgba(27, 122, 43, 0.08) 100%);
  color: var(--green-dark);
}

.search-tab.ai-mode-tab.active {
  background: linear-gradient(135deg, var(--green-primary) 0%, #1a7a3b 100%);
  color: white;
  border-bottom-color: transparent;
}

.search-tab.ai-mode-tab.active::after {
  display: none;
}

.search-tab.ai-mode-tab .tab-icon {
  opacity: 1;
}

.search-tab.ai-mode-tab.active .tab-icon {
  stroke: white;
  fill: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .search-container {
    max-width: 100%;
  }
  
  .search-btn {
    padding: 1.1rem 1.25rem;
    font-size: 0.9375rem;
  }
  
  .search-tabs-container {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .search-tab {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
  }
  
  .tab-icon {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 480px) {
  .search-box {
    flex-direction: column;
  }
  
  /* Hide the standalone icon on mobile */
  .search-icon {
    display: none;
  }
  
  /* Add background image to input instead */
  .search-input {
    width: 100%;
    font-size: 16px;
    padding: 14px 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
  }
  
  /* For RTL, adjust background position */
  [dir="rtl"] .search-input {
    background-position: left 16px center;
  }
  
  .search-btn {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
  }
  
  /* Mobile tabs */
  .search-tabs {
    margin-top: 1rem;
  }
  
  .search-tabs-container {
    justify-content: center;
    padding: 0 0.5rem;
  }
  
  .search-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.375rem;
  }
  
  .tab-icon {
    width: 14px;
    height: 14px;
  }
  
  /* AI tab on mobile */
  .search-tab.ai-mode-tab {
    padding: 0.5rem 0.875rem;
  }
  
  .search-tab.ai-mode-tab span {
    font-size: 0.75rem;
  }
}

@media (max-width: 360px) {
  .search-tabs-container {
    gap: 0;
  }
  
  .search-tab {
    padding: 0.5rem 0.625rem;
    font-size: 0.6875rem;
    gap: 0.25rem;
  }
  
  .tab-icon {
    width: 12px;
    height: 12px;
  }
  
  .search-tab.ai-mode-tab {
    padding: 0.5rem 0.75rem;
  }
  
  .search-tab.ai-mode-tab span {
    font-size: 0.6875rem;
  }
}