/* ═══════════════════════════════════════════════════
   Gmc Checker - Stylesheet
   Modern, clean, professional compliance dashboard
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-card-hover: #1f2330;
  --bg-input: #141722;
  --border: #2a2d3a;
  --border-focus: #3B82F6;
  --text: #e4e7f1;
  --text-muted: #8891a5;
  --text-dim: #5c6478;
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --primary-glow: rgba(59, 130, 246, 0.15);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ─── HEADER ─────────────────────────────────────── */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 17, 23, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

.logo-accent {
  color: var(--primary);
}

.header-links { display: flex; gap: 16px; }

.header-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition);
}
.header-link:hover { color: var(--text); }

/* ─── HERO ───────────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 60px;
}

.hero-content {
  max-width: 700px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 100px;
  background: var(--primary-glow);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 52px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, #3B82F6, #8B5CF6, #EC4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 40px;
}

/* ─── SCAN FORM ──────────────────────────────────── */

.scan-form {
  display: flex;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto 40px;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-dim);
}

#urlInput {
  width: 100%;
  padding: 14px 16px 14px 44px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
#urlInput::placeholder { color: var(--text-dim); }
#urlInput:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

#scanBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
#scanBtn:hover { background: var(--primary-hover); transform: translateY(-1px); }
#scanBtn:active { transform: translateY(0); }
#scanBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
#scanBtn .spinner { display: none; }
#scanBtn.loading .btn-icon { display: none; }
#scanBtn.loading .spinner { display: block; }

.btn-icon { width: 18px; height: 18px; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── HERO FEATURES ──────────────────────────────── */

.hero-features {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}
.hero-feature svg { width: 16px; height: 16px; color: var(--primary); }

/* ─── SCANNING SECTION ───────────────────────────── */

.scanning {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 60px;
}

.scanning-content {
  max-width: 620px;
  width: 100%;
  text-align: center;
}

/* Scanner animation */
.scanning-animation {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 32px;
}

.scanner-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}
.ring-2 {
  inset: -10px;
  animation-duration: 2.5s;
  animation-direction: reverse;
  border-color: rgba(139, 92, 246, 0.15);
  border-top-color: #8B5CF6;
}
.ring-3 {
  inset: -20px;
  animation-duration: 3.5s;
  border-color: rgba(236, 72, 153, 0.1);
  border-top-color: #EC4899;
}

.scanner-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
}

.scanning-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.scanning-url {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
  word-break: break-all;
}

/* Progress */
.progress-container { margin-bottom: 24px; }

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, #3B82F6, #8B5CF6);
  border-radius: 100px;
  transition: width 0.5s ease;
  animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.progress-text {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Activity Log */
.log-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
  overflow: hidden;
}

.log-header {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.log-count {
  background: var(--primary-glow);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 12px;
}

.log-body {
  padding: 12px 16px;
  max-height: 300px;
  overflow-y: auto;
  font-family: 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.8;
}

.log-entry {
  color: var(--text-muted);
  padding: 2px 0;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.log-body::-webkit-scrollbar { width: 6px; }
.log-body::-webkit-scrollbar-track { background: transparent; }
.log-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }

/* ─── RESULTS SECTION ────────────────────────────── */

.results {
  padding: 88px 24px 60px;
}

.results-content {
  max-width: 1000px;
  margin: 0 auto;
}

/* Top Bar */
.results-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.btn-back:hover { background: var(--bg-card-hover); border-color: var(--text-dim); }
.btn-back svg { width: 16px; height: 16px; }

.results-actions { display: flex; gap: 10px; }

.btn-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.btn-action:hover { background: var(--primary-hover); }
.btn-action svg { width: 16px; height: 16px; }

.btn-action-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-action-secondary:hover { background: var(--bg-card-hover); }

/* Score Overview */
.score-overview {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  align-items: stretch;
}

.score-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 200px;
}

.score-circle-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 12px;
}

