/**
 * Shared CSS for SPA Components
 * Ensures consistent styling across all pages
 */

/* Additional component-specific styles to ensure consistency */

/* Quick Actions Layout */
.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.quick-actions .btn {
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.activity-item i {
    color: var(--primary-color);
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

/* Header Section Consistency */
.header-section {
    margin-bottom: 2rem;
}

.header-section .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.header-section .breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.header-section .breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
}

.header-section .breadcrumb a:hover {
    color: var(--primary-color);
}

/* Ensure consistent text styling */
.text-muted {
    color: var(--text-muted) !important;
}

/* Badge consistency */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    color: #fff;
    background-color: #6c757d;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
  }

  /* Bulk Actions Styles */
  .bulk-actions {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .bulk-actions-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .bulk-actions span {
    font-weight: 500;
    color: #495057;
  }

  /* Table checkbox styles */
  .entry-checkbox,
  .select-all-checkbox {
    margin-right: 0.5rem;
    transform: scale(1.1);
  }

  .select-all-checkbox + label {
    font-weight: 500;
    margin-left: 0.25rem;
    cursor: pointer;
  }

  /* Delete button styles */
  .delete-entry-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
  }

  .delete-entry-btn:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    transform: translateY(-1px);
  }

  /* Table action column */
  table th:first-child,
  table td:first-child {
    width: 60px;
    text-align: center;
  }

  table th:last-child,
  table td:last-child {
    width: 80px;
    text-align: center;
  }

  /* Model Selection Dropdown Styles */
  .model-selection-container {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .model-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
  }

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

  .model-dropdown {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: white;
    font-size: 0.875rem;
    color: var(--text-primary);
    min-width: 200px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .model-dropdown:hover {
    border-color: var(--primary-color);
  }

  .model-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
  }

  .model-dropdown option {
    padding: 0.5rem;
  }

  /* Minimalistic Parameter Definitions */
  .parameter-definitions-minimal {
    margin-top: 1rem;
    font-size: 0.875rem;
  }

  .parameter-definitions-minimal details {
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.5rem;
    background: #f8f9fa;
  }

  .parameter-definitions-minimal summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.25rem;
  }

  .parameter-definitions-minimal summary:hover {
    color: var(--primary-color);
  }

  .definitions-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
  }

  .definitions-compact span {
    font-size: 0.8rem;
    color: var(--text-secondary);
  }

  /* Sortable Table Styles */
  .sortable-table .sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
  }

  .sortable-table .sortable:hover {
    background-color: #f8f9fa;
  }

  .sort-icon {
    margin-left: 0.25rem;
    color: #9ca3af;
    font-size: 0.7rem;
    transition: all 0.2s ease;
    opacity: 0.7;
    vertical-align: top;
    position: relative;
    top: -0.1rem;
  }

  .sortable:hover .sort-icon {
    color: #6b7280;
    opacity: 1;
  }

  .sortable .fas.fa-sort-up,
  .sortable .fas.fa-sort-down {
    color: #3b82f6;
    opacity: 1;
  }

  /* Scoring Table Specific Sortable Styles */
  .scoring-table .sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
  }

  .scoring-table .sortable:hover {
    background-color: #f1f5f9;
  }

  .scoring-table .sortable:active {
    background-color: #e2e8f0;
  }

  /* Card 4: Visual Progress Tracker */

.card4-progress-tracker {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0;
    margin: 15px 0;
    border: 1px solid #dee2e6;
    overflow: hidden;
    position: relative;
}

.progress-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.progress-controls .stop-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.progress-controls .stop-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.progress-content {
    padding: 20px;
}

.current-stage {
    text-align: center;
    margin-bottom: 20px;
}

.stage-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.stage-icon {
    font-size: 24px;
}

.stage-icon.spinning {
    animation: spin 2s linear infinite;
}

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

.stage-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.progress-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.progress-bar-container {
    margin-bottom: 20px;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    position: relative;
}

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

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    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%); }
}

.current-action {
    text-align: center;
    margin-bottom: 20px;
    font-style: italic;
    color: #666;
}

.stage-timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-top: 20px;
}

.stage-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    background: white;
    padding: 0 10px;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e9ecef;
    border: 2px solid #e9ecef;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.timeline-item.active .timeline-dot {
    background: #667eea;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.timeline-item.completed .timeline-dot {
    background: #28a745;
    border-color: #28a745;
}

.timeline-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-align: center;
}

.timeline-item.active .timeline-label {
    color: #667eea;
    font-weight: 600;
}

.timeline-item.completed .timeline-label {
    color: #28a745;
}

/* Card 4 Logs Container - Same as datalake */
#card4-logs-container {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px 20px;
    background: white;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    overscroll-behavior: contain;
    transform: translateZ(0);
    will-change: scroll-position;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

/* Analysis Status Header */
.analysis-status-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
}

.analysis-status-header .status-info h5 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    opacity: 0.9;
}

.stat-item i {
    font-size: 0.8rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    display: inline-block;
    margin-right: 5px;
}

