/* ===== Smart Search Section ===== */
.smart-search-section {
  background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
  position: relative;
  z-index: 1;
}

.smart-search-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 28px 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.smart-search-label {
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  opacity: 0.85;
}

.smart-search-card .input-group-lg .form-control {
  font-size: 1.05rem;
  border: none;
  border-radius: 8px 0 0 8px !important;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a2e;
}

.smart-search-card .input-group-lg .form-control:focus {
  background: #ffffff;
  box-shadow: none;
  outline: none;
}

.smart-search-card .input-group-lg .form-control::placeholder {
  color: #888;
  font-style: italic;
}

.smart-search-card .btn-primary {
  border-radius: 0 8px 8px 0 !important;
  padding: 0 24px;
  font-weight: 600;
  white-space: nowrap;
  background: #e94560;
  border-color: #e94560;
  font-size: 1rem;
}

.smart-search-card .btn-primary:hover {
  background: #c73652;
  border-color: #c73652;
}

.smart-search-hint {
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 0.82rem;
  line-height: 1.5;
}

#lang-detecting {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
}

#lang-detecting .spinner-border {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

#lang-detected .badge {
  font-size: 0.85rem !important;
  background: #28a745 !important;
}

/* ===== Language Dropdown ===== */
.lang-selector-item {
  display: flex;
  align-items: center;
  position: relative;
}

#lang-dropdown-trigger {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

#lang-dropdown-trigger::after {
  content: '▾';
  font-size: 0.7em;
  opacity: 0.7;
}

#lang-dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.12);
}

#lang-dropdown-trigger.show {
  background: rgba(255, 255, 255, 0.15);
}

#lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  max-height: 320px;
  overflow-y: auto;
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  padding: 6px 0;
  list-style: none;
  margin: 0;
}

#lang-dropdown-menu.show { display: block; }

#lang-dropdown-menu .lang-option {
  display: block;
  padding: 8px 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.88rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  white-space: nowrap;
}

#lang-dropdown-menu .lang-option:hover {
  background: rgba(233, 69, 96, 0.2);
  color: #ffffff;
}

#lang-dropdown-menu .lang-option.active {
  background: rgba(233, 69, 96, 0.35);
  color: #e94560;
  font-weight: 600;
}

/* Scrollbar for dropdown */
#lang-dropdown-menu::-webkit-scrollbar { width: 4px; }
#lang-dropdown-menu::-webkit-scrollbar-track { background: transparent; }
#lang-dropdown-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

/* ===== Responsive adjustments ===== */
@media (max-width: 991.98px) {
  .smart-search-card { padding: 20px 18px; }
  #lang-dropdown-trigger { font-size: 0.75rem; padding: 3px 7px; }
  #lang-current-name { display: none; }
  #lang-dropdown-trigger::before { content: '🌐'; font-size: 1rem; }
}

@media (max-width: 575.98px) {
  .smart-search-card { padding: 16px 14px; border-radius: 10px; }
  .smart-search-card .input-group-lg .form-control { font-size: 0.95rem; padding: 11px 14px; }
  .smart-search-card .btn-primary { padding: 0 14px; font-size: 0.9rem; }
}

/* ===== RTL support ===== */
[dir="rtl"] .smart-search-card .form-control {
  border-radius: 0 8px 8px 0 !important;
  text-align: right;
}

[dir="rtl"] .smart-search-card .btn-primary {
  border-radius: 8px 0 0 8px !important;
}

[dir="rtl"] #lang-dropdown-menu { right: auto; left: 0; }

[dir="rtl"] .menu-right { flex-direction: row-reverse; }
