/* =========================================
   ELECTRÓNICA PRÁCTICA - Estilos Globales
   Autor: Ing. Henry Castro
   Paleta: Azul tecnológico educativo (OFICIAL)
   Archivo: assets/css/styles.css
   Versión: 1.1 - Corregido y optimizado
========================================= */

/* ===============================
   1. VARIABLES DE COLOR (OFICIAL)
================================ */
:root {
    --azul-principal: #0A1F44;
    --azul-secundario: #0D6EFD;
    --azul-acento: #00B4D8;
    --gris-fondo: #F4F6F9;
    --gris-texto: #333333;
    --gris-muted: #64748b;
    --blanco: #FFFFFF;
    --verde-ok: #28A745;
    --rojo-error: #DC3545;
    --gris-claro: #cccccc;
    
    /* UI Global */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 20px rgba(10,31,68,0.08);
    --shadow-lg: 0 15px 35px rgba(10,31,68,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.25s ease;
}

/* ===============================
   2. RESET Y BASE GLOBAL (¡AL INICIO!)
================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background: var(--gris-fondo);
    color: var(--gris-texto);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--azul-secundario);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--azul-acento);
    text-decoration: underline;
}

a:focus, button:focus {
    outline: 3px solid var(--azul-acento);
    outline-offset: 2px;
}

/* ===============================
   3. LAYOUT PRINCIPAL
================================ */
.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* ===============================
   4. HEADER / NAVEGACIÓN
================================ */
.main-header {
    background: var(--azul-principal);
    color: var(--blanco);
    padding: 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.logo-link {
    text-decoration: none;
}

.logo-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--blanco);
    margin: 0;
    letter-spacing: -0.3px;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-link {
    color: var(--blanco);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background: var(--azul-acento);
    color: var(--azul-principal);
    border-color: var(--azul-acento);
    text-decoration: none;
}

.nav-link:focus {
    outline: 2px solid var(--blanco);
    outline-offset: 2px;
}

@media (min-width: 640px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.85rem 1.5rem;
    }
    .logo-title { font-size: 1.5rem; }
    .main-nav { gap: 0.25rem; }
}

/* ===============================
   5. HERO / ENCABEZADO PRINCIPAL
================================ */
.hero-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--azul-principal);
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    text-align: center;
    color: var(--gris-muted);
    font-weight: 400;
    font-size: 1.15rem;
    margin-bottom: 2rem;
}

.intro-text {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
    color: var(--gris-muted);
    font-size: 1.05rem;
}

/* ===============================
   6. TARJETAS DE SECCIÓN
================================ */
.section-card {
    background: var(--blanco);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(10,31,68,0.05);
    transition: var(--transition);
}

.section-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.section-card h2 {
    color: var(--azul-principal);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gris-fondo);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===============================
   7. LISTAS DE ENLACES (Podcasts)
================================ */
.link-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.link-grid a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gris-fondo);
    color: var(--azul-secundario);
    border-radius: var(--radius-sm);
    font-weight: 500;
    border: 1px solid transparent;
}

.link-grid a:hover {
    background: var(--azul-secundario);
    color: var(--blanco);
    border-color: var(--azul-principal);
    transform: translateX(4px);
    text-decoration: none;
}

/* ===============================
   8. TARJETAS DE SIMULADORES
================================ */
.sim-card {
    background: linear-gradient(135deg, var(--gris-fondo) 0%, var(--blanco) 100%);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin: 1rem 0;
    border-left: 4px solid var(--azul-acento);
    border: 1px solid rgba(10,31,68,0.08);
}

.sim-card h3 {
    color: var(--azul-principal);
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
}

.sim-card p {
    color: var(--gris-muted);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.sim-card .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.3rem;
    background: var(--azul-secundario);
    color: var(--blanco);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid var(--azul-secundario);
}

.sim-card .btn:hover {
    background: var(--azul-principal);
    border-color: var(--azul-principal);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--blanco);
}

