:root {
  --primary: #667eea;
  --primary-dark: #5568d3;
  --accent: #764ba2;
  --bg-dark: #0f1419;
  --bg-light: #1a1f2e;
  --bg-lighter: #252d3d;
  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --border-color: #2d3748;
  --success: #48bb78;
  --warning: #f6ad55;
  --error: #f56565;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-light) 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.sparky-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.sparky-header {
  text-align: center;
  padding: 40px 20px 30px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 16px;
  margin-bottom: 40px;
  border: 1px solid var(--border-color);
}

.header-content h1 {
  font-size: 3em;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-content p {
  font-size: 1.1em;
  color: var(--text-secondary);
}

/* Main */
.sparky-main {
  flex: 1;
}

/* Query Section */
.query-section {
  margin-bottom: 40px;
}

.query-box {
  background: var(--bg-lighter);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.query-input {
  width: 100%;
  padding: 16px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1em;
  font-family: inherit;
  resize: vertical;
  transition: all 0.3s ease;
}

.query-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-dark);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.query-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.query-controls {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  flex: 1;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-light);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9em;
}

.btn-icon {
  font-size: 1.2em;
}

.btn-text {
  flex: 1;
  text-align: center;
}

/* Result Section */
.result-section {
  margin-bottom: 40px;
  animation: slideIn 0.4s ease;
}

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

.result-card {
  background: var(--bg-lighter);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.result-icon {
  font-size: 1.8em;
}

.result-header h2 {
  font-size: 1.3em;
  margin: 0;
}

.result-content {
  margin-bottom: 16px;
}

.result-content p {
  font-size: 1.05em;
  line-height: 1.8;
  color: var(--text-primary);
}

.result-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.result-meta {
  font-size: 0.85em;
  color: var(--text-secondary);
}

/* Contact Results */
.contact-results {
  margin-bottom: 40px;
}

.contact-results h3 {
  margin-bottom: 16px;
  font-size: 1.2em;
}

.contact-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.contact-card {
  background: var(--bg-lighter);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.3s ease;
}

.contact-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.contact-name {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 8px;
}

.contact-info {
  font-size: 0.95em;
  color: var(--text-secondary);
  margin: 4px 0;
}

.contact-info strong {
  color: var(--text-primary);
}

.contact-status {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 600;
}

.contact-status.active {
  background: rgba(72, 187, 120, 0.2);
  color: var(--success);
}

.contact-status.hold {
  background: rgba(246, 173, 85, 0.2);
  color: var(--warning);
}

.contact-status.inactive {
  background: rgba(245, 101, 101, 0.2);
  color: var(--error);
}

/* Quick Links */
.quick-links {
  margin-bottom: 40px;
}

.quick-links h3 {
  margin-bottom: 16px;
  font-size: 1.1em;
}

.links-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.quick-link {
  padding: 16px;
  background: var(--bg-lighter);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1em;
  font-weight: 500;
}

.quick-link:hover {
  background: var(--bg-light);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Footer */
.sparky-footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9em;
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .sparky-container {
    padding: 15px;
  }

  .sparky-header {
    padding: 30px 15px 20px;
    margin-bottom: 30px;
  }

  .header-content h1 {
    font-size: 2em;
  }

  .header-content p {
    font-size: 1em;
  }

  .links-grid {
    grid-template-columns: 1fr;
  }

  .contact-list {
    grid-template-columns: 1fr;
  }
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 16px 24px;
  background: var(--bg-lighter);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: slideInUp 0.3s ease;
  max-width: 400px;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--error);
}

.toast.info {
  border-left: 4px solid var(--primary);
}

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