/* ============================================================================
   CRM MODULE - PREMIUM STYLES
   Isolated CSS following .module-isolated-crm-* pattern
   Design System: #667eea (primary), #764ba2 (secondary)
   ========================================================================= */

/* ============================================================================
   METRICS GRID
   ========================================================================= */

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

.stat-card-enhanced {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card-enhanced:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.stat-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: white;
  font-size: 1.5rem;
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.stat-trend.positive {
  color: #10b981;
}

.stat-trend.negative {
  color: #ef4444;
}

.stat-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* ============================================================================
   FUNNEL VISUALIZATION
   ========================================================================= */

.funnel-container {
  padding: 2rem;
}

.funnel-stage {
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.funnel-stage:hover {
  transform: translateX(8px);
}

.funnel-stage-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0 0.5rem;
}

.stage-name {
  font-weight: 600;
  color: var(--color-text);
}

.stage-count {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.funnel-bar-container {
  height: 48px;
  background: var(--color-background);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.funnel-bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 1rem;
  color: white;
  font-weight: 600;
  transition: width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.funnel-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 100%);
}

.funnel-bar-new {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.funnel-bar-contacted {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.funnel-bar-qualified {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.funnel-bar-trial_scheduled {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.funnel-bar-trial_attended {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.funnel-bar-negotiation {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.funnel-bar-converted {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.funnel-percentage {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   DASHBOARD GRID
   ========================================================================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* ============================================================================
   LEADS LIST - COMPACT
   ========================================================================= */

.leads-list-compact {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.lead-item-compact {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-background);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.lead-item-compact:hover {
  background: var(--color-surface);
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.lead-avatar {
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
}

.lead-info {
  flex: 1;
}

.lead-name {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.lead-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.lead-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.lead-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

/* ============================================================================
   HOT LEADS
   ========================================================================= */

.hot-leads-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.hot-lead-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.1) 0%, rgba(239, 68, 68, 0.1) 100%);
  border-radius: 12px;
  border-left: 4px solid #f59e0b;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hot-lead-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.hot-lead-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.125rem;
  animation: pulse 2s infinite;
}

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

.hot-lead-content {
  flex: 1;
}

.hot-lead-name {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.hot-lead-reason {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ============================================================================
   BADGES
   ========================================================================= */

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

.badge-new {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

.badge-contacted {
  background: rgba(79, 172, 254, 0.1);
  color: #4facfe;
}

.badge-qualified {
  background: rgba(67, 233, 123, 0.1);
  color: #43e97b;
}

.badge-trial {
  background: rgba(250, 112, 154, 0.1);
  color: #fa709a;
}

.badge-attended {
  background: rgba(48, 207, 208, 0.1);
  color: #30cfd0;
}

.badge-negotiation {
  background: rgba(240, 147, 251, 0.1);
  color: #f093fb;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.badge-lost {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.badge-hot {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: white;
  animation: pulse 2s infinite;
}

.badge-warm {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.badge-cold {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

/* ============================================================================
   DATA TABLE
   ========================================================================= */

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--color-background);
  border-bottom: 2px solid var(--color-border);
}

.data-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.data-table tbody tr {
  transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
  background: var(--color-background);
}

.clickable-row {
  cursor: pointer;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.user-name {
  font-weight: 600;
  color: var(--color-text);
}

.user-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.contact-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.contact-cell i {
  margin-right: 0.25rem;
  color: var(--primary-color);
}

.source-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.source-cell i {
  color: var(--primary-color);
}

.assigned-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-action {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--color-background);
  color: var(--color-text);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.btn-action.btn-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.btn-action.btn-success:hover {
  background: #10b981;
  color: white;
}

/* ============================================================================
   LEAD DETAILS PAGE
   ========================================================================= */

.lead-details-container {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
  margin-top: 2rem;
}

.lead-info-section,
.lead-notes-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.lead-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-item label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-item label i {
  color: var(--primary-color);
}

.info-item span,
.info-item a {
  font-size: 1rem;
  color: var(--color-text);
}

.info-item a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.lead-badges {
  display: flex;
  gap: 0.5rem;
}

/* ============================================================================
   TIMELINE
   ========================================================================= */

.timeline-container {
  padding: 1.5rem;
  max-height: 600px;
  overflow-y: auto;
}

.timeline-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: -1.5rem;
  width: 2px;
  background: var(--color-border);
}

.timeline-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
  padding-top: 0.5rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.timeline-header strong {
  color: var(--color-text);
}

.timeline-date {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.timeline-content p {
  color: var(--color-text-muted);
  margin: 0.5rem 0;
  line-height: 1.6;
}

.timeline-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

/* ============================================================================
   NOTES
   ========================================================================= */

.notes-container {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 600px;
  overflow-y: auto;
}

.note-item {
  padding: 1rem;
  background: var(--color-background);
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
  position: relative;
}

.note-item.note-pinned {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border-left-color: #f59e0b;
}

.note-pin {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  color: #f59e0b;
}

.note-content {
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.note-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.note-author {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ============================================================================
   KANBAN BOARD
   ========================================================================= */

.kanban-board {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 1rem 0;
  margin-top: 2rem;
}

.kanban-column {
  min-width: 300px;
  background: var(--color-background);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 250px);
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-border);
}

.column-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.column-title i {
  color: var(--primary-color);
}

.column-count {
  background: var(--gradient-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

.kanban-column-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem;
}

.kanban-column-content.drag-over {
  background: rgba(102, 126, 234, 0.05);
  border-radius: 8px;
}

.kanban-card {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 1rem;
  cursor: move;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.kanban-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.kanban-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.kanban-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.kanban-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.card-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-meta i {
  color: var(--primary-color);
}

.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

/* ============================================================================
   ANALYTICS
   ========================================================================= */

.analytics-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.roi-table {
  padding: 1.5rem;
}

.roi-badge {
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.125rem;
}

.roi-excellent {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.roi-good {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.roi-fair {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.funnel-chart {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.funnel-stage-detailed {
  padding: 1.5rem;
  background: var(--color-background);
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
}

.stage-info h3 {
  margin: 0 0 1rem 0;
  color: var(--color-text);
}

.stage-metrics {
  display: flex;
  gap: 2rem;
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
}

.metric-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.metric-dropoff .metric-value {
  color: #ef4444;
}

/* ============================================================================
   EMPTY STATE
   ========================================================================= */

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--color-text-muted);
}

.empty-state i {
  color: var(--color-border);
  margin-bottom: 1rem;
}

.empty-state h3 {
  color: var(--color-text);
  margin: 1rem 0 0.5rem 0;
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* ============================================================================
   LOADING STATE
   ========================================================================= */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
  color: var(--color-text-muted);
}

.loading-state i {
  font-size: 2rem;
  color: var(--primary-color);
}

/* ============================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .lead-details-container {
    grid-template-columns: 1fr;
  }

  .lead-notes-section {
    order: -1;
  }

  .kanban-board {
    padding-bottom: 2rem;
  }
}

/* ============================================================================
   SETTINGS SCREEN - GOOGLE ADS CONFIGURATION
   ========================================================================= */

.settings-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.settings-section {
  padding: 2rem;
}

.settings-group {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.settings-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-group h3 {
  color: var(--primary-color);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-description {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.settings-description a {
  color: var(--primary-color);
  text-decoration: none;
}

.settings-description a:hover {
  text-decoration: underline;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 600px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 0.9rem;
}

.form-group input {
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
}

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

.form-group small {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
}

#oauth-section {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}

.status-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
}

.success-message {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #16a34a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 8px;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 8px;
}

.info-box {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.info-box.success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #16a34a;
}

.info-box.warning {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
  color: #f59e0b;
}

.info-box i {
  font-size: 1.5rem;
  margin-top: 0.25rem;
}

.info-box strong {
  display: block;
  margin-bottom: 0.25rem;
}

.info-box p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.info-box code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

.campaigns-container {
  margin-top: 1.5rem;
}

.campaigns-container .data-table {
  width: 100%;
  border-collapse: collapse;
}

.campaigns-container .data-table th {
  background: var(--color-surface-secondary);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--color-border);
}

.campaigns-container .data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.campaigns-container .empty-state {
  text-align: center;
  color: var(--color-text-secondary);
  padding: 2rem;
  font-style: italic;
}

.conversion-stats {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.conversion-stats h4 {
  margin-bottom: 1rem;
  color: var(--color-text-primary);
}

.automation-info {
  margin-top: 1.5rem;
}

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

#google-ads-status-badge .badge {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* ============================================================================
   CSV IMPORT SECTION
   ========================================================================= */

.csv-dropzone {
  border: 3px dashed var(--color-border);
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
  background: var(--color-surface-secondary);
  transition: all 0.3s ease;
  cursor: pointer;
  margin: 1.5rem 0;
}

.csv-dropzone:hover {
  border-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.05);
}

.csv-dropzone.dragover {
  border-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.1);
  transform: scale(1.02);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.dropzone-content i {
  font-size: 4rem;
  color: var(--primary-color);
  opacity: 0.6;
}

.dropzone-content h4 {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 1.25rem;
}

.dropzone-content p {
  margin: 0;
  color: var(--color-text-secondary);
}

.csv-files-list {
  margin: 1.5rem 0;
}

.csv-files-list h4 {
  margin-bottom: 1rem;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.csv-files-grid {
  display: grid;
  gap: 1rem;
}

.csv-file-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-surface);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.csv-file-item:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.csv-file-item .file-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
  font-size: 1.5rem;
}

.csv-file-item .file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.csv-file-item .file-info strong {
  color: var(--color-text-primary);
  font-size: 0.95rem;
  word-break: break-word;
}

.csv-file-item .file-info small {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.btn-icon-danger {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #ef4444;
  border-radius: 8px;
  color: #ef4444;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon-danger:hover {
  background: #ef4444;
  color: white;
  transform: scale(1.1);
}

.upload-progress {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--color-surface);
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.progress-header span {
  font-weight: 600;
  color: var(--color-text-primary);
}

.progress-bar-container {
  width: 100%;
  height: 12px;
  background: var(--color-surface-secondary);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s ease;
  border-radius: 6px;
}

.import-summary {
  margin: 1.5rem 0;
}

.success-message {
  padding: 2rem;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
  border-radius: 16px;
  border: 2px solid #22c55e;
}

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

.success-header i {
  font-size: 3rem;
  color: #22c55e;
}

.success-header h3 {
  margin: 0;
  color: #22c55e;
  font-size: 1.5rem;
}

.import-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.import-stats .stat-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.import-stats .stat-item i {
  font-size: 2rem;
  color: var(--primary-color);
  opacity: 0.8;
}

.import-stats .stat-item div {
  display: flex;
  flex-direction: column;
}

.import-stats .stat-item strong {
  font-size: 1.5rem;
  color: var(--color-text-primary);
}

.import-stats .stat-item span {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.summary-text {
  margin: 1rem 0;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  color: var(--color-text-primary);
  text-align: center;
}

.error-message {
  padding: 2rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
  border-radius: 16px;
  border: 2px solid #ef4444;
  text-align: center;
}

.error-message i {
  font-size: 3rem;
  color: #ef4444;
  margin-bottom: 1rem;
}

.error-message h3 {
  margin: 0 0 1rem 0;
  color: #ef4444;
}

.error-message p {
  color: var(--color-text-primary);
  margin-bottom: 1.5rem;
}

/* ============================================================================
   END CSV IMPORT
   ========================================================================= */

/* ============================================================================
   STATUS MESSAGES & ALERTS
   ========================================================================= */

#connection-status {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.alert {
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  animation: slideDown 0.3s ease;
}

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

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.alert-success i {
  color: #10b981;
  font-size: 1.2rem;
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
  border-left: 4px solid #f59e0b;
}

.alert-warning i {
  color: #f59e0b;
  font-size: 1.2rem;
}

.alert-secondary {
  background-color: #f3f4f6;
  color: #374151;
  border-left: 4px solid #9ca3af;
}

.alert-secondary i {
  color: #9ca3af;
  font-size: 1.2rem;
}

/* ============================================================================
   BUTTON STATES
   ========================================================================= */

#btn-connect-google-ads {
  min-width: 200px;
  transition: all 0.3s ease;
}

#btn-connect-google-ads:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

#btn-connect-google-ads:disabled:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
  .alert {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .stat-card-enhanced {
    flex-direction: column;
    text-align: center;
  }

  .lead-item-compact {
    flex-direction: column;
    align-items: flex-start;
  }

  .lead-status {
    flex-direction: row;
    align-items: center;
    width: 100%;
  }

  .settings-form {
    max-width: 100%;
  }

  .action-buttons,
  #oauth-section {
    flex-direction: column;
  }

  .action-buttons button,
  #oauth-section button {
    width: 100%;
  }
}

/* ============================================================================
   TEST PROGRESS (Connection Test)
   ========================================================================= */

.test-progress-container {
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.test-progress-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 1rem;
}

.test-progress-header i {
  color: #667eea;
  font-size: 1.25rem;
}

.test-progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  max-height: 300px;
  overflow-y: auto;
}

.test-progress-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  animation: slideInRight 0.3s ease;
}

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

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

.test-progress-item i {
  font-size: 1.125rem;
  min-width: 20px;
}

.test-progress-item span {
  flex: 1;
  color: #475569;
  font-weight: 500;
}

.test-progress-item small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 400;
}

.test-progress-item.test-testing {
  background: #eff6ff;
  border-left: 3px solid #667eea;
}

.test-progress-item.test-success {
  background: #f0fdf4;
  border-left: 3px solid #10b981;
}

.test-progress-item.test-error {
  background: #fef2f2;
  border-left: 3px solid #ef4444;
}

.test-progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.test-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.4s ease;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.test-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.success-message,
.error-message {
  padding: 1.25rem;
  border-radius: 8px;
  text-align: center;
  font-size: 0.9375rem;
}

.success-message {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
  color: #166534;
}

.success-message i {
  font-size: 2rem;
  color: #10b981;
  display: block;
  margin-bottom: 0.75rem;
}

.success-message strong {
  display: block;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.success-message small {
  color: #15803d;
  font-size: 0.875rem;
}

.error-message {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.error-message i {
  font-size: 2rem;
  color: #ef4444;
  display: block;
  margin-bottom: 0.75rem;
}

.error-message strong {
  display: block;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.error-message small {
  color: #b91c1c;
  font-size: 0.875rem;
}

