/* ═══════════════════════════════════════════════════
   CamShield — Styles globaux
   Fonts : Space Mono + Syne (Google Fonts)
═══════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --bg:       #080910;
  --surface:  #0f1018;
  --surface2: #181924;
  --border:   #252636;
  --accent:   #169cda;
  --red:      #ff3d5a;
  --green:    #00e87a;
  --text:     #dde0ee;
  --muted:    #777a97;
  --warning:  #ffaa00;
  --font-mono: 'Space Mono', monospace;
  --font-sans: 'Syne', sans-serif;
  --radius:   8px;
  --radius-lg: 14px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Grid background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: .18;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
main { flex: 1; position: relative; z-index: 1; }

/* ═══════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════ */
header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(8,9,16,.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-mark {
  width: 40px; height: 40px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  letter-spacing: .05em;
  flex-shrink: 0;
}

.logo-text h1 {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
}

.logo-text p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Navigation */
nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
  letter-spacing: .03em;
}

nav a:hover,
nav a.active {
  color: var(--text);
  background: var(--surface2);
}

/* Switch langue */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.lang-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  transition: color .2s, background .2s;
}

.lang-btn:hover,
.lang-btn.active {
  color: var(--accent);
  background: rgba(22,156,218,.1);
}

.header-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 2px 7px;
  letter-spacing: .08em;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--border);
  background: rgba(8,9,16,.92);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.footer-copy {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}

.footer-links a:hover {
  color: var(--text);
}

/* ═══════════════════════════════════════════════════
   COMPOSANTS COMMUNS
═══════════════════════════════════════════════════ */

/* Bouton principal */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .05em;
  transition: opacity .2s, transform .1s;
}
.btn-primary:hover { opacity: .88; }
.btn-primary:active { transform: scale(.98); }

/* Bouton secondaire */
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.btn-secondary:hover { border-color: var(--accent); background: var(--surface); }

/* Badge statut */
.status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.badge-found   { background: rgba(255,61,90,.15);  color: var(--red);     border: 1px solid rgba(255,61,90,.3); }
.badge-clean   { background: rgba(0,232,122,.1);   color: var(--green);   border: 1px solid rgba(0,232,122,.25); }
.badge-error   { background: rgba(255,170,0,.1);   color: var(--warning); border: 1px solid rgba(255,170,0,.25); }
.badge-pending { background: rgba(119,122,151,.1); color: var(--muted);   border: 1px solid var(--border); }

/* Card surface */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* Input */
.form-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 12px 16px;
  width: 100%;
  outline: none;
  transition: border-color .2s;
}
.form-input:focus { border-color: var(--accent); }

/* ═══════════════════════════════════════════════════
   SCANNER — styles spécifiques
═══════════════════════════════════════════════════ */
#scan-section {
  max-width: 640px;
  margin: 48px auto 0;
  padding: 0 20px;
}

.form-intro {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-bottom: 10px;
  letter-spacing: .05em;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s;
}
.input-row:focus-within { border-color: var(--accent); }

.prefix {
  padding: 12px 14px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  background: rgba(22,156,218,.08);
  border-right: 1px solid var(--border);
}

.input-row .form-input {
  border: none;
  border-radius: 0;
  background: transparent;
}
.input-row .form-input:focus { border-color: transparent; }

/* Alt pseudo */
.alt-pseudo-wrapper { margin-top: 12px; }

.alt-toggle {
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  padding: 8px 14px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: color .2s, border-color .2s;
}
.alt-toggle:hover { color: var(--accent); border-color: var(--accent); }

.alt-input-zone {
  display: none;
  margin-top: 10px;
}
.alt-input-zone.open { display: block; }

.alt-label {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-bottom: 6px;
  display: block;
}

/* Boutons action scan */
.scan-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* Résultats */
#results-section {
  max-width: 840px;
  margin: 32px auto 64px;
  padding: 0 20px;
}

/* Summary bar */
.summary-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.summary-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  display: block;
  line-height: 1;
}

.summary-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

/* Copy all banner */
#copy-all-banner {
  display: none;
  margin-bottom: 20px;
}

.copy-all-btn {
  width: 100%;
  background: rgba(22,156,218,.1);
  border: 1px solid rgba(22,156,218,.3);
  color: var(--accent);
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .2s;
}
.copy-all-btn:hover { background: rgba(22,156,218,.18); }

/* Site cards accordéon */
.site-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color .2s;
}
.site-card:hover { border-color: rgba(22,156,218,.3); }
.site-card.found { border-left: 3px solid var(--red); }
.site-card.clean { border-left: 3px solid var(--green); }
.site-card.error { border-left: 3px solid var(--warning); }

.site-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.site-card-header:hover { background: var(--surface2); }

.card-site-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  flex: 1;
}

.card-video-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.card-chevron {
  color: var(--muted);
  transition: transform .2s;
  font-size: 12px;
}
.site-card.open .card-chevron { transform: rotate(90deg); }

/* Card body */
.card-body {
  display: none;
  padding: 0 18px 16px;
  border-top: 1px solid var(--border);
  animation: slideIn .15s ease;
}
.site-card.open .card-body { display: block; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.profile-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 12px;
  font-size: 12px;
  color: var(--muted);
}

.profile-link a {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  word-break: break-all;
}
.profile-link a:hover { text-decoration: underline; }

/* Videos section */
.videos-section { margin-top: 4px; }

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

.videos-count-label {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.video-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--surface2);
  margin-bottom: 4px;
  font-size: 12px;
}

