/* Enhanced Smart Tools CSS */

/* Smart Tools Header */
.smart-tools-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
  position: relative;
  overflow: hidden;
}

.smart-tools-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.tools-overview h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.tools-overview p {
  margin: 0;
  opacity: 0.9;
  font-size: 1.1rem;
}

.tools-stats {
  display: flex;
  gap: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.875rem;
  opacity: 0.8;
  margin-top: 0.25rem;
}

/* Smart Tools Grid */
.smart-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Smart Tool Cards */
.smart-tool-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.smart-tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-color: #3b82f6;
}

.smart-tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-bg, linear-gradient(90deg, #3b82f6, #8b5cf6));
}

.smart-tool-card[data-tool="client-brief"]::before {
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.smart-tool-card[data-tool="smart-outreach"]::before {
  background: linear-gradient(90deg, #10b981, #059669);
}

.smart-tool-card[data-tool="next-action"]::before {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.smart-tool-card[data-tool="quick-insights"]::before {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Tool Header */
.tool-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  flex-shrink: 0;
}

.gradient-bg-1 {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.gradient-bg-2 {
  background: linear-gradient(135deg, #10b981, #059669);
}

.gradient-bg-3 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.gradient-bg-4 {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.tool-info {
  flex: 1;
}

.tool-info h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
}

.tool-subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

.tool-status {
  flex-shrink: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.active {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Tool Description */
.tool-description {
  margin-bottom: 1.5rem;
}

.tool-description p {
  margin: 0 0 1rem 0;
  color: #475569;
  line-height: 1.6;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  display: flex;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.875rem;
  color: #64748b;
}

.feature-list li::before {
  content: attr(data-icon);
  margin-right: 0.5rem;
}

/* Tool Actions */
.tool-actions {
  border-top: 1px solid #e2e8f0;
  padding-top: 1.5rem;
}

.input-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.smart-select {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.smart-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Template Selector */
.template-selector {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.template-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.template-option:hover {
  border-color: #10b981;
  background: #f0fdf4;
}

.template-option.selected {
  border-color: #10b981;
  background: #dcfce7;
}

.template-icon {
  font-size: 1.5rem;
}

.template-option span:last-child {
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
}

/* Recommendations Preview */
.recommendations-preview {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #64748b;
  font-size: 0.875rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

/* Insights Dashboard */
.insights-dashboard {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.insight-metric {
  flex: 1;
  text-align: center;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.metric-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
}

.metric-label {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* AI Assistant Section */
.ai-assistant-section {
  margin-top: 2rem;
}

.assistant-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
}

.assistant-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #8b5cf6, #a855f7);
}

.assistant-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.assistant-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.assistant-info {
  flex: 1;
}

.assistant-info h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
}

.assistant-info p {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}

.assistant-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #10b981;
  font-weight: 500;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.status-indicator.active {
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Quick Actions */
.assistant-quick-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.quick-action-btn:hover {
  background: #f1f5f9;
  border-color: #8b5cf6;
  color: #8b5cf6;
}

.action-icon {
  font-size: 1rem;
}

/* Assistant Input */
.assistant-input {
  border-top: 1px solid #e2e8f0;
  padding-top: 1.5rem;
}

.chat-input-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.chat-input:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.chat-send-btn {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-send-btn:hover {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.send-icon {
  font-size: 1.25rem;
  font-weight: bold;
}

/* Modals */
.smart-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
}

.smart-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  z-index: 1001;
}

.client-brief-content {
  width: 800px;
}

.outreach-builder-content {
  width: 900px;
}

.insights-detail-content {
  width: 1000px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #e2e8f0;
  color: #374151;
}

.modal-body {
  padding: 2rem;
  max-height: 70vh;
  overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  .smart-tools-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .tools-stats {
    justify-content: center;
  }

  .smart-tools-grid {
    grid-template-columns: 1fr;
  }

  .assistant-quick-actions {
    flex-direction: column;
  }

  .insights-dashboard {
    flex-direction: column;
  }

  .modal-content {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .smart-tool-card,
  .assistant-card,
  .modal-content {
    background: #1e293b;
    border-color: #334155;
  }

  .tool-info h3,
  .assistant-info h3,
  .modal-header h2 {
    color: #f1f5f9;
  }

  .tool-subtitle,
  .tool-description p,
  .assistant-info p {
    color: #94a3b8;
  }

  .feature-list li {
    color: #94a3b8;
  }

  .smart-select,
  .chat-input {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
  }

  .insight-metric,
  .quick-action-btn {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
  }

  .modal-header {
    background: #334155;
    border-color: #475569;
  }

  .modal-close {
    color: #94a3b8;
  }

  .modal-close:hover {
    background: #475569;
    color: #f1f5f9;
  }
}

/* Animation utilities */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

.slide-up {
  animation: slideUp 0.3s ease-out;
}

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

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

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Success states */
.success-glow {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  border-color: #10b981;
}

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 100;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}