/**
 * MOBILE AUDIT PANEL - CSS
 */

/* ── CONTAINER ────────────────────────────────────────────── */
.mobile-audit-panel {
  background: #fff;
  border-radius: 10px;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
}

.mobile-audit-panel.is-mobile {
  font-size: 14px;
}

.map-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.map-title {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 6px 0;
}

.map-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

/* ── SECTIONS ─────────────────────────────────────────────── */
.map-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.map-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.map-section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f9fafb;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  text-align: left;
  transition: background 0.15s;
}

.map-section-header:hover,
.map-section-header.open {
  background: #e6f7ff;
  color: #0c3b6e;
}

.map-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-section-icon {
  font-size: 16px;
}

.map-chevron {
  font-size: 12px;
  color: #6b7280;
}

.map-section-body {
  padding: 16px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

/* ── TAP SCORE CARD ───────────────────────────────────────── */
.tap-score-card {
  background: linear-gradient(135deg, #fff1f2 0%, #fff7ed 100%);
  border: 2px solid #fecaca;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

.tap-score-title {
  font-size: 18px;
  font-weight: 700;
  color: #991b1b;
  margin: 0 0 12px 0;
}

.tap-score-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.tap-wcag-label {
  font-size: 12px;
  font-weight: 600;
  color: #b91c1c;
  margin: 0;
}

.tap-score-value {
  font-size: 36px;
  font-weight: 800;
  color: #dc2626;
  margin: 4px 0;
}

.tap-score-meta {
  font-size: 12px;
  color: #b91c1c;
  margin: 0;
}

.tap-score-info {
  text-align: right;
  font-size: 12px;
  color: #b91c1c;
}

.tap-score-info p {
  margin: 2px 0;
}

.tap-progress-track {
  background: #fecaca;
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
}

.tap-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  border-radius: 6px;
  transition: width 0.4s ease;
}

/* ── FINDINGS BOXES ───────────────────────────────────────── */
.map-findings {
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.map-findings.critical,
.map-findings.danger {
  background: #fef2f2;
  border: 1px solid #fca5a5;
}

.map-findings.warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
}

.map-findings.success {
  background: #f0fdf4;
  border: 1px solid #86efac;
}

.map-findings.info {
  background: #eff6ff;
  border: 1px solid #93c5fd;
}

.map-findings h4,
.map-findings-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #1f2937;
}

.map-findings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.map-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.map-badge.critical {
  background: #dc2626;
  color: #fff;
}

.map-findings-note {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 12px 0;
  line-height: 1.5;
}

/* ── TAP TARGET ITEMS ─────────────────────────────────────── */
.tap-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.tap-item {
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
}

.tap-item.critical {
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.tap-item.warning {
  background: #fef3c7;
  border: 1px solid #fcd34d;
}

.tap-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tap-item-name {
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 4px 0;
}

.tap-item-size {
  font-size: 12px;
  font-family: "Courier New", monospace;
  color: #6b7280;
  margin: 0;
}

.tap-item-badge {
  font-size: 11px;
  font-weight: 700;
  background: #fff;
  border-radius: 4px;
  padding: 3px 6px;
  white-space: nowrap;
  color: #dc2626;
}

.tap-item-loc {
  font-size: 11px;
  font-style: italic;
  color: #6b7280;
  margin: 4px 0 0 0;
}

.tap-item-rec {
  font-size: 12px;
  color: #374151;
  margin: 6px 0 0 0;
  padding: 6px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 4px;
}

.tap-code-fix {
  margin-top: 14px;
  background: #fff;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 12px;
}

.tap-code-label {
  font-size: 12px;
  font-weight: 600;
  color: #7f1d1d;
  margin: 0 0 6px 0;
}

.tap-code-fix pre {
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: #7f1d1d;
  background: #fef2f2;
  padding: 8px;
  border-radius: 4px;
  margin: 0;
  overflow-x: auto;
}

.tap-ok-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  font-size: 13px;
  color: #166534;
}

.tap-ok-list li {
  padding: 3px 0;
}

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
.map-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.map-stat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.map-stat.danger {
  border-color: #fca5a5;
  background: #fef2f2;
}
.map-stat.warning {
  border-color: #fcd34d;
  background: #fffbeb;
}
.map-stat.success {
  border-color: #86efac;
  background: #f0fdf4;
}

.map-stat-val {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.map-stat.danger .map-stat-val {
  color: #dc2626;
}
.map-stat.warning .map-stat-val {
  color: #d97706;
}
.map-stat.success .map-stat-val {
  color: #16a34a;
}

.map-stat-lbl {
  font-size: 11px;
  color: #6b7280;
  margin: 4px 0 0 0;
}

.typo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.typo-item {
  background: #fff;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 8px;
  font-size: 12px;
  font-family: "Courier New", monospace;
  color: #b91c1c;
  margin: 0;
}

/* ── LAYOUT GRID ──────────────────────────────────────────── */
.map-layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.map-layout-card {
  border-radius: 6px;
  padding: 14px;
  border: 1px solid;
}

.map-layout-card.success {
  background: #f0fdf4;
  border-color: #86efac;
}
.map-layout-card.warning {
  background: #fffbeb;
  border-color: #fcd34d;
}
.map-layout-card.danger {
  background: #fef2f2;
  border-color: #fca5a5;
}

.map-layout-label {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 4px 0;
}

.map-layout-desc {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

.map-breakpoints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.bp-chip {
  background: #fff;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
  font-family: "Courier New", monospace;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
}

/* ── PERFORMANCE ──────────────────────────────────────────── */
.map-perf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}

.map-perf-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}

.map-perf-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  margin: 0;
}

.map-perf-value {
  font-size: 26px;
  font-weight: 700;
  color: #1f2937;
  margin: 8px 0 4px 0;
}

.map-perf-target {
  font-size: 11px;
  color: #9ca3af;
  margin: 0;
}

.map-issues-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  font-size: 13px;
  color: #92400e;
}

.map-issues-list li {
  padding: 3px 0;
}

/* ── KEYBOARD ─────────────────────────────────────────────── */
.map-keyboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #1e40af;
}

.map-keyboard-list p {
  margin: 0;
}

/* ── EXPORT ───────────────────────────────────────────────── */
.map-export-row {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.map-export-btn {
  width: 100%;
  background: #0c3b6e;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.map-export-btn:hover {
  background: #0a2f58;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .tap-score-row {
    flex-direction: column;
  }
  .map-stat-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .map-perf-grid {
    grid-template-columns: 1fr;
  }
  .map-layout-grid {
    grid-template-columns: 1fr 1fr;
  }
  .tap-score-info {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .map-stat-row {
    grid-template-columns: 1fr;
  }
  .map-layout-grid {
    grid-template-columns: 1fr;
  }
  .tap-score-value {
    font-size: 28px;
  }
}

/* ── PRINT ────────────────────────────────────────────────── */
@media print {
  .mobile-audit-panel {
    background: #fff;
  }
  .map-export-row,
  .map-export-btn {
    display: none !important;
  }
  .map-section-body {
    display: block !important;
  }
  .map-section-header {
    background: #e6f7ff !important;
    color: #0c3b6e !important;
  }
  .map-section-header .map-chevron {
    display: none;
  }
  .tap-list {
    max-height: none;
    overflow: visible;
  }
  .map-findings,
  .tap-score-card,
  .map-stat,
  .map-layout-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .severity-badge,
  .map-badge,
  .tap-progress-bar {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
