/* ==========================================================================
   Tesla Design System - Adapted for H.É.C.A.T.E. Project
   ========================================================================== */

:root {
  --tesla-black: #111111;
  --tesla-grey-bg: #f4f4f4;
  --tesla-card-bg: #ffffff;
  --tesla-blue: #3e6ae1;
  --tesla-blue-hover: #3458b9;
  --tesla-dark-btn: #171a20;
  --tesla-light-btn: rgba(244, 244, 244, 0.8);
  --tesla-text: #393c41;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  color: var(--tesla-text);
  background-color: #ffffff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header Navbar estilo Tesla */
.tesla-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.header-logo a {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 2px;
  color: var(--tesla-black);
  text-decoration: none;
}

.header-nav {
  display: flex;
  gap: 24px;
}

.header-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--tesla-text);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.header-nav a:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.header-right {
  display: flex;
  gap: 12px;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--tesla-text);
}

.icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Mobile Drawer (Menu Desplegable estilo Tesla) */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 200;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100%;
  background: #ffffff;
  z-index: 201;
  padding: 32px 24px;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-overlay.active {
  display: block;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  float: right;
  color: var(--tesla-text);
}

.menu-content {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 600;
  color: var(--tesla-black);
  text-decoration: none;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

/* ==========================================================================
   Hero Section - Estilo Tesla con Imagen de Fondo
   ========================================================================== */

.tesla-hero-section {
  position: relative;
  width: 100%;
  height: 100vh; /* Ocupa toda la altura de la pantalla */
  padding-top: 80px;
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;

  /* Aquí cargamos la imagen de tu barco de fondo */
  background: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.35)), url('../img/barco-hero.jpg') no-repeat center center;
  background-size: cover;
}

.hero-content {
  margin-top: 40px;
  z-index: 2;
}

.tesla-hero-section .hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.tesla-hero-section .hero-subtitle {
  font-size: 1.15rem;
  font-weight: 400;
  color: #f0f0f0;
  margin-top: 8px;
  max-width: 700px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.hero-bottom-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  z-index: 2;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Botones estilo Tesla */
.btn {
  padding: 10px 40px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--tesla-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--tesla-blue-hover);
}

.btn-secondary {
  background-color: var(--tesla-light-btn);
  color: var(--tesla-black);
}

.btn-dark {
  background-color: var(--tesla-dark-btn);
  color: #ffffff;
}

.btn-light {
  background-color: #ffffff;
  color: var(--tesla-black);
  border: 1px solid #e0e0e0;
}

.hero-image-placeholder {
  width: 100%;
  max-width: 1100px;
  height: 400px;
  margin-top: 40px;
  background: linear-gradient(180deg, #e3e8ee 0%, #cbd5e1 100%);
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 20px;
}

.ship-badge {
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tesla-black);
}

/* Section Blocks */
.tesla-section-block {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 24px;
}

.tesla-card {
  background-color: var(--tesla-grey-bg);
  border-radius: 16px;
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.card-title-blue {
  font-size: 2rem;
  font-weight: 700;
  color: var(--tesla-black);
  line-height: 1.2;
}

.card-title-blue span {
  color: var(--tesla-blue);
}

.card-desc {
  margin-top: 12px;
  font-size: 1rem;
  color: var(--tesla-text);
}

.metrics-grid {
  display: flex;
  gap: 32px;
  margin: 32px 0;
}

.metric-val {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--tesla-black);
}

.metric-lbl {
  font-size: 0.8rem;
  color: #666;
}

.card-actions {
  display: flex;
  gap: 12px;
}

/* Simulador HUD Visual en Card */
.camera-simulation-hud {
  background-color: #0b131e;
  border-radius: 12px;
  height: 280px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  color: #00f2fe;
  font-family: monospace;
}

.rec-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: red;
  border-radius: 50%;
  margin-right: 6px;
}

.ai-box {
  width: 140px;
  height: 100px;
  border: 2px solid #00e676;
  margin: 0 auto;
  position: relative;
}

.ai-label {
  position: absolute;
  top: -20px;
  left: 0;
  background: #00e676;
  color: #000;
  font-size: 0.75rem;
  padding: 2px 4px;
  font-weight: bold;
}

/* ==========================================================================
   Grid Cards con Imágenes de Fondo (Estilo Tesla Cards)
   ========================================================================== */

.tesla-grid-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.grid-card {
  height: 420px;
  border-radius: 16px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Tarjeta 1: Imagen de Fondo para Brazo Robótico */
.card-brazo {
  background: linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.6)), url('../img/brazo-robotico.jpg') no-repeat center center;
  background-size: cover;
  color: #ffffff; /* Textos blancos para resaltar sobre la foto */
}

.card-brazo h3, .card-brazo p {
  color: #ffffff;
}

/* Tarjeta 2: Imagen de Fondo para Estación Solar */
.card-estacion {
  background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.65)), url('../img/estacion-solar.jpg') no-repeat center center;
  background-size: cover;
  color: #ffffff;
}

.grid-card-content {
  position: relative;
  z-index: 2;
}

.grid-card h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.grid-card p {
  font-size: 0.95rem;
  margin-bottom: 24px;
  max-width: 90%;
  color: #e0e0e0;
}

.grid-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Ajuste responsive para pantallas pequeñas (se apilan en 1 sola columna) */
@media (max-width: 768px) {
  .tesla-grid-section {
    grid-template-columns: 1fr;
  }
}
/* Telemetry Grid */
.section-heading {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--tesla-black);
}

.section-subheading {
  color: #666;
  margin-bottom: 32px;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.telemetry-card {
  background-color: var(--tesla-grey-bg);
  border-radius: 12px;
  padding: 24px;
}

.telemetry-card h4 {
  font-size: 0.9rem;
  color: #666;

}

.tel-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--tesla-black);
  margin: 8px 0;
}

.tel-status {
  font-size: 0.8rem;
  color: #666;
}

.status-good {
  color: #0d8a00;
  font-weight: 600;
}

/* Footer */
.tesla-footer {
  padding: 40px 24px;
  text-align: center;
  font-size: 0.8rem;
  color: #707070;
  border-top: 1px solid #eeeeee;
  margin-top: 80px;
}

.footer-links {
  margin-top: 12px;
  display: flex;
  gap: 20px;
  justify-content: center;
}

.footer-links a {
  color: #707070;
  text-decoration: none;
}

/* Responsividad para móviles (igual al comportamiento de Tesla mobile) */
@media (max-width: 768px) {
  .header-nav {
    display: none;
  }
  .tesla-card {
    grid-template-columns: 1fr;
    padding: 28px;
  }
  .tesla-grid-section {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Tesla Region & Language Selector Modal
   ========================================================================== */

.lang-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  z-index: 300;
}

.lang-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 900px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  padding: 40px;
  z-index: 301;
  max-height: 85vh;
  overflow-y: auto;
}

.lang-modal-overlay.active,
.lang-modal.active {
  display: block;
}

.lang-modal-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.lang-modal-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
}

.lang-region-col h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--tesla-black);
  margin-bottom: 20px;
}

.lang-country-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.lang-country-group strong {
  font-size: 0.95rem;
  color: var(--tesla-black);
  font-weight: 600;
}

.lang-select-option {
  display: inline-block;
  font-size: 0.85rem;
  color: #5c5e62;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  width: max-content;
  margin-top: 2px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-select-option:hover {
  background-color: #f4f4f4;
  color: var(--tesla-black);
}

.lang-select-option.active {
  background-color: #eee;
  font-weight: 600;
  color: var(--tesla-black);
}

/* ==========================================================================
   Sección Red M2M / Estilo Mapa de Carga Tesla
   ========================================================================== */

.tesla-map-card {
  background-color: var(--tesla-grey-bg);
  border-radius: 16px;
  padding: 40px;
  margin-top: 40px;
}

.map-text-content {
  margin-bottom: 28px;
}

.map-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.stat-card {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  border: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.stat-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-indicator {
  width: 10px;
  height: 10px;
  background-color: #0d8a00;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(13, 138, 0, 0.5);
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--tesla-black);
  margin-bottom: 4px;
}

.stat-desc {
  font-size: 0.85rem;
  color: #5c5e62;
}