.pulse-dot.active {
    background: #007bff;
    animation: pulse 2s infinite;
}

.pulse-dot.success {
    background: #28a745;
}

.pulse-dot.warning {
    background: #ffc107;
}

.pulse-dot.error {
    background: #dc3545;
    animation: pulse 1s infinite;
}

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

/* Real-time Logs Container */
.realtime-logs-container {
    background: white;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.logs-header h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logs-actions {
    display: flex;
    gap: 8px;
}

.logs-actions .btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* Logs Content */
.logs-content {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px 20px;
    background: white;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    /* Ensure scroll isolation */
    overscroll-behavior: contain;
    /* Prevent animations from interfering */
    transform: translateZ(0);
    will-change: scroll-position;
    /* Better touch scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    /* Force proper scroll container */
    position: relative;
    z-index: 1;
    /* Ensure container boundaries */
    box-sizing: border-box;
}

.logs-content .log-entry {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.8rem;
    line-height: 1.4;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.3s ease;
}

.logs-content .log-entry:last-child {
    border-bottom: none;
}

.logs-content .log-entry:hover {
    background-color: #f8f9fa;
    margin: 0 -10px;
    padding-left: 10px;
    padding-right: 10px;
}

.log-time {
    color: #6c757d;
    font-weight: 500;
    min-width: 75px;
    font-size: 0.75rem;
    font-family: monospace;
}

.log-icon {
    min-width: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.log-icon i {
    font-size: 0.8rem;
}

.log-entry.log-info .log-icon {
    color: #17a2b8;
}

.log-entry.log-success .log-icon {
    color: #28a745;
}

.log-entry.log-warning .log-icon {
    color: #ffc107;
}

.log-entry.log-error .log-icon {
    color: #dc3545;
}

.log-entry.log-progress .log-icon {
    color: #007bff;
}

.log-message {
    flex: 1;
    color: #333;
    word-wrap: break-word;
}

/* Scrollbar styling for logs */
.logs-content::-webkit-scrollbar {
    width: 6px;
}

.logs-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.logs-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.logs-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .analysis-stats {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .logs-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .logs-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

  /* Tab 3 - Rewards Scoring Styles */
  .rewards-scoring-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .scoring-config-card .config-description {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.5rem;
  }

  .config-form {
    padding: 1.25rem;
  }

  .config-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1rem;
  }

  .config-form .form-row-three {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
  }
  
  .config-form .form-row-four {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .config-form .form-group {
    position: relative;
  }

  .config-form .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
  }

  .config-form .form-group label i {
    color: var(--primary-color);
    font-size: 1rem;
  }

  .config-form .form-control {
    padding: 0.75rem 0.875rem;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
  }

  .config-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
  }

  .config-form .form-control:hover {
    border-color: #cbd5e1;
  }

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

  .location-input-group input {
    flex: 1;
  }

  .location-input-group .btn {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
  }

  .location-input-group .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .form-text {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
  }

  .custom-date-range {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
  }

  .custom-date-range .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 0;
  }

  .config-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2.5rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
  }

  .config-actions-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    padding: 1rem;
  }

  .config-actions .btn {
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    min-width: 140px;
  }

  .config-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  }

  .config-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4f46e5 100%);
    border: none;
  }

  .config-actions .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border: none;
  }

  .scoring-results-card {
    margin-top: 2rem;
  }

  .results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .results-header h4 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-primary);
  }

  .results-header h4 i {
    color: var(--primary-color);
    margin-right: 0.5rem;
  }

  .results-summary {
    margin: 0;
  }

  .summary-stats-mini {
    display: flex;
    gap: 0.75rem;
    align-items: center;
  }

  .summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
  }

  .summary-badge i {
    font-size: 0.75rem;
  }

  .status-badge {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #ffeaa7;
    color: #856404;
  }

  .status-badge.completed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #c3e6cb;
    color: #155724;
  }

  .status-badge.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #f5c6cb;
    color: #721c24;
  }

  .scoring-table-container {
    overflow-x: hidden;
    margin: 1.5rem 0;
  }

  .scoring-table {
    width: 100%;
    table-layout: fixed;
    font-size: 0.8rem;
  }

  .scoring-table th,
  .scoring-table td {
    padding: 0.375rem 0.25rem;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
  }

  .scoring-table th {
    background-color: #f8f9fa;
    font-weight: 500;
    font-size: 0.55rem;
    color: #374151;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.1;
    padding: 0.5rem 0.375rem;
    text-transform: none !important;
    font-variant: normal !important;
    border-bottom: 2px solid #e5e7eb;
    position: relative;
    text-align: center;
    vertical-align: middle;
    min-height: 3rem;
  }

  .reward-name-header,
  .reward-name-cell {
    text-align: left;
    width: 15%;
  }

  .score-header,
  .score-cell {
    text-align: center;
    width: 8%;
  }

  .level-header,
  .recommendation-cell {
    text-align: center;
    width: 12%;
  }

  .reward-name-cell {
    font-weight: 500;
  }

  .reward-name-cell strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
  }

  .score-value {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-color);
    line-height: 1.2;
  }

  .score-source {
    display: block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
    line-height: 1;
  }

  .loading-indicator {
    color: var(--text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .loading-indicator i {
    margin-right: 0.25rem;
  }

  .error-indicator {
    color: #dc3545;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .error-indicator i {
    margin-right: 0.25rem;
  }

/* Batch Processing Progress Styles */
.batch-progress-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.progress-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

  .progress-controls .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 4px;
    font-weight: 500;
  }

  /* Progress Status Log Styles */
  .progress-status-container {
    background: #f8f9fa;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    margin: 20px 0;
  }

  .progress-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e6ed;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 8px 8px 0 0;
  }

  .progress-status-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
  }

  .toggle-log-btn, .toggle-campaigns-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
  }

  .toggle-log-btn:hover, .toggle-campaigns-btn:hover {
    background: rgba(255, 255, 255, 0.3);
  }

  .progress-status-log {
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
  }

  .progress-log-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
  }

  .progress-log-entry:last-child {
    border-bottom: none;
  }

  .log-time {
    color: #6c757d;
    font-size: 0.75rem;
    min-width: 60px;
  }

  .log-icon {
    min-width: 16px;
  }

  .progress-log-entry.info .log-icon { color: #007bff; }
  .progress-log-entry.success .log-icon { color: #28a745; }
  .progress-log-entry.warning .log-icon { color: #ffc107; }
  .progress-log-entry.error .log-icon { color: #dc3545; }
  .progress-log-entry.processing .log-icon { color: #6f42c1; }

  .log-message {
    flex: 1;
    color: #2c3e50;
  }

  /* Past Campaigns Styles */
  .past-campaigns-container {
    background: #f8f9fa;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    margin: 20px 0;
  }

  .past-campaigns-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e6ed;
    background: linear-gradient(135deg, #fc7b7b, #ff9472);
    color: white;
    border-radius: 8px 8px 0 0;
  }

  .past-campaigns-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
  }

  .past-campaigns-content {
    padding: 16px;
  }

  .campaigns-summary {
    margin-bottom: 20px;
  }

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

  .summary-header h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
  }

  .summary-stats {
    display: flex;
    gap: 15px;
  }

  .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #6c757d;
  }

  .campaigns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
  }

  .campaign-card {
    background: white;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
  }

  .campaign-name {
    margin: 0;
    color: #2c3e50;
    font-size: 0.9rem;
    font-weight: 600;
    flex: 1;
  }

  .campaign-timeframe {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 8px;
  }

  .campaign-description {
    color: #6c757d;
    font-size: 0.8rem;
    margin-bottom: 12px;
    line-height: 1.4;
  }

  .campaign-rewards {
    margin-bottom: 12px;
  }

  .rewards-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 6px;
    font-weight: 500;
  }

  .rewards-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .reward-tag {
    background: #f0f8ff;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid #e3f2fd;
  }

  .campaign-source {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: #6c757d;
    font-style: italic;
  }