.audience-card {
    background: linear-gradient(135deg, #e6f0ff 0%, var(--gris-fondo) 100%);
    border-color: var(--azul-secundario);
}

/* ===============================
   9. FOOTER GLOBAL (ÚNICA DEFINICIÓN)
================================ */
.site-footer {
    background: var(--azul-principal);
    color: var(--blanco);
    padding: 2rem 1.5rem 1.5rem;
    margin-top: auto;
    font-size: 0.95rem;
}

.footer-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem 0.75rem;
}

.footer-link {
    color: var(--blanco);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.footer-link:hover {
    color: var(--azul-acento);
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

.footer-separator {
    color: var(--azul-acento);
    opacity: 0.7;
    user-select: none;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem 0.5rem;
    font-size: 0.9em;
    opacity: 0.9;
}

.legal-link {
    color: var(--blanco);
    text-decoration: none;
    transition: var(--transition);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.legal-link:hover {
    color: var(--azul-acento);
    text-decoration: underline;
}

.legal-separator {
    color: var(--azul-acento);
    opacity: 0.6;
    user-select: none;
}

.footer-copyright {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    opacity: 0.85;
    line-height: 1.5;
}

.ads-container {
    margin: 2rem auto;
    text-align: center;
    max-width: 900px;
    padding: 0 1rem;
    min-height: 90px;
}

@media (max-width: 640px) {
    .site-footer { padding: 1.5rem 1rem 1rem; font-size: 0.9rem; }
    .footer-links, .footer-legal { flex-direction: column; gap: 0.5rem; }
    .footer-separator, .legal-separator { display: none; }
}

.footer-link:focus, .legal-link:focus {
    outline: 2px solid var(--azul-acento);
    outline-offset: 2px;
}

/* ===============================
   10. PÁGINAS LEGALES
================================ */
.legal-page {
  max-width: 800px;
  margin: 2rem auto;
}

.legal-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--gris-fondo);
}

.legal-header h1 { margin-bottom: 0.5rem; }

.legal-updated {
  color: var(--gris-muted);
  font-size: 0.9rem;
  font-style: italic;
}

.legal-section {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gris-fondo);
}

.legal-section:last-child {
  border-bottom: none;
  margin-bottom: 1rem;
  padding-bottom: 0;
}

