/* ============================================
   TESTER JOYPAD PS5 — stili specifici
   File: css/tester.css
   ============================================ */

/* HERO PAGINA INTERNA */
.page-hero {
  padding: 130px 0 60px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(0,168,255,.1), transparent 45%),
    radial-gradient(circle at 80% 60%, rgba(255,70,85,.06), transparent 45%);
}
.page-hero .container { position: relative; z-index: 2; }
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: .82rem; color: var(--text-muted); margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-muted); transition: color .2s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span:last-child { color: var(--text); }
.page-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 20px;
}
.page-title .accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.page-lead {
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
  max-width: 680px;
  margin-bottom: 28px;
}
.page-lead strong { color: var(--text); }
.page-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.page-guarantee {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .88rem; color: var(--text-muted);
}
.page-guarantee svg { width: 22px; height: 22px; color: var(--success); flex-shrink: 0; }
.page-guarantee strong { color: var(--text); }

/* TESTER SHELL */
.tester-section { padding-top: 40px; }
.tester-shell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.tester-status {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.tester-status.active { border-color: var(--success); }
.tester-status.active .tester-status-icon { background: rgba(74,222,128,.15); color: var(--success); }
.tester-status-icon {
  flex-shrink: 0; width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(0,168,255,.12);
  color: var(--accent);
  display: grid; place-items: center;
}
.tester-status-icon svg { width: 24px; height: 24px; }
.tester-status strong { display: block; font-size: .95rem; }
.tester-status span { display: block; color: var(--text-muted); font-size: .82rem; }

/* ============================================
   GAMEPAD VISUALE (DualSense SVG)
   ============================================ */

.gamepad-visual-wrap {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px 16px 16px;
  margin-bottom: 20px;
  animation: fadeInUp .4s ease;
  overflow: hidden;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.gamepad-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 8px;
}
.gamepad-header h3 {
  font-size: 1rem;
  color: var(--accent);
}
.gamepad-header .gamepad-id {
  font-size: .72rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  word-break: break-all;
  max-width: 100%;
}

.gamepad-stage {
  display: grid;
  place-items: center;
  padding: 8px 0 16px;
}
.gamepad-svg {
  width: 100%;
  max-width: 640px;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,.4));
}

/* Corpo del controller */
.gp-body {
  fill: #1A2235;
  stroke: #2A3450;
  stroke-width: 2;
  transition: fill .2s;
}