.progress-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.progress-header h4 {
    margin: 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.overall-progress {
    background: linear-gradient(45deg, #007bff, #6610f2);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.category-progress {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.category-item.active {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.15);
    transform: translateX(5px);
}

.category-item.completed {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.category-item.failed {
    border-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.category-name {
    min-width: 80px;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #6610f2 100%);
    transition: width 0.5s ease;
    border-radius: 4px;
}

.category-item.completed .progress-fill {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.category-item.failed .progress-fill {
    background: linear-gradient(90deg, #dc3545 0%, #fd7e14 100%);
}

.batch-status {
    min-width: 100px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6c757d;
}

.category-item.active .batch-status {
    color: #007bff;
}

.category-item.completed .batch-status {
    color: #28a745;
}

.category-item.failed .batch-status {
    color: #dc3545;
}

/* Responsive progress tracking */
@media (max-width: 768px) {
    .progress-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .category-item {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .category-name {
        min-width: auto;
    }
    
    .progress-bar {
        width: 100%;
    }
    
    .batch-status {
        min-width: auto;
        text-align: center;
    }
}

  .recommendation-cell {
    min-width: 150px;
    text-align: center;
  }

  .recommendation-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .recommendation-badge.highly-recommended {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
  }

  .recommendation-badge.recommended {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
  }

  .recommendation-badge.consider {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
  }

  .recommendation-badge.low-priority {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
  }

  .scoring-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
  }

  /* Responsive Design for Tab 3 */
  @media (max-width: 768px) {
    .config-form .form-row {
      grid-template-columns: 1fr;
      gap: 1rem;
    }

    .config-form .form-row-three {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
    
    .config-form .form-row-four {
      grid-template-columns: 1fr;
      gap: 1rem;
    }

    .config-actions {
      flex-direction: column;
      gap: 1rem;
    }

    .summary-stats {
      flex-direction: column;
      gap: 1rem;
    }

    .scoring-actions {
      flex-direction: column;
    }

    .summary-stats-mini {
      flex-direction: column;
      gap: 0.5rem;
    }

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

    .scoring-table {
      font-size: 0.75rem;
    }

    .scoring-table th,
    .scoring-table td {
      padding: 0.375rem 0.25rem;
    }

    .scoring-table th {
      font-size: 0.7rem;
      white-space: normal;
      word-wrap: break-word;
    }

    .reward-name-cell strong {
      max-width: 120px;
    }
  }

  /* AI Recommendation Workflow Styles */
  .workflow-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .workflow-step {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
  }

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

  .step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9rem;
  }

  .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
  }

  .btn-large {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
  }

  .recommendations-header {
    margin-bottom: 1.5rem;
    text-align: center;
  }

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

  .recommendation-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }

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

  .recommendation-rank {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
  }

  .recommendation-confidence {
    text-align: right;
  }

  .confidence-score {
    font-weight: 700;
    color: var(--success-color);
    font-size: 1.1rem;
  }

  .recommendation-name {
    margin: 0.5rem 0;
    color: var(--text-dark);
    font-size: 1.2rem;
  }

  .badge-industry {
    background: var(--info-color);
    color: white;
    margin-bottom: 0.75rem;
  }

  .recommendation-reason {
    color: #6c757d;
    margin-bottom: 1.5rem;
    line-height: 1.4;
  }

  .recommendation-actions {
    display: flex;
    gap: 0.75rem;
  }

  .recommendations-summary {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }

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

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

  .summary-stat strong {
    display: block;
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: 700;
  }

  .summary-stat span {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .summary-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
  }

  @media (max-width: 768px) {
    .form-grid {
      grid-template-columns: 1fr;
    }
    
    .recommendations-grid {
      grid-template-columns: 1fr;
    }
    
    .summary-actions {
      flex-direction: column;
    }
  }

  /* Tab Navigation Styles */
  .tab-navigation {
    display: flex;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 2rem;
    gap: 0.5rem;
  }

  .tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: all 0.2s ease;
    position: relative;
  }

  .tab-btn:hover:not(:disabled) {
    background: #f1f5f9;
    color: var(--primary-color);
  }

  .tab-btn.active {
    background: var(--primary-color);
    color: white;
  }

  .tab-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .tab-content {
    min-height: 400px;
  }

  .tab-pane {
    display: none;
  }

  .tab-pane.active {
    display: block;
  }

  /* Form Styles */
  .tab-form {
    max-width: 800px;
  }

  .form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
  }

  .section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 600;
  }

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

  .form-input,
  .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
  }

  .form-input:focus,
  .form-textarea:focus,
  .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  }

  .form-input.error,
  .form-textarea.error,
  .form-select.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  }

  .form-textarea {
    resize: vertical;
    min-height: 100px;
  }

  .checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
  }

  .checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .checkbox-item:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
  }

  .checkbox-item input[type="checkbox"] {
    margin: 0;
    transform: scale(1.1);
  }

  .checkbox-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    flex: 1;
  }

  .checkbox-item input[type="checkbox"]:checked + label {
    color: var(--primary-color);
  }

  .form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
  }

  .field-error {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .field-error::before {
    content: "⚠";
    font-size: 0.9rem;
  }

  .coming-soon {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
  }

  .coming-soon i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
  }

  .coming-soon h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
  }

  @media (max-width: 768px) {
    .tab-navigation {
      flex-direction: column;
    }
    
    .form-actions {
      flex-direction: column;
      align-items: stretch;
    }
    
    .checkbox-group {
      grid-template-columns: 1fr;
    }
  }

  /* Tab 2: Reward Mapping Styles */
  .reward-mapping-container {
    max-width: 1200px;
    margin: 0 auto;
  }

  .process-header {
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
  }

  .controls-header {
    text-align: center;
  }

  .controls-header h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
  }

  .controls-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
  }

  /* Campaign Overview Section */
  .campaign-overview-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
  }

  .campaign-overview-section h4 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.5rem 0;
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 600;
  }

  .campaign-overview-section h4 i {
    color: var(--primary-color);
  }

  .campaign-bullets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
  }

  .bullet-point {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
  }

  .bullet-point:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
  }

  .bullet-point.full-width {
    grid-column: 1 / -1;
  }

  .bullet-point i {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-top: 0.1rem;
    min-width: 1rem;
  }

  .bullet-point span {
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .bullet-point strong {
    color: var(--primary-color);
    font-weight: 600;
  }

  /* Mapping Cards */
  .mapping-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .mapping-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
  }

  .mapping-card.locked-card {
    opacity: 0.6;
    background: #f8fafc;
  }

  .mapping-card.active-card {
    opacity: 1;
    border-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.1);
  }

  .mapping-card.processing {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    /* Removed pulse animation to fix scrolling issues */
    /* contain: layout style paint; - no longer needed */
  }

  .mapping-card.completed {
    border-color: var(--success-color);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.02);
  }

  .mapping-card.error {
    border-color: var(--error-color);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
  }

  .mapping-card.ready {
    border-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.1);
  }

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

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

  .card-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
  }

  .card-title-section h5 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
  }

  .card-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: bold;
  }

  .card-controls {
    display: flex;
    gap: 0.25rem;
  }

  .card-controls .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-width: auto;
  }

  .card-start-btn {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
  }

  .card-pause-btn {
    background: #f59e0b;
    border-color: #f59e0b;
    color: white;
  }

  .card-stop-btn {
    background: var(--error-color);
    border-color: var(--error-color);
    color: white;
  }

  .card-status {
    display: flex;
    align-items: center;
  }

  .status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .status-ready {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
  }

  .status-locked {
    background: #f1f5f9;
    color: #64748b;
  }

  .status-pending {
    background: #f1f5f9;
    color: #64748b;
  }

  .status-processing {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    animation: blink 1.5s infinite;
  }

  .status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
  }

  .status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
  }

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

  @keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
  }

  .mapping-card .card-content {
    padding: 1.5rem;
  }

  .card-description {
    color: #64748b;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
  }

  /* Campaign Summary */
  .campaign-summary {
    margin-bottom: 1.5rem;
  }

  .campaign-summary h6 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-weight: 600;
  }

  .summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
  }

  .summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .summary-item.full-width {
    grid-column: 1 / -1;
  }

  .summary-item strong {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .summary-item span {
    color: var(--text-dark);
    font-size: 0.95rem;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
  }

  /* Processing Animation */
  .processing-state {
    text-align: center;
    padding: 2rem;
  }

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

  .spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid #e2e8f0;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }

  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  .processing-animation p {
    margin: 0;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 1rem;
  }

  /* Results */
  .analysis-results {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
  }

  .analysis-results h6 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--success-color);
    font-weight: 600;
  }

  .result-section {
    margin-bottom: 1.5rem;
  }

  .result-section h6 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
  }

  .badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .badge-industry {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
  }

  .badge-type {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
  }

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

  .badge-city {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
  }

  .reasoning-text {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
    margin: 0;
  }

  .unlock-notice {
    text-align: center;
    padding: 1rem;
    margin-top: 1rem;
    background: rgba(99, 102, 241, 0.05);
    border: 1px dashed rgba(99, 102, 241, 0.2);
    border-radius: 0.5rem;
    color: #6b7280;
    font-style: italic;
  }

  .unlock-notice i {
    margin-right: 0.5rem;
    color: var(--primary-color);
  }

  .coming-soon-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    color: #64748b;
    font-style: italic;
  }

  /* Mapped Rewards Section - For Cards 1, 2, and 3 */
  #card-1 .card-content,
  #card-2 .card-content,
  #card-3 .card-content {
    display: flex;
    gap: 1.5rem;
  }

  .card-main-content {
    flex: 2;
  }

  .mapped-rewards-section {
    flex: 1;
    min-width: 250px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-left: 1rem;
  }

  .mapped-rewards-section h6 {
    margin: 0 0 1rem 0;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .mapped-rewards-section h6 i {
    color: var(--primary-color);
  }

  .mapped-rewards-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .reward-count-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
  }

  .reward-count-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
  }

  .reward-count-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
  }

  .reward-count-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    min-width: 2rem;
    text-align: center;
  }

  .total-count {
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
    border-radius: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
  }

  .total-count strong {
    font-weight: 600;
  }

  /* Funnel Indicator */
  .funnel-indicator {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-radius: 0.5rem;
    text-align: center;
  }

  .funnel-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .funnel-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
  }

  .funnel-from {
    color: #6b7280;
    font-size: 0.9rem;
  }

  .funnel-step i {
    color: var(--primary-color);
    font-size: 0.8rem;
  }

  .funnel-to {
    color: var(--primary-color);
    font-size: 1rem;
  }

  .funnel-reduction {
    font-size: 0.8rem;
    color: #059669;
    font-weight: 500;
  }

  /* Responsive design for mapped rewards */
  @media (max-width: 1024px) {
    #card-1 .card-content {
      flex-direction: column;
    }
    
    .mapped-rewards-section {
      margin-left: 0;
      margin-top: 1rem;
    }
  }

  /* Navigation Actions */
  .tab-navigation-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
  }

  @media (max-width: 768px) {
    .controls-buttons {
      flex-direction: column;
      align-items: center;
    }
    
    .controls-buttons .btn {
      width: 100%;
      max-width: 200px;
    }
    
    .tab-navigation-actions {
      flex-direction: column;
      align-items: stretch;
    }
    
    .summary-grid {
      grid-template-columns: 1fr;
    }
    
    .card-title-section h5 {
      font-size: 1rem;
    }
    
    .mapping-card .card-header,
    .mapping-card .card-content {
      padding: 1rem;
    }
    
    .campaign-bullets {
      grid-template-columns: 1fr;
    }
    
    .campaign-overview-section {
      padding: 1rem;
    }
}

.badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

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

/* Component spacing consistency */
.dashboard-content > *:first-child {
    margin-top: 0;
}

.dashboard-content > *:last-child {
    margin-bottom: 0;
}

/* Mobile adjustments for consistency */
@media (max-width: 768px) {
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-actions .btn {
        width: 100%;
        min-width: auto;
    }
    
    .header-section .page-title {
        font-size: 1.25rem;
    }
}

/* === Data Scraping Interface Styles === */

/* Scraper Controls */
.scraper-controls {
    padding: 0;
}

.scraper-config {
    margin: 1.5rem 0;
}

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

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-indicator i {
    font-size: 0.75rem;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Progress Stats */
.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-size: 0.25rem;
    font-weight: 100;
    color: #111827;
}

/* Logs Container */
.logs-container {
    max-height: 300px;
    overflow-y: auto;
    background: #1f2937;
    border-radius: 6px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.log-entry {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.log-time {
    color: #9ca3af;
    flex-shrink: 0;
    font-weight: 500;
}

.log-message {
    color: #e5e7eb;
}

.log-entry.log-success .log-message {
    color: #10b981;
}

.log-entry.log-warning .log-message {
    color: #f59e0b;
}

.log-entry.log-error .log-message {
    color: #ef4444;
}

.log-entry.log-info .log-message {
    color: #3b82f6;
}

/* Data Table */
.data-table-container {
    min-height: 200px;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.empty-state p {
    margin: 0;
    font-size: 0.875rem;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
}

.data-table tr:hover {
    background: #f9fafb;
}

/* Card Actions */
.card-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* === Save to Collection Modal Styles === */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

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

.modal-body {
    padding: 1.5rem;
}

.collection-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.collection-info p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.collection-info code {
    background: #1e40af;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.save-options h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.option-card {
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-card:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.option-card:has(input:checked) {
    border-color: #10b981;
    background: #ecfdf5;
}

.option-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.option-header input[type="radio"] {
    margin: 0;
}

.option-header label {
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.option-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-left: 1.5rem;
    line-height: 1.4;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 0 0 8px 8px;
}

.modal-footer .btn {
    min-width: 100px;
}

/* === Compact Control Panel Styles === */

.modern-header.compact {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-icon-inline {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.header-title h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
}

.status-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.status-compact .pulse-dot {
    width: 8px;
    height: 8px;
}

.status-compact .status-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1a202c;
}

/* Compact Controls */
.modern-controls {
    padding: 1.5rem;
    background: white;
}

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

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

.control-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group label i {
    color: #667eea;
    width: 14px;
}

.compact-select, .compact-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
}

.compact-select:focus, .compact-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.compact-select:hover, .compact-input:hover {
    border-color: #9ca3af;
}

/* Action Row */
.action-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.compact-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.compact-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.compact-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.compact-btn i {
    font-size: 0.75rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-compact {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .control-row {
        grid-template-columns: 1fr;
    }
    
    .action-row {
        flex-direction: column;
    }
    
    .compact-btn {
        justify-content: center;
    }
}

/* === Original Modern Control Panel Styles (Fallback) === */

.modern-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: none;
    overflow: hidden;
    position: relative;
}

.modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.modern-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    position: relative;
    z-index: 1;
}

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

.header-icon .icon-container {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.gradient-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
}

.header-text h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    letter-spacing: -0.025em;
}

.card-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
}