.score-circle { transform: rotate(-90deg); }
.score-bg { stroke: var(--border); }
.score-fg { stroke: var(--primary); transition: stroke-dashoffset 1.5s ease; stroke-linecap: round; }

.score-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
}

.score-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.score-stats {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-passed .stat-number { color: var(--success); }
.stat-failed .stat-number { color: var(--danger); }
.stat-warning .stat-number { color: var(--warning); }
.stat-total .stat-number { color: var(--primary); }

/* Section Card */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
}

.section-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-header h3 svg { width: 20px; height: 20px; color: var(--primary); }

/* Filter Tabs */
.filter-tabs { display: flex; gap: 6px; }

.filter-tab {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.filter-tab:hover { border-color: var(--text-dim); color: var(--text); }
.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Intel Grid */
.intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
}

.intel-item {
  background: var(--bg-card);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.intel-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.intel-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.intel-value.good { color: var(--success); }
.intel-value.bad { color: var(--danger); }
.intel-value.neutral { color: var(--info); }

/* Checks List */
.checks-list { padding: 8px; }

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.check-item:hover { background: rgba(255,255,255,0.02); }

.check-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.check-icon svg { width: 14px; height: 14px; }

.check-icon.passed { background: var(--success-bg); color: var(--success); }
.check-icon.failed { background: var(--danger-bg); color: var(--danger); }
.check-icon.warning { background: var(--warning-bg); color: var(--warning); }

.check-content { flex: 1; min-width: 0; }

.check-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.check-detail {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.check-severity {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.check-severity.critical { background: var(--danger-bg); color: var(--danger); }
.check-severity.warning { background: var(--warning-bg); color: var(--warning); }
.check-severity.info { background: var(--info-bg); color: var(--info); }

/* Issues List */
.issues-list { padding: 8px; }

.issue-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.issue-item:hover { background: rgba(255,255,255,0.02); }

.issue-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.issue-bullet.critical { background: var(--danger); }
.issue-bullet.high { background: var(--danger); }
.issue-bullet.warning { background: var(--warning); }
.issue-bullet.medium { background: var(--warning); }
.issue-bullet.info { background: var(--info); }
.issue-bullet.low { background: var(--info); }

.issue-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Issue Block Layout */
.issue-item-block {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.issue-item-block:last-child { border-bottom: none; }
.issue-item-block:hover { background: rgba(255,255,255,0.02); }

.issue-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.issue-title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.issue-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
  padding-left: 18px;
}

.issue-pages {
  padding-left: 18px;
  margin-bottom: 8px;
}

.issue-pages-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.issue-page-link {
  display: block;
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  padding: 2px 0;
  word-break: break-all;
}
.issue-page-link:hover { text-decoration: underline; }

.issue-page-text {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 0;
}

.issue-pages-more {
  display: inline-block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.issue-action {
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 18px;
  line-height: 1.5;
}
.issue-action strong {
  color: var(--text);
}

/* ─── MODAL ──────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}
.modal-body p { margin-bottom: 16px; }
.modal-body h4 { color: var(--text); margin-bottom: 8px; font-size: 14px; }
.modal-body ul { padding-left: 20px; }
.modal-body li { margin-bottom: 6px; }

/* ─── TOAST ──────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--danger);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
}

.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ─── RESPONSIVE ─────────────────────────────────── */

@media (max-width: 768px) {
  .hero-title { font-size: 32px; }

  .scan-form {
    flex-direction: column;
  }

  .score-overview {
    flex-direction: column;
  }

  .score-stats {
    grid-template-columns: 1fr 1fr;
  }

  .hero-features {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .results-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .results-actions {
    justify-content: stretch;
  }
  .results-actions .btn-action { flex: 1; justify-content: center; }

  .filter-tabs {
    flex-wrap: wrap;
  }

  .intel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-title { font-size: 26px; }
  .hero-subtitle { font-size: 14px; }
  .score-stats { grid-template-columns: 1fr; }
}