.legal-section h2 {
  color: var(--azul-principal);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-section p {
  color: var(--gris-texto);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.legal-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.legal-list li {
  background: var(--gris-fondo);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--azul-secundario);
  line-height: 1.6;
}

.legal-list li strong { color: var(--azul-principal); }
.legal-list a { color: var(--azul-secundario); text-decoration: none; }
.legal-list a:hover { text-decoration: underline; }

.legal-section .info-block {
  background: #eef6ff;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--azul-acento);
  margin: 1.5rem 0;
}

.legal-section .info-block h3 {
  color: var(--azul-principal);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.legal-section .info-block ul { padding-left: 1.25rem; margin: 0; }
.legal-section .info-block li {
  background: none;
  padding: 0.25rem 0;
  margin-bottom: 0.5rem;
  border: none;
}

.legal-nav {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--gris-fondo);
}

@media (max-width: 640px) {
  .legal-page { margin: 1rem auto; padding: 1rem; }
  .legal-section h2 { font-size: 1.2rem; }
  .legal-list li { padding: 0.75rem 1rem; }
}

/* ===============================
   11. BLOQUES INFORMATIVOS (GLOBAL)
================================ */
.info-block {
  background: #eef6ff;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--azul-acento);
  margin: 1.5rem 0;
}

.info-block h3 {
  color: var(--azul-principal);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.info-block.warning {
  background: #fef2f2;
  border-left-color: var(--rojo-error);
}

.info-block.warning h3 {
  color: var(--rojo-error);
}

.observaciones {
  background: #fff3cd;
  border-left: 5px solid #ffc107;
  padding: 15px;
  border-radius: 6px;
  font-size: 14px;
  margin-top: 25px;
}

/* ===============================
   12. ZONA SIMULADOR MULTÍMETRO
================================ */
.lcd {
    background: #0b0b0b;
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-size: 42px;
    text-align: center;
    padding: 20px;
    margin: 25px auto;
    width: 260px;
    border-radius: 6px;
    box-shadow: inset 0 0 12px #000;
    letter-spacing: 2px;
}

.sim-btn {
    padding: 12px 25px;
    margin: 10px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    background: var(--azul-secundario);
    color: var(--blanco);
    transition: var(--transition);
}

.sim-btn:hover { background: var(--azul-acento); }

ul.simulador {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

ul.simulador li {
    background: var(--blanco);
    padding: 15px;
    margin-bottom: 12px;
    border-left: 5px solid var(--azul-secundario);
    border-radius: 6px;
    transition: var(--transition);
}

ul.simulador li:hover {
    border-left-color: var(--azul-acento);
    transform: translateX(5px);
}

#resultado {
    margin-top: 15px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

.ok { color: var(--verde-ok); }
.bad { color: var(--rojo-error); }

/* ===============================
   13. ANIMACIONES Y UTILIDADES
================================ */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-card {
  animation: slideUp 0.4s ease forwards;
}

.section-card:nth-of-type(1) { animation-delay: 0.1s; }
.section-card:nth-of-type(2) { animation-delay: 0.2s; }
.section-card:nth-of-type(3) { animation-delay: 0.3s; }
.section-card:nth-of-type(4) { animation-delay: 0.4s; }

/* Responsive global */
@media (max-width: 640px) {
    .site-content { padding: 1.5rem 1rem; }
    .hero-title { font-size: 1.9rem; }
    .link-grid { grid-template-columns: 1fr; }
    .section-card { padding: 1.5rem; }
}
/* =========================================
   CORRECCIONES MÓVIL ANDROID - Header Azul
   Autor: Ing. Henry Castro
   Fecha: 2026
========================================= */

@media (max-width: 768px) {
  
  /* ===== HEADER: Forzar color azul en Android ===== */
  .main-header,
  header.main-header,
  .main-header .header-container {
    background: #0A1F44 !important;
    background: linear-gradient(135deg, #0A1F44 0%, #1a3a6c 100%) !important;
  }
  
  /* ===== TEXTO: Forzar blanco en header móvil ===== */
  .main-header .logo-title,
  .main-header .logo-link,
  .main-header .nav-link,
  .main-header a,
  .main-header .nav-link:hover,
  .main-header .nav-link.active {
    color: #ffffff !important;
  }
  
  /* ===== MENÚ: Scroll horizontal si no cabe ===== */
  .main-nav {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
    padding-bottom: 0.25rem !important;
    gap: 0.25rem !important;
  }
  
  /* ===== HEADER STICKY: Que se mantenga arriba ===== */
  .main-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    width: 100% !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
  }
  
  /* ===== LAYOUT: Permitir scroll normal en móvil ===== */
  body {
    height: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  
  .site-wrapper {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
  }
  
  .site-content {
    flex: 1 !important;
    padding: 1rem !important;
  }
  
  /* ===== BOTONES: Más grandes para toque fácil ===== */
  .btn,
  .nav-link,
  .footer-link,
  .legal-link {
    min-height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* ===== TARJETAS: Ajuste para móvil ===== */
  .sim-card,
  .section-card {
    padding: 1rem !important;
    margin: 0.75rem 0 !important;
  }
  
  /* ===== LINKS PODCAST: Más compactos en móvil ===== */
  .link-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  
  .link-grid a {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.85rem !important;
  }
}

/* ===== CORRECCIÓN ESPECÍFICA PARA CHROME ANDROID ===== */
@supports (-webkit-touch-callout: none) {
  .main-header {
    background: #0A1F44 !important;
  }
}
/* ===== CORRECCIÓN ESPECÍFICA ANDROID CHROME ===== */
@supports (-webkit-touch-callout: none) {
  .main-header {
    background: #0A1F44 !important;
    position: fixed !important;
    width: 100% !important;
  }
  
  .site-content {
    padding-top: 80px !important; /* Espacio para header fijo */
  }
}

/* ===== PREVENIR ZOOM ACCIDENTAL EN ANDROID ===== */
@media (max-width: 768px) {
  input, select, textarea, button {
    font-size: 16px !important; /* Evita zoom al hacer tap */
  }
  
  * {
    -webkit-tap-highlight-color: transparent;
  }
}