/* ScanGrid Frontend Styles - extracted from scan.html */

/* ScanGrid Professional Dark Theme Styles */

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  scroll-behavior: smooth;
}

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

/* Header Styles */
.dark-header {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #334155;
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 2rem;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-container span {
  color: #94a3b8;
  font-size: 0.9rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #3b82f6;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem 0;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Card Styles */
.card {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #f1f5f9;
  border-bottom: 1px solid #334155;
  padding-bottom: 1rem;
}

.card-title svg {
  color: #3b82f6;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #f1f5f9;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #475569;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 1rem;
  transition: all 0.3s ease;
}

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

.form-control::placeholder {
  color: #64748b;
}

/* Button Styles */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px 0 rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: rgba(51, 65, 85, 0.8);
  color: #e2e8f0;
  border: 1px solid #475569;
}

.btn-secondary:hover {
  background: rgba(71, 85, 105, 0.8);
  border-color: #64748b;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn:disabled,
.btn.disabled {
  background: #374151;
  color: #6b7280;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Scan Options */
.scan-options {
  margin-top: 2rem;
}

.scan-category {
  margin-bottom: 3rem;
  padding: 2rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  border: 1px solid #1e293b;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #334155;
}

.scan-category h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
}

.select-category-btn {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border: 1px solid #3b82f6;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.select-category-btn:hover {
  background: rgba(59, 130, 246, 0.3);
}

/* Scan Type Grid */
.scan-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1rem;
}

.scan-type {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.3s ease;
  position: relative;
}

.scan-type:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.scan-type input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.scan-type label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  width: 100%;
  padding: 0.5rem;
}

.scan-name {
  font-weight: 500;
  color: #e2e8f0;
}

