@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --success-color: #059669;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  --dark-bg: #0f172a;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
}

* {
  box-sizing: border-box;
}

body {
  background-color: #f8fafc;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.scanner-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #111827 100%);
  color: #ffffff;
  padding: 2.2rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.header-icon-box {
  width: 48px;
  height: 48px;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #60a5fa;
  margin-right: 0.75rem;
}

/* Advisory Alert */
.advisory-card {
  background: #f0fdf4;
  border-left: 4px solid #0284c7;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  color: #0c4a6e;
}

/* Search & Input Card */
.search-card {
  border: none;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}

.search-card:focus-within {
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.url-input-group {
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.url-input-group:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.url-input-field {
  border: none !important;
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
  color: #0f172a;
}

.url-input-field:focus {
  outline: none;
  box-shadow: none;
}

.btn-submit-scan {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.75rem;
  color: #ffffff;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-submit-scan:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
  color: #ffffff;
}

.btn-submit-scan:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

/* KPI Metric Cards */
.kpi-card {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: #ffffff;
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.kpi-number {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.kpi-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

/* Status Badges */
.badge-status-pass {
  background-color: #dcfce7;
  color: #15803d;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  display: inline-block;
  white-space: nowrap;
}

.badge-status-fail {
  background-color: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  display: inline-block;
  white-space: nowrap;
}

.badge-status-manual {
  background-color: #fef3c7;
  color: #b45309;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  display: inline-block;
  white-space: nowrap;
}

/* Severity Badges */
.badge-sev-critical {
  background-color: #991b1b;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3em 0.6em;
  border-radius: 6px;
}

.badge-sev-high {
  background-color: #dc2626;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3em 0.6em;
  border-radius: 6px;
}

.badge-sev-medium {
  background-color: #ea580c;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3em 0.6em;
  border-radius: 6px;
}

.badge-sev-low {
  background-color: #0284c7;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3em 0.6em;
  border-radius: 6px;
}

/* Guideline Badges */
.badge-wcag {
  background-color: #1e40af;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
  border-radius: 6px;
}

.badge-gigw {
  background-color: #065f46;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
  border-radius: 6px;
}

/* Page Group & Results Container */
.page-group-card {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
  max-width: 100%;
}

.page-group-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 1.1rem 1.25rem;
}

/* Formatted Findings Cards View (Recommended - Fits on One Screen Without Horizontal Scroll) */
.finding-item-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #ffffff;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.finding-item-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.finding-item-card.border-fail {
  border-left: 5px solid var(--danger-color);
}

.finding-item-card.border-manual {
  border-left: 5px solid var(--warning-color);
}

.finding-item-card.border-pass {
  border-left: 5px solid var(--success-color);
}

/* Inspection Preview Thumbnail */
.inspection-thumbnail-box {
  width: 155px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  position: relative;
  background-color: #f8fafc;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.inspection-thumbnail-box:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  border-color: var(--primary-color);
}

.inspection-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  background-color: #f1f5f9;
  display: block;
}

.inspection-zoom-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

/* Live Webpage Snapshot Banner in Page Group Header */
.page-live-banner {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.page-live-banner:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.page-live-thumbnail {
  width: 96px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  flex-shrink: 0;
  background-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-live-thumbnail:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.page-live-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Selector Pill */
.selector-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  background: #f1f5f9;
  color: #334155;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  word-break: break-all;
}

.btn-copy-selector {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  padding: 0 2px;
  font-size: 0.75rem;
}

.btn-copy-selector:hover {
  color: var(--primary-color);
}

/* Recommendation Fix Box */
.finding-fix-box {
  background-color: #eff6ff;
  border-left: 3px solid var(--primary-color);
  border-radius: 6px;
  padding: 0.65rem 0.95rem;
  font-size: 0.82rem;
  color: #1e3a8a;
}

/* Screen-Fit Table View (Zero Horizontal Scroll!) */
.screen-fit-table {
  width: 100%;
  margin-bottom: 0;
  table-layout: auto;
}

.screen-fit-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 0.85rem;
  border-bottom: 2px solid var(--border-color);
}

.screen-fit-table td {
  padding: 0.85rem;
  vertical-align: top;
  border-bottom: 1px solid #f1f5f9;
}

.screen-fit-table tbody tr:hover {
  background-color: #f8fafc;
}

.code-snippet {
  background-color: #0f172a;
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 85px;
  overflow-y: auto;
}

/* Modal Preview Box */
.preview-modal-img-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  max-height: 560px;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #0f172a;
}

.preview-modal-img-container img {
  max-height: 540px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Progress bar */
.compliance-progress-bar {
  height: 22px;
  border-radius: 8px;
  background-color: #e2e8f0;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.compliance-progress-bar .progress-bar {
  transition: width 0.4s ease-in-out;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Responsive Media Queries */
@media (max-width: 991.98px) {
  .scanner-header {
    padding: 1.75rem 0.75rem;
  }
  
  .kpi-number {
    font-size: 1.85rem;
  }

  .inspection-thumbnail-box {
    width: 130px;
    height: 80px;
  }
}

@media (max-width: 767.98px) {
  .btn-submit-scan {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .header-icon-box {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .kpi-card {
    padding: 1rem 0.75rem;
  }
  
  .kpi-number {
    font-size: 1.6rem;
  }

  .inspection-thumbnail-box {
    width: 100%;
    height: 120px;
    margin-bottom: 0.75rem;
  }
}

/* Client PDF Report Download Button */
.btn-download-report {
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  transition: all 0.25s ease-in-out;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-download-report.disabled, 
.btn-download-report:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #94a3b8;
}

.btn-download-report.btn-ready {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.25);
  cursor: pointer;
  pointer-events: auto;
  opacity: 1;
}

.btn-download-report.btn-ready:hover {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.35);
}

.btn-download-report.btn-ready i {
  color: #ef4444 !important;
}

.btn-download-report.btn-generating {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  cursor: wait;
}