.modern-actions {
    display: flex;
    justify-content: flex-end;
}

.modern-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.8);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.status-pulse {
    position: relative;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    display: block;
    position: relative;
    animation: pulse 2s infinite;
}

.pulse-dot::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: #10b981;
    opacity: 0.3;
    animation: pulse-ring 2s infinite;
}

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

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}

.status-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.status-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-value {
    font-size: 0.9rem;
    color: #1a202c;
    font-weight: 600;
}

/* Modern Controls */
.modern-controls {
    padding: 2rem;
    background: white;
    position: relative;
    z-index: 1;
}

.control-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.control-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 1rem;
}

.section-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.section-title h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
}

.section-title p {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.3;
}

.modern-form {
    margin: 0;
}

.modern-select, .modern-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.modern-select:focus, .modern-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.modern-select:hover, .modern-input:hover {
    border-color: #cbd5e0;
}

/* Config Grid */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.config-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.config-card:hover {
    transform: translateY(-2px);
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.config-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.config-header i {
    color: #667eea;
    font-size: 1rem;
}

.config-label {
    font-weight: 600;
    color: #1a202c;
    font-size: 0.85rem;
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.875rem;
}

.action-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

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

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

.primary-action:hover:not(:disabled) {
    box-shadow: 0 12px 25px rgba(16, 185, 129, 0.4);
}

.danger-action {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: white;
}

.danger-action:hover:not(:disabled) {
    box-shadow: 0 12px 25px rgba(239, 68, 68, 0.4);
}

.secondary-action:hover:not(:disabled) {
    border-color: #667eea;
    background: #f8fafc;
}

.warning-action:hover:not(:disabled) {
    border-color: #f59e0b;
    background: #fffbeb;
}

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

.btn-content i {
    font-size: 1.25rem;
    margin-bottom: 0.125rem;
}

.btn-text {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
}

.btn-subtitle {
    font-size: 0.7rem;
    opacity: 0.8;
    line-height: 1.2;
}

/* Card 4: Reward Fit Parameters Styles */
.reward-fit-summary {
    margin: 1rem 0;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary-table th,
.summary-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.summary-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.summary-table tr:last-child td {
    border-bottom: none;
}

.summary-table tr:hover {
    background-color: #f5f5f5;
}

/* Reward Fit Categories */
.fit-high td:first-child {
    color: #28a745;
    font-weight: 600;
}

.fit-good td:first-child {
    color: #17a2b8;
    font-weight: 600;
}

.fit-neutral td:first-child {
    color: #ffc107;
    font-weight: 600;
}

.fit-low td:first-child {
    color: #dc3545;
    font-weight: 600;
}

/* Reward Fit Actions */
.reward-fit-actions {
    margin-top: 1rem;
    text-align: center;
}

.reward-fit-actions .btn {
    padding: 10px 20px;
    font-weight: 500;
}

/* Competitor Analysis Styling */
.result-section h6 {
    color: #333;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-section p {
    margin-bottom: 0.5rem;
    color: #666;
}

.result-section p strong {
    color: #333;
}

/* Card 5: Mapped Rewards Analysis Styles */
.card-5-content {
    padding: 1.5rem;
}

/* Parameter Definitions */
.parameter-definitions {
    margin-bottom: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.parameter-definitions h6 {
    margin-bottom: 1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.definitions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
}

.definition-item {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    line-height: 1.4;
}

.definition-item strong {
    color: #333;
    display: block;
    margin-bottom: 0.3rem;
}

.definition-item em {
    color: #666;
    font-size: 0.85rem;
    display: block;
    margin-top: 0.3rem;
}

/* Analysis Content */
.analysis-content {
    max-height: 80vh;
    overflow-y: auto;
}

/* Card Close Button */
.card-close-btn {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    transition: all 0.2s;
}

.card-close-btn:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Analysis Sections */
.analysis-section {
    margin-bottom: 2rem;
}

.analysis-section h4 {
    margin-bottom: 1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.competitors-list, .analyzed-list {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.competitor-item, .analyzed-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
    line-height: 1.4;
}

.competitor-item:last-child, .analyzed-item:last-child {
    border-bottom: none;
}

/* Analysis Table */
.analysis-table-container {
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.analysis-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.analysis-table th {
    background-color: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.9rem;
}

.analysis-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    vertical-align: top;
    font-size: 0.85rem;
}

.analysis-table tr:hover {
    background-color: #f5f5f5;
}

.score-cell {
    text-align: center;
    font-weight: 600;
    color: #333;
}

.parameters-cell {
    max-width: 300px;
    line-height: 1.6;
}

.reason-cell {
    max-width: 250px;
    line-height: 1.4;
}

/* Parameter Tags */
.param-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    margin: 0.1rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.param-tag-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.param-tag-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Fit Badges */
.fit-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.fit-badge.fit-high {
    background-color: #d4edda;
    color: #155724;
}

.fit-badge.fit-good {
    background-color: #d1ecf1;
    color: #0c5460;
}

.fit-badge.fit-neutral {
    background-color: #fff3cd;
    color: #856404;
}

.fit-badge.fit-low {
    background-color: #f8d7da;
    color: #721c24;
}

/* Mobile responsiveness for Card 5 */
@media (max-width: 768px) {
    .card-5-content {
        padding: 1rem;
    }
    
    .parameter-definitions {
        padding: 1rem;
    }
    
    .definitions-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .definition-item {
        padding: 0.75rem;
    }
    
    .analysis-table-container {
        font-size: 0.8rem;
    }
    
    .analysis-table th,
    .analysis-table td {
        padding: 0.5rem;
    }
    
    .param-tag {
        font-size: 0.7rem;
        padding: 0.1rem 0.3rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-header {
        padding: 1.5rem;
    }
    
    .header-main {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .modern-actions {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .control-section {
        margin-bottom: 1.5rem;
        padding: 1rem;
    }
}

/* === Pagination Styles === */

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

.pagination-info {
    font-size: 0.875rem;
    color: #6b7280;
}

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

.pagination-size label {
    margin: 0;
    color: #6b7280;
    font-weight: 500;
}

.pagination-size select {
    min-width: 80px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
}

.pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.pagination-summary {
    font-size: 0.875rem;
    color: #6b7280;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0 0.5rem;
}

.pagination-ellipsis {
    padding: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Table row hover and status badges */
.table-row:hover {
    background: #f0f9ff !important;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.category-badge {
    padding: 0.25rem 0.5rem;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Scraping Interface Mobile Responsive */
@media (max-width: 768px) {
    .config-row {
        grid-template-columns: 1fr;
    }
    
    .progress-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .card-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Pagination Mobile Responsive */
    .pagination-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .pagination-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-numbers {
        order: 3;
        width: 100%;
        justify-content: center;
        margin: 0.5rem 0;
    }
}

/* Timeline Context Styling */
.timeline-context, .timeline-badge {
    font-size: 0.8rem;
    color: #667eea;
    font-weight: normal;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
    margin-left: 0.5rem;
}

.stat-item.no-results {
    color: #ef4444;
}

.stat-item.no-results i {
    color: #ef4444;
}

/* No Campaigns Message */
.no-campaigns-message {
    text-align: center;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 2px dashed #e2e8f0;
    margin: 1rem 0;
}

.no-campaigns-icon {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.no-campaigns-message h6 {
    color: #475569;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.no-campaigns-message p {
    color: #64748b;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.no-campaigns-message ul {
    text-align: left;
    max-width: 400px;
    margin: 0 auto 1.5rem auto;
    color: #64748b;
    font-size: 0.85rem;
}

.no-campaigns-message li {
    margin-bottom: 0.5rem;
}

/* Campaigns Pagination */
.campaigns-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 0.5rem 0.5rem;
    margin-top: 1rem;
}

.pagination-info {
    font-size: 0.85rem;
    color: #64748b;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-indicator {
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
}

.pagination-controls .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.pagination-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Campaign Cards Grid */
.campaigns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

@media (max-width: 768px) {
    .campaigns-pagination {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .pagination-controls {
        width: 100%;
        justify-content: center;
    }
    
    .no-campaigns-message {
        padding: 1.5rem 1rem;
    }
    
    .timeline-badge {
        display: block;
        margin: 0.25rem 0 0 0;
        width: fit-content;
    }
}
/* Time estimation styles */
.time-estimate {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: normal;
    margin-left: 10px;
}

/* Error cell styles */
.error-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.error-indicator {
    color: #dc3545;
    font-size: 0.85em;
}

.recalculate-btn {
    font-size: 0.75em;
    padding: 2px 6px;
    min-width: auto;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.recalculate-btn:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* Failed score styling */
.failed-score {
    color: #dc3545;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

/* Scoring table improvements for error states */
.scoring-table td {
    vertical-align: middle;
    text-align: center;
    min-width: 100px;
}

.scoring-table .error-cell {
    min-height: 60px;
    padding: 8px 4px;
}

/* Time display in Card 4 logs */
.card4-realtime-logs .log-entry.time-info {
    background-color: #e3f2fd;
    border-left-color: #2196f3;
}

.card4-realtime-logs .log-entry.time-info .log-icon {
    color: #2196f3;
}

/* Hide Image Searches column */
th[data-column="trendImageScore"],
.trend-image-score {
    display: none !important;
}

/* Visual feedback for score updates */
.score-updated {
    background-color: #d4edda !important;
    transition: background-color 0.3s ease;
    border: 2px solid #28a745 !important;
}

.final-score-updated {
    background-color: #d1ecf1 !important;
    transition: background-color 0.3s ease;
    border: 2px solid #17a2b8 !important;
}

/* Pulse animation for updated cells */
@keyframes pulse-update {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.cell-pulse {
    animation: pulse-update 0.6s ease-in-out;
}

/* Console Logs Section */
.console-logs-section {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.logs-header h5 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.logs-header i {
    margin-right: 8px;
    color: var(--primary-color);
}

.console-logs-container {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    height: 300px;
    overflow-y: auto;
    padding: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    scrollbar-width: thin;
    scrollbar-color: #555 #1e1e1e;
}

.console-logs-container::-webkit-scrollbar {
    width: 8px;
}

.console-logs-container::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.console-logs-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.console-logs-container::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.console-log-entry {
    margin-bottom: 4px;
    color: #e0e0e0;
    word-wrap: break-word;
}

.console-log-entry .log-time {
    color: #888;
    margin-right: 8px;
    font-size: 12px;
}

.console-log-entry .log-message {
    color: #e0e0e0;
}

/* Color coding for different log types */
.console-log-entry.log-success .log-message {
    color: #4caf50;
}

.console-log-entry.log-error .log-message {
    color: #f44336;
}

.console-log-entry.log-warning .log-message {
    color: #ff9800;
}

.console-log-entry.log-processing .log-message {
    color: #2196f3;
}

/* Edit Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: var(--bg-hover);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 12px 12px;
}

/* Form Styles for Edit Modal */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.form-control[readonly] {
    background-color: var(--bg-secondary);
    color: var(--text-muted);
}

.form-control[multiple] {
    min-height: 120px;
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Action Buttons Styling */
.action-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.action-buttons .btn {
    min-width: 32px;
    height: 32px;
    padding: 6px 8px;
    font-size: 0.8rem;
}

.edit-entry-btn {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.edit-entry-btn:hover {
    background-color: #3a7bc8 !important;
    border-color: #3a7bc8 !important;
}