.scan-impact {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scan-impact.low {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.scan-impact.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.scan-impact.high {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.scan-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #8b5cf6;
  color: white;
  font-size: 0.625rem;
  padding: 0.25rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.scan-badge.new {
  background: linear-gradient(135deg, #10b981, #059669);
}

/* Checked state */
.scan-type input[type="checkbox"]:checked + label {
  color: #3b82f6;
}

.scan-type input[type="checkbox"]:checked + label .scan-name {
  color: #3b82f6;
}

.scan-type:has(input[type="checkbox"]:checked) {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

/* Alert Styles */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left-color: #f59e0b;
  color: #fbbf24;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-left-color: #3b82f6;
  color: #60a5fa;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: #ef4444;
  color: #f87171;
}

/* Scan Count Badges */
.scan-count-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scan-count-badge.low {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.scan-count-badge.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.scan-count-badge.high {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Warning Message */
.warning-message {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  color: #fbbf24;
  text-align: center;
}

/* Form Check */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.form-check-input {
  margin-top: 0.25rem;
}

.form-check-label {
  color: #cbd5e1;
  line-height: 1.5;
}

.form-check-label a {
  color: #3b82f6;
  text-decoration: none;
}

.form-check-label a:hover {
  text-decoration: underline;
}

/* Progress Styles */
.progress-container {
  margin: 2rem 0;
}

.progress-bar-bg {
  background: rgba(51, 65, 85, 0.8);
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}

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

.progress-text {
  text-align: center;
  margin-top: 1rem;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Results Container */
.scan-results {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 2rem;
  margin-top: 2rem;
}

.scan-results h3 {
  color: #f1f5f9;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

/* Footer */
footer {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid #334155;
  margin-top: 4rem;
  padding: 3rem 0 1.5rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.footer-column h3 {
  color: #f1f5f9;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #3b82f6;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #334155;
  color: #64748b;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .scan-type-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .scan-type-grid {
    grid-template-columns: 1fr;
  }
  
  .category-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 2rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-3 {
  margin-top: 1rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.ml-2 {
  margin-left: 0.5rem;
}

.mb-0 {
  margin-bottom: 0;
}

/* Dark theme class for body */
.dark-theme {
  /* This class is applied to body, styles are already in body selector */
}

/* Error message styles */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid #ef4444;
  color: #f87171;
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
}

/* Badge styles */
.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.bg-white {
  background-color: white;
}

.text-success {
  color: #22c55e;
}

/* Scans remaining indicator */
.scans-remaining {
  float: right;
  font-weight: 600;
  color: #3b82f6;
}

/* Scan Results Styles */
.scan-metadata {
  background: rgba(51, 65, 85, 0.6);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 2rem;
  border-left: 4px solid #3b82f6;
}

.scan-metadata p {
  margin: 0.5rem 0;
  color: #cbd5e1;
}

.scan-result-section {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border: 1px solid #334155;
}

.scan-result-section h4 {
  color: #f1f5f9;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  border-bottom: 1px solid #334155;
  padding-bottom: 0.5rem;
}

.scan-result-content pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.scan-result-content p {
  color: #cbd5e1;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.scan-result-content strong {
  color: #f1f5f9;
}

/* Loading and status styles */
.scan-status {
  text-align: center;
  padding: 2rem;
  color: #94a3b8;
}

.scan-status-icon {
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 0.5rem;
}

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

/* Scan type specific styling */
.scan-type.selected {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}

/* Enhanced hover effects */
.scan-type:hover .scan-name {
  color: #60a5fa;
  transition: color 0.2s ease;
}

/* Button loading state */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

/* Responsive improvements */
@media (max-width: 576px) {
  .scan-type {
    padding: 0.75rem;
  }
  
  .scan-type label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .scan-impact {
    align-self: flex-end;
  }
  
  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
}

/* AI Analysis Styles */
.ai-analysis-section {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  backdrop-filter: blur(10px);
}

.ai-analysis-section h4 {
  color: #10b981;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-analyze-all-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.ai-analyze-all-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.ai-analyze-all-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ai-analysis-result {
  margin-top: 1rem;
  animation: slideDown 0.3s ease;
}

.comprehensive-analysis {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.comprehensive-analysis h5 {
  color: #10b981;
  margin-bottom: 1rem;
}

.analysis-text {
  line-height: 1.6;
  color: #e2e8f0;
  margin-bottom: 1rem;
}

/* Finding Items */
.findings-section {
  margin-top: 1rem;
}

.findings-section h5 {
  color: #f7fafc;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.finding-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  border-left: 4px solid;
  transition: all 0.3s ease;
}

.finding-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(5px);
}

.finding-item.severity-critical {
  border-left-color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

.finding-item.severity-high {
  border-left-color: #ea580c;
  background: rgba(234, 88, 12, 0.1);
}

.finding-item.severity-medium {
  border-left-color: #ca8a04;
  background: rgba(202, 138, 4, 0.1);
}

.finding-item.severity-low {
  border-left-color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
}

.finding-item.severity-info {
  border-left-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.1);
}

.finding-item.severity-error {
  border-left-color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

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

.severity-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  min-width: 60px;
  text-align: center;
}

.severity-badge.severity-critical {
  background: #dc2626;
  color: white;
}

.severity-badge.severity-high {
  background: #ea580c;
  color: white;
}

.severity-badge.severity-medium {
  background: #ca8a04;
  color: white;
}

.severity-badge.severity-low {
  background: #16a34a;
  color: white;
}

.severity-badge.severity-info {
  background: #0ea5e9;
  color: white;
}

.severity-badge.severity-error {
  background: #dc2626;
  color: white;
}

.severity-badge.severity-unknown {
  background: #6b7280;
  color: white;
}

.finding-description {
  color: #f7fafc;
  font-weight: 600;
  flex: 1;
}

.finding-details {
  color: #cbd5e0;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.finding-details p {
  margin: 0.5rem 0;
}

.ai-error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 8px;
  padding: 1rem;
}

.ai-error p {
  color: #fca5a5;
  margin: 0.25rem 0;
}

.remaining-count {
  color: #94a3b8;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.loading-spinner {
  color: #60a5fa;
  font-style: italic;
  padding: 1rem;
  text-align: center;
}

/* Animation for sliding down */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Export Section Styles */
.export-section {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  backdrop-filter: blur(10px);
}

.export-section h4 {
  color: #3b82f6;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.export-pdf-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.export-pdf-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

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

/* Homepage-specific styles */
.features {
  display: flex !important;
  flex-wrap: nowrap !important;
  flex-direction: row !important;
  justify-content: center;
  gap: 2rem;
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: auto !important;
}

.feature {
  flex: 1;
  min-width: 280px;
  max-width: 350px;
  padding: 20px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  border: 1px solid #e2e8f0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.feature h3 {
  color: #1e293b;
  margin-top: 0;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.feature p {
  color: #64748b;
  line-height: 1.6;
}

/* Responsive design for smaller screens */
@media (max-width: 968px) {
  .features {
    flex-wrap: wrap !important;
  }
  .feature {
    min-width: 280px;
    max-width: 400px;
  }
}
