/* ════════════════════════════════════════
   AGIICAM SMART SEARCH — CSS
   Couleurs : vert #2ecc71 / fond sombre #0d1b2a
   Compatible : Houzez, RealHomes, thèmes custom
════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --ags-green:      #2ecc71;
  --ags-green-dark: #27ae60;
  --ags-dark:       #0d1b2a;
  --ags-radius-pill:40px;
  --ags-radius-md:  10px;
  --ags-shadow:     0 4px 24px rgba(0,0,0,0.12);
  --ags-font:       'Plus Jakarta Sans', 'Nunito', sans-serif;
}

/* ── Wrapper ── */
.agiicam-search-wrapper {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  font-family: var(--ags-font);
  z-index: 100;
}

/* ── Onglets ── */
.ags-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
}

.ags-tab {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  font-family: var(--ags-font);
}

.ags-tab:hover { color: rgba(255,255,255,0.8); }
.ags-tab.active { color: #fff; border-bottom-color: var(--ags-green); }

/* ── Boîte de recherche ── */
.ags-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: var(--ags-radius-pill);
  padding: 6px 8px 6px 20px;
  box-shadow: var(--ags-shadow);
}

.ags-icon-search {
  color: var(--ags-green);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.ags-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 15px;
  color: #1a1a1a;
  background: transparent;
  font-family: var(--ags-font);
  padding: 4px 0;
}
.ags-input::placeholder { color: #aaa; }

/* ── Bouton voix ── */
.ags-btn-voice {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 6px;
  display: flex;
  align-items: center;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.ags-btn-voice:hover { color: var(--ags-green); background: #f0faf5; }
.ags-btn-voice.listening { color: #e74c3c; animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Bouton filtres ── */
.ags-btn-filters {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: var(--ags-radius-pill);
  padding: 7px 16px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
  font-family: var(--ags-font);
  flex-shrink: 0;
}
.ags-btn-filters:hover { border-color: var(--ags-green); color: var(--ags-green); }
.ags-btn-filters.active { border-color: var(--ags-green); color: var(--ags-green); background: #f0faf5; }

.ags-filter-count {
  background: var(--ags-green);
  color: #fff;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Bouton rechercher ── */
.ags-btn-search {
  background: var(--ags-green);
  border: none;
  border-radius: var(--ags-radius-pill);
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
  font-family: var(--ags-font);
  flex-shrink: 0;
}
.ags-btn-search:hover  { background: var(--ags-green-dark); }
.ags-btn-search:active { transform: scale(0.97); }

/* ── Suggestions dropdown ── */
.ags-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  z-index: 200;
  overflow: hidden;
  border: 0.5px solid rgba(0,0,0,0.08);
}

.ags-suggestions-section {
  border-bottom: 0.5px solid #f0f0f0;
  padding: 8px 0;
}
.ags-suggestions-section:last-child { border-bottom: none; }

.ags-section-label {
  font-size: 11px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 16px 2px;
  font-weight: 600;
}

/* Item annonce */
.ags-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.1s;
  text-decoration: none;
  color: inherit;
}
.ags-result-item:hover { background: #f8f8f8; }

.ags-result-thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: #f0f0f0;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ags-result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ags-result-thumb svg { opacity: 0.4; }

.ags-result-info { flex: 1; min-width: 0; }
.ags-result-title {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ags-result-meta {
  font-size: 12px;
  color: #888;
  margin-top: 1px;
}
.ags-result-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--ags-green);
  white-space: nowrap;
  flex-shrink: 0;
}

.ags-tf-badge {
  display: inline-block;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Tags quartiers */
.ags-quartiers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
}
.ags-quartier-tag {
  background: #f0faf5;
  border: 1px solid #c8f0dc;
  border-radius: 50px;
  padding: 4px 14px;
  font-size: 13px;
  color: #1a6b3c;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  font-family: var(--ags-font);
}
.ags-quartier-tag:hover { background: #d4f0e2; }

/* Footer suggestions */
.ags-suggestions-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #fafafa;
}
.ags-suggestions-footer span { font-size: 13px; color: #888; }
.ags-suggestions-footer a {
  font-size: 13px;
  color: var(--ags-green);
  font-weight: 600;
  text-decoration: none;
}
.ags-suggestions-footer a:hover { text-decoration: underline; }

/* Loader */
.ags-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  color: #888;
  font-size: 13px;
}
.ags-spinner {
  width: 16px; height: 16px;
  border: 2px solid #e0e0e0;
  border-top-color: var(--ags-green);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Filtres avancés ── */
.ags-filters-panel {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--ags-shadow);
  padding: 20px;
  margin-top: 8px;
  border: 0.5px solid rgba(0,0,0,0.08);
}

.ags-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.ags-filter-group--full { grid-column: 1 / -1; }

.ags-filter-label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 500;
}

.ags-filter-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  color: #1a1a1a;
  background: #fafafa;
  outline: none;
  transition: border-color 0.2s;
  font-family: var(--ags-font);
  box-sizing: border-box;
}
.ags-filter-input:focus { border-color: var(--ags-green); background: #fff; }

/* Checkbox custom */
.ags-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}
.ags-checkbox { display: none; }
.ags-checkbox-custom {
  width: 18px; height: 18px;
  border: 2px solid #ddd;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.ags-checkbox:checked + .ags-checkbox-custom {
  background: var(--ags-green);
  border-color: var(--ags-green);
}
.ags-checkbox:checked + .ags-checkbox-custom::after {
  content: '';
  display: block;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

/* Boutons filtres */
.ags-filters-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}
.ags-btn-reset {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: var(--ags-radius-pill);
  padding: 8px 20px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  font-family: var(--ags-font);
  transition: border-color 0.2s;
}
.ags-btn-reset:hover { border-color: #888; }
.ags-btn-apply {
  background: var(--ags-green);
  border: none;
  border-radius: var(--ags-radius-pill);
  padding: 8px 24px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  font-family: var(--ags-font);
  transition: background 0.2s;
}
.ags-btn-apply:hover { background: var(--ags-green-dark); }

/* ── Tags populaires ── */
.ags-popular {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.ags-popular-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.ags-popular-tag {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  padding: 5px 16px;
  font-size: 12px;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: var(--ags-font);
}
.ags-popular-tag:hover {
  background: rgba(46, 204, 113, 0.2);
  border-color: var(--ags-green);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .ags-btn-filters { display: none; }
  .ags-btn-search  { padding: 10px 16px; font-size: 13px; }
  .ags-input       { font-size: 14px; }
  .ags-tab         { padding: 8px 14px; font-size: 13px; }
}