/* Pulsanti base (default) */
.gp-btn {
  fill: #0F1524;
  stroke: #2A3450;
  stroke-width: 1.5;
  transition: fill .08s, stroke .08s, filter .08s;
}
.gp-btn.pressed {
  fill: var(--accent);
  stroke: #fff;
  filter: drop-shadow(0 0 8px var(--accent));
}
/* Variante colori specifici per i tasti simbolo */
.gp-btn-cross.pressed  { fill: #4DA3FF; }
.gp-btn-circle.pressed { fill: #FF4655; }
.gp-btn-square.pressed { fill: #FF6FB5; }
.gp-btn-triangle.pressed { fill: #4ADE80; }
.gp-btn-cross.pressed,
.gp-btn-circle.pressed,
.gp-btn-square.pressed,
.gp-btn-triangle.pressed { stroke: #fff; }

/* ============================================
   TESTI SVG — dimensioni fisse per evitare simboli giganti
   ============================================ */

/* Testi dentro i pulsanti (simboli ? ? ? ?) */
.gp-btn-label {
  font-family: 'Space Grotesk', 'Segoe UI Symbol', sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  fill: #8B95A8;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
  transition: fill .08s;
}
.gp-btn-cross + .gp-btn-label     { fill: #4DA3FF; }
.gp-btn-circle + .gp-btn-label    { fill: #FF4655; }
.gp-btn-square + .gp-btn-label    { fill: #FF6FB5; }
.gp-btn-triangle + .gp-btn-label  { fill: #4ADE80; }
.gp-btn.pressed + .gp-btn-label   { fill: #fff; }

/* Etichette piccole (L1, R1, L2, R2, SHARE, OPT, TOUCHPAD) */
.gp-label {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
  fill: #8B95A8;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  transition: fill .08s;
}
.gp-label.pressed { fill: #fff; }

/* Icona PS */
.gp-ps-icon {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 10px;
  line-height: 1;
  fill: #8B95A8;
  pointer-events: none;
  transition: fill .08s;
}
.gp-ps.pressed + .gp-ps-icon { fill: #fff; }

/* Icone D-Pad (frecce) */
.gp-dpad-icon {
  fill: #4A5570;
  pointer-events: none;
  transition: fill .08s;
}
.gp-dpad.pressed + .gp-dpad-icon { fill: #fff; }

/* Trigger/bumper */
.gp-bumper {
  fill: #0F1524;
  stroke: #2A3450;
  stroke-width: 1.5;
  transition: fill .08s, stroke .08s, filter .08s;
}
.gp-bumper.pressed {
  fill: var(--accent);
  stroke: #fff;
  filter: drop-shadow(0 0 8px var(--accent));
}

/* D-Pad */
.gp-dpad {
  fill: #0F1524;
  stroke: #2A3450;
  stroke-width: 1.5;
  transition: fill .08s, stroke .08s, filter .08s;
}
.gp-dpad.pressed {
  fill: var(--accent);
  stroke: #fff;
  filter: drop-shadow(0 0 6px var(--accent));
}

/* Touchpad */
.gp-touchpad {
  fill: #0F1524;
  stroke: #2A3450;
  stroke-width: 1.5;
  transition: fill .08s, stroke .08s, filter .08s;
}
.gp-touchpad.pressed {
  fill: var(--accent);
  stroke: #fff;
  filter: drop-shadow(0 0 6px var(--accent));
}

/* Pulsante PS */
.gp-ps {
  fill: #0F1524;
  stroke: #2A3450;
  stroke-width: 1.5;
  transition: fill .08s, stroke .08s, filter .08s;
}
.gp-ps.pressed {
  fill: var(--accent);
  stroke: #fff;
  filter: drop-shadow(0 0 8px var(--accent));
}

/* Stick analogici */
.gp-stick-base {
  fill: #0F1524;
  stroke: #2A3450;
  stroke-width: 1.5;
}
.gp-stick-ring {
  fill: none;
  stroke: #232B3D;
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.gp-stick-cap {
  fill: #2A3450;
  stroke: #4A5570;
  stroke-width: 1.5;
  transition: fill .1s;
}
.gp-stick-cap.clicked {
  fill: var(--accent);
  stroke: #fff;
}
.gp-stick-dot {
  fill: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent));
}

/* Info circolarità sotto al controller */
.gamepad-circ-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  padding: 0 8px;
}
.circ-item {
  background: #0d1b2a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .8rem;
}
.circ-item .circ-label {
  display: block;
  color: var(--text-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}
.circ-item .circ-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
  color: var(--text);
}
.circ-item.warn .circ-value { color: var(--warning); }
.circ-item.ok .circ-value { color: var(--success); }
.circ-item.bad .circ-value { color: #EF4444; }

/* ============================================
   DEBUG TABLE
   ============================================ */
.debug-toggle {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .82rem;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  font-family: inherit;
}
.debug-toggle:hover { border-color: var(--accent); color: var(--accent); }

.debug-panel {
  display: none;
  margin-top: 16px;
  padding: 16px;
  background: #0d1b2a;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--text-muted);
  max-height: 320px;
  overflow: auto;
}
.debug-panel.open { display: block; }
.debug-panel .debug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 16px;
}
.debug-panel .debug-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.debug-panel .debug-row .debug-val {
  color: var(--text);
}
.debug-panel .debug-row.pressed .debug-val { color: var(--accent); }

/* ============================================
   GUIDA RAPIDA
   ============================================ */
.tester-help {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.help-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.help-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,168,255,.15);
  color: var(--accent);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: .82rem;
  font-family: 'Space Grotesk', sans-serif;
}
.help-step strong { display: block; font-size: .88rem; margin-bottom: 2px; }
.help-step span { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }

/* DRIFT HELP */
.drift-help {
  display: grid;
  gap: 24px;
  margin-top: 24px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(0,168,255,.08), rgba(255,70,85,.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.drift-help-content h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.drift-help-content p {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 16px;
}
.drift-help-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 0;
}
.drift-help-content li {
  font-size: .88rem;
  color: var(--text-muted);
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
}
.drift-help-content li::before {
  content: '?';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.drift-help-content li strong { color: var(--text); }
.drift-help-cta { display: flex; align-items: center; }

/* PROBLEMI RIPARATI */
.repairs-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
.repair-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all .25s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.repair-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.repair-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(0,168,255,.12);
  color: var(--accent);
  display: grid; place-items: center;
}
.repair-icon svg { width: 22px; height: 22px; }
.repair-card h3 { font-size: 1.05rem; }
.repair-card p { color: var(--text-muted); font-size: .88rem; flex-grow: 1; line-height: 1.55; }
.repair-card p strong { color: var(--text); }
.repair-price {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* BANNER GARANZIA */
.warranty-banner {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 28px;
  margin-top: 32px;
  background: linear-gradient(135deg, rgba(74,222,128,.1), rgba(0,168,255,.05));
  border: 1px solid rgba(74,222,128,.35);
  border-radius: var(--radius);
}
.warranty-icon {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 12px;
  background: rgba(74,222,128,.15);
  color: var(--success);
  display: grid; place-items: center;
}
.warranty-icon svg { width: 28px; height: 28px; }
.warranty-banner h3 { font-size: 1.15rem; margin-bottom: 8px; }
.warranty-banner p { color: var(--text-muted); font-size: .92rem; line-height: 1.55; }

/* STEP */
.steps-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
}
.step-num {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: grid; place-items: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0,168,255,.3);
}
.step-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.step-card p { color: var(--text-muted); font-size: .9rem; line-height: 1.55; }

/* RESPONSIVE */
@media (min-width: 640px) {
  .tester-help { grid-template-columns: repeat(3, 1fr); }
  .repairs-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
  .tester-shell { padding: 32px; }
}
@media (min-width: 900px) {
  .repairs-grid { grid-template-columns: repeat(3, 1fr); }
  .drift-help { grid-template-columns: 1.4fr 1fr; align-items: center; }
}/* CSS Document */