/* AutoMantPro — HUD Futurista v2.0 */

:root {
  --bg: #030712;
  --bg2: #0a0f1f;
  --glass: rgba(6, 14, 30, 0.7);
  --glass2: rgba(10, 20, 45, 0.6);
  --border: rgba(0, 229, 255, 0.12);
  --border2: rgba(0, 229, 255, 0.25);
  --text: #e0f2ff;
  --muted: #4a6a8a;
  --cyan: #00e5ff;
  --blue: #3b82f6;
  --purple: #a855f7;
  --green: #00ff88;
  --red: #ff3366;
  --orange: #ff9500;
  --r: 16px;
  --glow-c: 0 0 20px rgba(0, 229, 255, 0.25);
  --glow-g: 0 0 20px rgba(0, 255, 136, 0.25);
  --glow-r: 0 0 20px rgba(255, 51, 102, 0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; font-family: "Inter", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

/* ===== GRID DE FONDO ===== */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background:
    linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 800px 500px at 20% -5%, rgba(0,229,255,0.08), transparent),
    radial-gradient(ellipse 700px 500px at 85% 10%, rgba(168,85,247,0.06), transparent),
    radial-gradient(ellipse 500px 400px at 50% 80%, rgba(0,255,136,0.03), transparent);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== HEADER ===== */
.amp-header {
  background: rgba(3,7,18,0.88); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
}
.amp-header-inner { max-width: 1280px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 16px rgba(0,229,255,0.4), 0 0 0 3px rgba(0,229,255,0.1);
  animation: pulseDot 3s ease-in-out infinite;
}
@keyframes pulseDot { 0%,100% { box-shadow: 0 0 16px rgba(0,229,255,0.4), 0 0 0 3px rgba(0,229,255,0.1); } 50% { box-shadow: 0 0 24px rgba(0,229,255,0.6), 0 0 0 6px rgba(0,229,255,0.15); } }
.brand-name span { color: var(--cyan); }
.amp-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.amp-nav a, .amp-nav-user { padding: 8px 14px; border-radius: 10px; color: var(--text); font-size: .92rem; font-weight: 500; }
.amp-nav a:hover { background: rgba(0,229,255,0.08); text-decoration: none; }
.amp-nav-user { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.amp-burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.amp-burger span { width: 22px; height: 2px; background: var(--cyan); border-radius: 2px; transition: .2s; }
@media (max-width: 760px) { .amp-burger { display: flex; } .amp-nav { display: none; flex-direction: column; align-items: stretch; width: 100%; padding: 8px 0 14px; } .amp-nav.open { display: flex; } .amp-header-inner { flex-wrap: wrap; } }

/* ===== MAIN / FOOTER ===== */
.amp-main { max-width: 1280px; margin: 0 auto; padding: 20px 20px 60px; }
.amp-panel { max-width: 1200px; margin: 0 auto; }
.amp-footer { border-top: 1px solid var(--border); background: rgba(3,7,18,0.9); padding: 30px 20px 16px; }
.amp-footer-grid { max-width: 1280px; margin: 0 auto 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.amp-footer h4 { margin: 0 0 10px; font-size: .95rem; }
.amp-footer a { display: block; padding: 3px 0; color: var(--muted); font-size: .92rem; }
.amp-footer a:hover { color: var(--cyan); text-decoration: none; }
.amp-footer-legal { text-align: center; color: var(--muted); font-size: .82rem; margin: 0; }

/* ===== GLASS ===== */
.glass { background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--r); transition: border-color .2s, box-shadow .2s; }
.glass:hover { border-color: var(--border2); box-shadow: var(--glow-c); }
.glass h2, .glass h3 { display: flex; align-items: center; gap: 10px; }

/* ===== HERO ===== */
.hero { text-align: center; padding: 50px 0 36px; max-width: 860px; margin: 0 auto; }
.hero-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: rgba(0,255,136,0.08); color: var(--green); border: 1px solid rgba(0,255,136,0.3); animation: pulsePill 3s ease-in-out infinite; }
@keyframes pulsePill { 0%,100% { box-shadow: 0 0 0 0 rgba(0,255,136,0.15); } 50% { box-shadow: 0 0 0 6px rgba(0,255,136,0); } }
.hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.12; margin: 16px 0 14px; letter-spacing: -0.025em; }
.grad { background: linear-gradient(92deg, var(--cyan), var(--blue) 50%, var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 620px; margin: 0 auto 24px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== BUTTONS ===== */
.amp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #030712; border: 0; border-radius: 10px; padding: 10px 20px; font-size: .93rem; cursor: pointer; font-weight: 700; box-shadow: 0 0 16px rgba(0,229,255,0.25); transition: transform .14s, box-shadow .14s; }
.amp-btn:hover { transform: translateY(-1px); box-shadow: 0 0 28px rgba(0,229,255,0.4); text-decoration: none; color: #030712; }
.amp-btn:active { transform: translateY(0); }
.amp-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.amp-btn.ghost { background: transparent; color: var(--cyan); border: 1px solid rgba(0,229,255,0.3); box-shadow: none; }
.amp-btn.ghost:hover { background: rgba(0,229,255,0.08); border-color: var(--cyan); }
.amp-btn.solid-green { background: linear-gradient(135deg, var(--green), #00cc6a); box-shadow: 0 0 16px rgba(0,255,136,0.25); }
.amp-btn.solid-green:hover { box-shadow: 0 0 28px rgba(0,255,136,0.4); color: #030712; }
.amp-btn.big { padding: 13px 28px; font-size: 1rem; }
.amp-btn.block { display: flex; width: 100%; }
.amp-btn.danger { background: linear-gradient(135deg, var(--red), #cc2255); box-shadow: 0 0 16px rgba(255,51,102,0.25); }
.amp-btn.success { background: linear-gradient(135deg, var(--green), #00cc6a); box-shadow: 0 0 16px rgba(0,255,136,0.25); }

/* ===== SECTIONS / TABS ===== */
.amp-section { scroll-margin-top: 80px; margin: 28px 0; }
.amp-section h2 { font-size: 1.4rem; margin: 0 0 14px; }
.amp-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 8px; }
.amp-tabs a { padding: 9px 16px; border-radius: 999px; color: var(--muted); background: var(--glass); border: 1px solid var(--border); font-weight: 600; font-size: .9rem; transition: .15s; }
.amp-tabs a:hover { color: var(--cyan); border-color: var(--border2); text-decoration: none; }
.amp-tabs a.amp-active { background: linear-gradient(135deg, var(--cyan), var(--blue)); border-color: transparent; color: #030712; box-shadow: 0 0 20px rgba(0,229,255,0.3); }

/* ===== FORMS ===== */
.amp-form label { display: block; font-size: .83rem; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
.amp-form input, .amp-form select, .amp-form textarea { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); background: rgba(3,7,18,0.7); color: var(--text); font-size: .95rem; font-family: inherit; transition: border-color .15s, box-shadow .15s; }
.amp-form input::placeholder { color: #3a5a7a; }
.amp-form input:focus, .amp-form textarea:focus, .amp-form select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,229,255,0.15); }
.amp-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.amp-row > * { flex: 1 1 150px; }
.amp-inline { display: inline-flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ===== AUTH ===== */
.amp-auth { max-width: 460px; margin: 30px auto; }
.amp-auth .amp-auth-card { background: var(--glass); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 18px; padding: 30px 28px; box-shadow: 0 0 40px rgba(0,229,255,0.06); }
.amp-auth h1 { text-align: center; margin: 0 0 6px; font-size: 1.5rem; }
.amp-auth .amp-auth-sub { text-align: center; color: var(--muted); margin: 0 0 10px; font-size: .95rem; }
.role-picker { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 16px 0 8px; }

/* ===== BADGES ===== */
.amp-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.amp-badge.success { background: rgba(0,255,136,0.1); color: var(--green); border: 1px solid rgba(0,255,136,0.35); }
.amp-badge.warn { background: rgba(255,149,0,0.1); color: var(--orange); border: 1px solid rgba(255,149,0,0.35); }
.amp-badge.error { background: rgba(255,51,102,0.1); color: var(--red); border: 1px solid rgba(255,51,102,0.35); }
.amp-badge.info { background: rgba(0,229,255,0.1); color: var(--cyan); border: 1px solid rgba(0,229,255,0.35); }

/* ===== FLASH ===== */
.amp-flash { padding: 11px 15px; border-radius: 10px; margin: 10px 0; border: 1px solid; font-size: .93rem; animation: ampFade .25s ease; }
@keyframes ampFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.amp-flash.success { background: rgba(0,255,136,0.08); color: var(--green); border-color: rgba(0,255,136,0.3); }
.amp-flash.error { background: rgba(255,51,102,0.08); color: var(--red); border-color: rgba(255,51,102,0.3); }

/* ===== TABLES ===== */
.amp-meta { color: var(--muted); font-size: .9rem; }
.amp-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.amp-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.amp-table th, .amp-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.amp-table th { color: var(--muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; background: rgba(0,229,255,0.03); }
.amp-table tr:last-child td { border-bottom: 0; }
.amp-table tbody tr:hover td { background: rgba(0,229,255,0.04); }

/* ===== CHAT ===== */
.chat-box { background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; max-width: 720px; box-shadow: 0 0 30px rgba(0,229,255,0.06); }
.chat-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(0,229,255,0.03); font-weight: 700; }
.chat-top .chat-bot-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(0,255,136,0.5); animation: pulseDot 3s ease-in-out infinite; }
.chat-log { padding: 16px; max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; font-size: .92rem; line-height: 1.5; }
.chat-msg.bot { background: rgba(0,229,255,0.06); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.user { background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #030712; align-self: flex-end; border-bottom-right-radius: 4px; font-weight: 600; }
.chat-msg.error { background: rgba(255,51,102,0.08); color: var(--red); align-self: flex-start; border: 1px solid rgba(255,51,102,0.3); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-form input { flex: 1; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); background: rgba(3,7,18,0.7); color: var(--text); font-size: .95rem; }
.chat-form input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,229,255,0.15); }

/* ===================================================================
   HUD FUTURISTA — Vehículo central + componentes alrededor
   =================================================================== */

.hud { display: grid; grid-template-columns: 1fr 300px; gap: 20px; margin: 20px 0; }
@media (max-width: 900px) { .hud { grid-template-columns: 1fr; } }

/* Stats bar superior */
.hud-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; grid-column: 1 / -1; }
.hud-stats.block { grid-column: auto; }
@media (max-width: 700px) { .hud-stats { grid-template-columns: repeat(2, 1fr); } }
.hud-stat {
  background: var(--glass); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; text-align: center; position: relative; overflow: hidden;
}
.hud-stat::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); }
.hud-stat strong { display: block; font-size: 1.6rem; font-weight: 800; }
.hud-stat .label { color: var(--muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.hud-stat.cyan strong { color: var(--cyan); }
.hud-stat.green strong { color: var(--green); }
.hud-stat.purple strong { color: var(--purple); }
.hud-stat.orange strong { color: var(--orange); }

/* Main HUD area */
.hud-main { display: flex; flex-direction: column; gap: 20px; }

/* ===== VEHÍCULO CENTRAL (HUD holográfico) ===== */
.vehicle-hub {
  position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 30px 20px; min-height: 420px;
  background: var(--glass); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 20px; overflow: hidden;
}
.vehicle-hub::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,229,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.vehicle-hub::after {
  content: ""; position: absolute; top: -1px; left: 15%; right: 15%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}
.vehicle-hub .scan-line {
  position: absolute; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,0.4), transparent);
  animation: scanDown 4s linear infinite;
  pointer-events: none;
}
@keyframes scanDown { 0% { top: -2px; } 100% { top: 100%; } }

.vehicle-hologram { max-width: 380px; width: 100%; margin: 0 auto; filter: drop-shadow(0 0 20px rgba(0,229,255,0.3)); }
.vehicle-hologram img { width: 100%; height: auto; }

.vehicle-info { text-align: center; z-index: 1; margin-bottom: 8px; }
.vehicle-name { font-size: 1.4rem; font-weight: 800; margin: 8px 0 4px; letter-spacing: -0.01em; }
.vehicle-plate { color: var(--cyan); font-size: .95rem; font-weight: 700; letter-spacing: .12em; font-family: "Fira Code", "SF Mono", monospace; }
.vehicle-meta { color: var(--muted); font-size: .88rem; margin-top: 4px; }
.vehicle-badge { margin-top: 8px; }

/* ===== COMPONENT RINGS ===== */
.component-rings {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  width: 100%; max-width: 600px; margin-top: 20px; z-index: 1;
}
@media (max-width: 650px) { .component-rings { grid-template-columns: repeat(3, 1fr); } }

.ring-card {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 14px 6px; border-radius: 14px;
  background: rgba(0,0,0,0.35); border: 1px solid var(--border);
  transition: .25s; cursor: default; position: relative;
}
.ring-card:hover { border-color: var(--border2); box-shadow: var(--glow-c); transform: translateY(-3px); }
.ring-card::before {
  content: ""; position: absolute; top: -1px; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0; transition: .25s;
}
.ring-card:hover::before { opacity: 1; }

.ring-svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(0,229,255,0.08); stroke-width: 4; }
.ring-progress { fill: none; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1.2s ease; }
.ring-progress.green { stroke: var(--green); filter: drop-shadow(0 0 6px rgba(0,255,136,0.6)); }
.ring-progress.warn { stroke: var(--orange); filter: drop-shadow(0 0 6px rgba(255,149,0,0.6)); }
.ring-progress.red { stroke: var(--red); filter: drop-shadow(0 0 6px rgba(255,51,102,0.6)); }

.ring-icon { font-size: 1.1rem; }
.ring-label { font-size: .68rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: center; }
.ring-pct { font-size: .88rem; font-weight: 800; }
.ring-pct.green { color: var(--green); }
.ring-pct.warn { color: var(--orange); }
.ring-pct.red { color: var(--red); }

/* ===== ACCIONES RÁPIDAS ===== */
.hud-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 600px) { .hud-actions { grid-template-columns: repeat(2, 1fr); } }
.action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px; border-radius: 14px; cursor: pointer; text-decoration: none;
  background: var(--glass); backdrop-filter: blur(12px);
  border: 1px solid var(--border); color: var(--text);
  transition: .2s; font-size: .82rem; font-weight: 600;
}
.action-btn:hover { border-color: var(--cyan); box-shadow: var(--glow-c); transform: translateY(-2px); text-decoration: none; color: var(--text); }
.action-btn .action-icon { font-size: 1.6rem; }
.action-btn.green:hover { border-color: var(--green); box-shadow: var(--glow-g); }
.action-btn.purple:hover { border-color: var(--purple); box-shadow: 0 0 20px rgba(168,85,247,0.25); }

/* ===== SIDEBAR ===== */
.hud-side { display: flex; flex-direction: column; gap: 16px; }
.side-card {
  background: var(--glass); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 14px; padding: 16px;
}
.side-card h3 { margin: 0 0 12px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.side-card h3 .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.side-card h3 .dot.green { background: var(--green); box-shadow: 0 0 6px rgba(0,255,136,0.5); }
.side-card h3 .dot.orange { background: var(--orange); box-shadow: 0 0 6px rgba(255,149,0,0.5); }
.side-card h3 .dot.red { background: var(--red); box-shadow: 0 0 6px rgba(255,51,102,0.5); }

/* Alert items */
.alert-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.alert-item:last-child { border-bottom: 0; }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.alert-dot.urgent { background: var(--red); box-shadow: 0 0 8px rgba(255,51,102,0.6); animation: pulseAlert 1.5s ease-in-out infinite; }
.alert-dot.warn { background: var(--orange); box-shadow: 0 0 6px rgba(255,149,0,0.5); }
@keyframes pulseAlert { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* History items */
.history-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.history-item:last-child { border-bottom: 0; }
.history-icon { font-size: 1.2rem; flex-shrink: 0; }

/* ===== UTILS ===== */
.center { text-align: center; }
code { background: rgba(0,229,255,0.08); padding: 2px 7px; border-radius: 6px; font-size: .85em; color: var(--cyan); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }