/* --- CONTAINER PRINCIPAL --- */
.test-container {
    position: relative;
    width: 100%;
    min-height: 600px;
    background-color: var(--bg-hero, #0f172a); /* Fond sombre */
    border-bottom: 1px solid var(--border);
    user-select: none;
    transition: background-color 0.3s ease;
    overflow: hidden;
    border-radius: 8px;
}

/* --- DASHBOARD (Menu de sélection) --- */
.dashboard-wrapper {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 20px;
    font-family: 'Inter', sans-serif;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 40px;
}
.dashboard-header h2 { 
    font-size: 32px; 
    color: var(--text-inverse, #fff); 
    margin-bottom: 12px; 
    font-weight: 700;
}
.dashboard-header p { 
    font-size: 16px;
    color: var(--text-inverse-muted, #94a3b8); 
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Grille des tests */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

/* CARTES (Style Dark/Glass) */
.test-card {
    /* Fond transparent sombre pour ne pas agresser les yeux */
    background: rgba(255, 255, 255, 0.03); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.test-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.test-card.selected {
    /* Sélection : Teinte bleutée subtile mais visible */
    background: rgba(37, 99, 235, 0.15); 
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 1px var(--primary, #2563eb);
}

.test-card input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary, #2563eb);
}

.test-card label {
    font-size: 15px;
    font-weight: 500;
    /* Texte en blanc pour le fond sombre */
    color: var(--text-inverse, #fff); 
    cursor: pointer;
    flex: 1;
}

/* Actions du Dashboard */
.dashboard-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 20px;
}

/* BOUTON SECONDAIRE (Style "Test My Phone") */
.dashboard-actions .btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-inverse, #fff);
}

.dashboard-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

/* --- MODE PLEIN ÉCRAN --- */
.test-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10001; 
    background: #000;
    cursor: none;
    border-radius: 0;
}

/* ZONE DE RENDU */
#test-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

svg { display: block; width: 100%; height: 100%; }

/* --- UI CONTROLS --- */
.test-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    padding: 15px 20px;
    display: flex; 
    align-items: center;
    justify-content: space-between;
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10002;
}

.test-container:not(.fullscreen) .test-controls { display: none !important; }
.test-container.show-ui .test-controls { transform: translateY(0); }
.test-container.show-ui { cursor: default; }

.control-row { display: flex; align-items: center; gap: 20px; }
#test-name { font-weight: 600; min-width: 180px; text-align: center; }
.nav-btn, #exit-fullscreen {
    padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 14px;
    background: var(--primary, #2563eb); border: none; color: white;
}
#exit-fullscreen { background: transparent; border: 1px solid rgba(255,255,255,0.3); }

/* Tests Spécifiques */
.gradient-stage { width: 100%; height: 100%; display: flex; flex-direction: column; }
.gradient-bar { flex: 1; width: 100%; }
.sharpness-text {
    background: white; color: black; width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.response-stage { position: relative; width: 100%; height: 100%; background: #444; }
.moving-block {
    position: absolute; width: 50px; height: 100px; background: #fff;
    top: 50%; transform: translateY(-50%);
}

/* Contenu SEO */
.content-section { padding: 40px 20px; max-width: 800px; margin: 0 auto; }
.ad-placeholder {
    width: 100%; height: 90px; background: var(--bg-main, #f8fafc); border: 1px dashed var(--border, #e2e8f0);
    display: flex; align-items: center; justify-content: center; margin-bottom: 40px;
    border-radius: 8px; color: var(--text-muted, #64748b);
}
.seo-article h1 { font-size: 28px; margin-bottom: 24px; color: var(--text-main, #0f172a); }
.seo-article h3 { font-size: 20px; margin-top: 32px; margin-bottom: 12px; color: var(--text-main, #0f172a); }
.seo-article p { color: var(--text-muted, #64748b); margin-bottom: 16px; line-height: 1.7; }

/* =========================================
   PIXEL FIXER UTILITY PANEL (Style Glassmorphism Premium)
   ========================================= */
.th-utility-panel {
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 950px;
    background: rgba(17, 24, 39, 0.7); /* Dark slate semi-trans */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg, 16px);
    padding: clamp(20px, 4vw, 36px);
    color: var(--text-inverse, #fff);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    margin: 20px auto;
    font-family: 'Inter', sans-serif;
    gap: 24px;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.th-utility-header {
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 16px;
}

.th-utility-header h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #0ea5e9, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.th-utility-header p {
    font-size: 14px;
    color: var(--text-inverse-muted, #cbd5e1);
    line-height: 1.5;
}

.th-utility-content {
    display: flex;
    gap: 32px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.th-canvas-container {
    flex: 1 1 400px;
    max-width: 500px;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md, 8px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: #000;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
}

#th-strobe-canvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
}

.th-control-card {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md, 8px);
    padding: 24px;
    gap: 20px;
    align-items: center;
}

.th-timer-display {
    font-family: 'Monospace', monospace;
    font-size: 54px;
    font-weight: 700;
    color: #38bdf8;
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
    letter-spacing: 0.05em;
}

.th-progress-wrapper {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm, 4px);
    overflow: hidden;
}

.th-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #0ea5e9);
    border-radius: var(--radius-sm, 4px);
    transition: width 0.3s ease;
}

.th-btn-group {
    display: flex;
    gap: 12px;
    width: 100%;
}

.btn-utility-trigger {
    flex: 1;
    font-size: 14px !important;
    height: 42px !important;
    border-radius: var(--radius-sm, 6px) !important;
}

.th-status-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-inverse-muted, #94a3b8);
}

.system-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    transition: background-color 0.3s ease;
}

.system-status-indicator.active {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.system-status-indicator.strobe-running {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: blinkStatus 1s infinite alternate;
}

.th-info-note {
    font-size: 13px;
    color: var(--text-inverse-muted, #cbd5e1);
    background: rgba(56, 189, 248, 0.05);
    border: 1px dashed rgba(56, 189, 248, 0.2);
    padding: 16px;
    border-radius: var(--radius-md, 8px);
    line-height: 1.5;
}

@keyframes blinkStatus {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

/* Mobile specific overrides to keep it centered and beautiful */
@media (max-width: 768px) {
    .th-utility-panel {
        width: 95%;
        padding: 16px;
        gap: 16px;
    }
    .th-utility-content {
        gap: 16px;
    }
}

/* =========================================
   HUD IMMERSIF (Axe 2)
   ========================================= */
.th-immersive-hud {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 28px;
  border-radius: 99px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10005;
}

.th-immersive-hud.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.th-immersive-hud .hud-badge {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.th-immersive-hud .hud-text {
  color: #cbd5e1;
}

.th-immersive-hud .key-cap {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 700;
}