.video-idx {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  min-width: 22px;
}

.video-url {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn-sm {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 10px;
  cursor: pointer;
  font-family: var(--font-mono);
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.copy-btn-sm:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn-sm.copied { color: var(--green); border-color: var(--green); }

/* Error detail */
.error-detail {
  font-size: 11px;
  color: var(--warning);
  font-family: var(--font-mono);
  padding: 10px 0 4px;
  opacity: .8;
}

/* Log stream */
#log-stream {
  margin-top: 20px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px;
}

.log-item {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  padding: 3px 0;
  animation: slideIn .2s ease;
}
.log-item.ok  { color: var(--green); }
.log-item.err { color: var(--warning); }

/* Scanning dots */
.scanning-dots::after {
  content: '...';
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ═══════════════════════════════════════════════════
   PAGES CONTENU (projet, roadmap, soutenir)
═══════════════════════════════════════════════════ */
.page-content {
  max-width: 760px;
  margin: 48px auto 80px;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.page-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 8px;
  line-height: 1.1;
}

.page-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 40px;
}

.page-content p {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 20px;
}

.page-content h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 40px 0 16px;
  color: var(--text);
}

.page-content a {
  color: var(--accent);
  text-decoration: none;
}
.page-content a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 640px) {
  header { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
  nav { display: none; } /* TODO: hamburger menu mobile */
  .summary-bar { grid-template-columns: 1fr 1fr; }
  .scan-actions { flex-direction: column; }
  footer { flex-direction: column; text-align: center; }
}

/* ═══════════════════════════════════════════════════
   VISIBILITÉ INITIALE — sections scanner
   JS gère l'affichage via style.display
═══════════════════════════════════════════════════ */

#progress-section { display: none; }
#results-section  { display: none; }
#copy-all-banner  { display: none; }

.alt-input-row {
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 8px;
  transition: border-color .2s;
}
.alt-input-row.visible { display: flex; }
.alt-input-row:focus-within { border-color: var(--accent); }

/* ═══════════════════════════════════════════════════
   SCANNER — PROGRESS SECTION
═══════════════════════════════════════════════════ */

#progress-section {
  max-width: 640px;
  margin: 48px auto 0;
  padding: 0 20px;
}

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

.progress-title {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .05em;
}

.progress-count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.progress-bar-track {
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .3s ease;
}

/* Log entries */
.site-log {
  max-height: 320px;
  overflow-y: auto;
}

.log-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid rgba(37,38,54,.5);
  animation: slideIn .15s ease;
}

.log-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background .2s;
}

.log-entry.scanning .log-dot { background: var(--accent); }
.log-entry.found    .log-dot { background: var(--red); }
.log-entry.clean    .log-dot { background: var(--green); }
.log-entry.error    .log-dot { background: var(--warning); }

.log-site {
  flex: 1;
  color: var(--text);
}

.log-status {
  font-size: 11px;
}

.log-entry.found   .log-status { color: var(--red); }
.log-entry.clean   .log-status { color: var(--green); }
.log-entry.error   .log-status { color: var(--warning); }
.log-entry.scanning .log-status { color: var(--accent); }

/* ═══════════════════════════════════════════════════
   SCANNER — RESULTS SECTION
═══════════════════════════════════════════════════ */

#results-section {
  max-width: 840px;
  margin: 32px auto 64px;
  padding: 0 20px;
}

.results-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 24px;
}

.results-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.results-pseudo {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

/* Summary strip */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.summary-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.summary-num {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  display: block;
  line-height: 1;
}
.summary-num.danger  { color: var(--red); }
.summary-num.accent  { color: var(--accent); }
.summary-num.ok      { color: var(--green); }
.summary-num.neutral { color: var(--muted); }

.summary-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  display: block;
}

/* Copy all banner */
.copy-all-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(22,156,218,.07);
  border: 1px solid rgba(22,156,218,.25);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}

.copy-all-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.copy-all-text strong { color: var(--accent); }

#copy-all-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s;
}
#copy-all-btn:hover { opacity: .85; }
#copy-all-btn.copied { background: var(--green); }

/* Sites list */
.sites-list { margin-bottom: 24px; }

/* Profile row dans card body */
.profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.profile-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.profile-row a {
  flex: 1;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: none;
  word-break: break-all;
}
.profile-row a:hover { text-decoration: underline; }

/* Copy videos btn */
.copy-videos-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: color .2s, border-color .2s;
}
.copy-videos-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-videos-btn.copied { color: var(--green); border-color: var(--green); }

/* No videos note */
.no-videos-note {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  padding: 8px 0;
}

/* DMCA tip */
.dmca-tip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 24px 0;
}

.dmca-tip h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--accent);
}

.dmca-tip p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

.dmca-tip a {
  color: var(--accent);
  text-decoration: none;
}
.dmca-tip a:hover { text-decoration: underline; }

/* Bouton scan */
#scan-btn {
  margin-top: 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 13px 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .05em;
  width: 100%;
  transition: opacity .2s, transform .1s;
}
#scan-btn:hover { opacity: .88; }
#scan-btn:active { transform: scale(.98); }

/* Bouton nouveau scan */
#new-scan-btn {
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
  margin-top: 8px;
}
#new-scan-btn:hover { color: var(--text); border-color: var(--accent); }

/* Form hint */
.form-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* Alt input row visible */
.alt-input-row.visible {
  display: flex !important;
}

/* Responsive summary */
@media (max-width: 640px) {
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .copy-all-banner { flex-direction: column; }
}