/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(18, 18, 26, 0.85);
  --bg-card-hover: rgba(24, 24, 36, 0.95);
  --border: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(99, 102, 241, 0.5);
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.3);
  --red: #ef4444;
  --yellow: #f59e0b;
  --orange: #f97316;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== ANIMATED BACKGROUND ===== */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
  animation: floatGlow 20s ease-in-out infinite;
}

.bg-glow-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent);
  top: -200px;
  left: -100px;
  animation-delay: 0s;
}

.bg-glow-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12), transparent);
  bottom: -100px;
  right: -50px;
  animation-delay: -7s;
}

.bg-glow-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.1), transparent);
  top: 40%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  position: relative;
  z-index: 1;
}

/* ===== HEADER ===== */
.header {
  text-align: center;
  margin-bottom: 36px;
  animation: fadeInDown 0.6s ease;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.logo-icon svg {
  width: 28px;
  height: 28px;
  color: white;
}

.logo h1 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
  text-align: left;
}

/* ===== SEARCH ===== */
.search-section {
  animation: fadeInUp 0.6s ease 0.1s both;
}

.search-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.search-header {
  margin-bottom: 20px;
}

.search-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.search-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.search-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  position: relative;
}

.input-group input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font);
  transition: all 0.3s ease;
  outline: none;
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 20px var(--accent-glow);
}

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

.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.option-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.option-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.option-group select {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.3s;
}

.option-group select:focus {
  border-color: var(--accent);
}

.option-group select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--green), #059669);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--green-glow);
}

.btn-export:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--green-glow);
}

.btn-retry {
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-retry:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ===== PROGRESS ===== */
.progress-section {
  margin-top: 24px;
  animation: fadeInUp 0.4s ease;
}

.progress-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.progress-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#progressText {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 10px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px var(--accent-glow);
}

.progress-stats {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.activity-log {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  height: 180px;
  overflow-y: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-log .log-entry {
  animation: fadeInUp 0.3s ease;
  line-height: 1.4;
}

.activity-log .log-time {
  color: var(--accent-light);
  margin-right: 8px;
}

/* ===== RESULTS ===== */
.results-section {
  margin-top: 28px;
  animation: fadeInUp 0.5s ease;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.results-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.results-info h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.badge {
  padding: 5px 12px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--accent-light);
  font-weight: 500;
}

.table-wrapper {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead {
  background: rgba(255, 255, 255, 0.03);
}

th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: top;
}

tbody tr {
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: var(--bg-card-hover);
}

tbody tr:last-child td {
  border-bottom: none;
}

td.name-cell {
  font-weight: 600;
  color: var(--text-primary);
}

td.phone-cell {
  font-family: 'Inter', monospace;
  color: var(--accent-light);
  white-space: nowrap;
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
}

.rating-badge.high {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
}

.rating-badge.mid {
  background: rgba(245, 158, 11, 0.12);
  color: var(--yellow);
}

.rating-badge.low {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

.website-link {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.2s;
  word-break: break-all;
}

.website-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== ERROR ===== */
.error-section {
  margin-top: 24px;
  animation: fadeInUp 0.4s ease;
}

.error-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}

.error-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
}

.error-card p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .container {
    padding: 16px 12px 40px;
  }

  .logo h1 {
    font-size: 1.5rem;
  }

  .search-card {
    padding: 20px;
  }

  .options-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary {
    justify-content: center;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-wrapper {
    overflow-x: auto;
  }

  table {
    min-width: 700px;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}
