/* ========================================================= */
/* === AJUSTES GLOBALES Y REINICIO BÁSICO === */
/* ========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== VARIABLES UNIFICADAS ===== */
:root {
  /* Tema claro (default) */
  --bg-primary: #f5f7fa;
  --bg-secondary: #c3cfe2;
  --bg-content: #ffffff;
  --bg-content-alt: #f8f9fa;
  --text-primary: #2c3e50;
  --text-secondary: #34495e;
  --text-muted: #7f8c8d;
  --accent-primary: #1abc9c;
  --accent-secondary: #3498db;
  --border-color: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.1);
  --nav-bg: rgba(23, 43, 117, 0.85); /* #172B75 - Azul oscuro elegante */
  --footer-bg: #2c3e50;
  
  /* Variables para tarjetas (modo claro) */
  --card-bg: #ffffff;
  --card-border: #e1e5e9;
  --card-shadow: rgba(0, 0, 0, 0.08);
  --card-hover-shadow: rgba(0, 0, 0, 0.12);
  --stat-bg: #e9ecef;
  --stat-color: #495057;
  --visual-bg: linear-gradient(135deg, #f8f9fa, #e9ecef);
  --visual-hover-bg: linear-gradient(135deg, #e3f2fd, #bbdefb);
  
  /* Colores específicos para modo claro */
  --feature-card-bg: #ffffff;
  --feature-card-text: #2c3e50;
  --feature-card-border: #e9ecef;
  --strong-color: #2c3e50;
  --title-color: #2c3e50;
  --subtitle-color: #34495e;
}

[data-theme="dark"] {
  /* Tema oscuro - todas las variables juntas */
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f2e;
  --bg-content: #1e2535;
  --bg-content-alt: #252d40;
  --text-primary: #e3e7ed;
  --text-secondary: #b8c2d6;
  --text-muted: #8a95ad;
  --accent-primary: #1abc9c;
  --accent-secondary: #3498db;
  --border-color: #2a3446;
  --shadow: rgba(0, 0, 0, 0.3);
  --nav-bg: rgba(15, 20, 25, 0.9);
  --footer-bg: #0a0e14;
  
  /* Variables para tarjetas (modo oscuro) */
  --card-bg: #2d2d2d;
  --card-border: #404040;
  --card-shadow: rgba(0, 0, 0, 0.3);
  --card-hover-shadow: rgba(0, 0, 0, 0.5);
  --stat-bg: #404040;
  --stat-color: #ffffff;
  --visual-bg: linear-gradient(135deg, #2d2d2d, #404040);
  --visual-hover-bg: linear-gradient(135deg, #3d3d3d, #505050);
  
  /* Colores específicos para modo oscuro */
  --feature-card-bg: #2a3446;
  --feature-card-text: #e3e7ed;
  --feature-card-border: #3a4558;
  --strong-color: #1abc9c;
  --title-color: #ffffff;
  --subtitle-color: #e3e7ed;
}

/* Transiciones suaves para el cambio de tema */
* {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease,
                box-shadow 0.3s ease !important;
}

/* Excepciones para elementos que no deben transicionar */
.theme-toggle,
.hamburger span,
.mobile-menu a::before {
    transition: none !important;
}

/* ========================================================= */
/* === HEADER Y BANNER COMPACTO - SIN BLUR === */
/* ========================================================= */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    text-align: center;
    position: relative;
    height: 160px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.banner-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    filter: brightness(0.7) contrast(1.2);
    transition: all 0.5s ease;
}

.banner-container:hover .banner-img {
    opacity: 0.4;
    filter: brightness(0.8) contrast(1.3);
}

/* Capa overlay para mejorar legibilidad del texto */
.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(26, 42, 108, 0.7) 0%,
        rgba(42, 82, 152, 0.5) 50%,
        rgba(58, 123, 213, 0.3) 100%
    );
    z-index: 1;
}

/* ========================================================= */
/* === TEXTO CENTRADO EN EL BANNER === */
/* ========================================================= */
.banner-text {
    position: absolute;
    z-index: 2;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ffffff;
    text-shadow: 0 6px 20px rgba(0,0,0,0.6);
    pointer-events: none;
    padding: 0 1rem;
    width: 220%;
}

.banner-text h1 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 0.6px;
    line-height: 1.1;
}

/* Animación del gradiente del título */
@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========================================================= */
/* === MENÚ DE NAVEGACIÓN RIBBIT-STYLE === */
/* ========================================================= */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Efecto cuando se hace scroll */
nav.scrolled {
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    box-shadow: 0 5px 30px var(--shadow);
}

/* Contenedor del menú */
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: relative;
}

/* Mover solo el menú de navegación a la derecha */
.nav-menu {
    margin-left: auto;
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 0.4rem;
    gap: 0.3rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Fondo del menú al hover */
.nav-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 188, 156, 0.1), rgba(52, 152, 219, 0.1));
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.nav-menu:hover::before {
    opacity: 1;
}

/* Logo/Marca del sitio */
.nav-brand {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
}

/* Efecto hover del logo */
.nav-brand::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1abc9c, #3498db);
    border-radius: 8px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: -1;
}

.nav-brand:hover::before {
    opacity: 1;
    transform: scale(1.05);
}

.nav-brand:hover {
    color: white;
    transform: translateY(-2px);
}

/* Icono del brand con animación */
.brand-icon {
    font-size: 1.2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(3deg); }
}

/* Items del menú */
.nav-menu li {
    margin: 0;
    position: relative;
}

/* Enlaces del menú */
.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.2rem;
    color: white;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

/* Efecto morphing de fondo en enlaces */
.nav-menu li a .link-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1abc9c, #3498db);
    border-radius: 8px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: -1;
}

.nav-menu li a:hover .link-bg {
    opacity: 1;
    transform: scale(1);
}

.nav-menu li a:hover {
    color: white;
    transform: translateY(-2px);
}

/* Texto de los enlaces */
.nav-menu li a .link-text {
    position: relative;
    z-index: 2;
}

/* Iconos de los enlaces */
.nav-menu li a .link-icon {
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.nav-menu li a:hover .link-icon {
    transform: scale(1.1) rotate(5deg);
}

/* ========================================================= */
/* === BOTÓN HAMBURGUESA PARA MÓVIL === */
/* ========================================================= */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.hamburger span {
    width: 22px;
    height: 2px;
    background: white;
    margin: 2px 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 2px;
}

/* ========================================================= */
/* === MENÚ MÓVIL === */
/* ========================================================= */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.mobile-menu.active {
    transform: translateX(0);
}

/* Patrón de fondo del menú móvil */
.mobile-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(26,188,156,0.05)" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
    opacity: 0.5;
}

.mobile-menu ul {
    list-style: none;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Items del menú móvil con animación escalonada */
.mobile-menu li {
    margin: 1.5rem 0;
    opacity: 0;
    transform: translateY(30px);
    animation: slideUpFade 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.mobile-menu li:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu li:nth-child(2) { animation-delay: 0.2s; }
.mobile-menu li:nth-child(3) { animation-delay: 0.3s; }
.mobile-menu li:nth-child(4) { animation-delay: 0.4s; }
.mobile-menu li:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enlaces del menú móvil */
.mobile-menu a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 1.2rem 2.5rem;
    display: block;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Efecto de barra deslizante en enlaces móviles */
.mobile-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(26, 188, 156, 0.3), transparent);
    transition: left 0.6s ease;
}

.mobile-menu a:hover::before {
    left: 100%;
}

.mobile-menu a:hover {
    background: rgba(26, 188, 156, 0.2);
    color: #1abc9c;
    transform: translateX(15px) scale(1.03);
}

/* Botón cerrar menú móvil */
.close-menu {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.6rem 1rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 10000;
}

.close-menu:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* ========================================================= */
/* === CONTENIDO PRINCIPAL === */
/* ========================================================= */
main {
    max-width: 1200px;
    margin: 80px auto 40px;
    padding: 0 20px;
    min-height: 80vh;
    position: relative;
}

/* Secciones de contenido */
section {
    background: linear-gradient(135deg, var(--bg-content) 0%, var(--bg-content-alt) 100%);
    margin-bottom: 30px;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 30px var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

/* Borde lateral decorativo */
section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

/* Efecto hover en secciones */
section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow);
}

/* Animación escalonada para secciones */
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }
section:nth-child(5) { animation-delay: 0.4s; }

/* Títulos de sección */
h2 {
    color: var(--title-color);
    border-bottom: 3px solid var(--accent-primary);
    padding-bottom: 12px;
    margin-bottom: 25px;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--title-color), var(--subtitle-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Subtítulos */
h3 {
    color: var(--subtitle-color);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    padding-left: 0.8rem;
    border-left: 3px solid var(--accent-secondary);
}

/* ========================================================= */
/* === ESTRUCTURA DE CONTENIDO (Texto + Imagen) === */
/* ========================================================= */
.content-body {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-top: 20px;
    flex-wrap: wrap;
}

.text-area {
    flex: 2;
    min-width: 300px;
}

.text-area p {
    margin-bottom: 1.2rem;
    text-align: justify;
    line-height: 1.7;
    font-size: 1rem;
    color: var(--text-primary);
}

.text-area strong {
    color: var(--strong-color);
    font-weight: 600;
}

/* Listas con estilo personalizado */
.text-area ul, .text-area ol {
    margin: 1.2rem 0;
    padding-left: 1.5rem;
}

.text-area li {
    margin-bottom: 0.6rem;
    line-height: 1.6;
    padding-left: 0.5rem;
    color: var(--text-primary);
}

.text-area li strong {
    color: var(--accent-primary);
    font-weight: 600;
}

.text-area ul li {
    position: relative;
}

.text-area ul li::before {
    content: '▸';
    color: var(--accent-primary);
    font-weight: bold;
    position: absolute;
    left: -1rem;
}

/* Área de imágenes */
.image-area {
    flex: 1;
    min-width: 250px;
    text-align: center;
}

.content-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px var(--shadow);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid var(--border-color);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.5s forwards;
}

.content-image:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 35px var(--shadow);
}

.image-caption {
    margin-top: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Placeholder para imágenes faltantes */
.placeholder {
    background: linear-gradient(135deg, var(--bg-content-alt), var(--border-color));
    padding: 3rem 1.5rem;
    border-radius: 10px;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    font-weight: 500;
    border: 2px dashed var(--text-muted);
    transition: all 0.3s ease;
}

.placeholder:hover {
    background: linear-gradient(135deg, var(--border-color), var(--bg-content-alt));
    border-color: var(--accent-primary);
}

.placeholder small {
    display: block;
    margin-top: 0.8rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ========================================================= */
/* === GRID DE CARACTERÍSTICAS EN INICIO === */
/* ========================================================= */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
    margin: 1.5rem 0;
}

.feature-card {
    background: linear-gradient(135deg, var(--feature-card-bg), var(--bg-content-alt));
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 6px 20px var(--shadow);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--feature-card-border);
    color: var(--feature-card-text);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.feature-card:hover h4 {
    color: white;
}

.feature-card h4 {
    margin: 0 0 0.6rem 0;
    font-size: 1.2rem;
    color: var(--feature-card-text);
}

.feature-card p {
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
    color: var(--feature-card-text);
}

/* ========================================================= */
/* === TARJETAS INTELIGENTES INTERACTIVAS === */
/* ========================================================= */
.interactive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.smart-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px var(--card-shadow);
    border: 1px solid var(--card-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.smart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.smart-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px var(--card-hover-shadow);
}

.smart-card:hover::before {
    transform: scaleX(1);
}

/* Parte visual de la tarjeta */
.card-visual {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: var(--visual-bg);
    border-radius: 8px;
    padding: 1rem;
    transition: background 0.3s;
}

.smart-card:hover .card-visual {
    background: var(--visual-hover-bg);
}

/* Contenido de la tarjeta */
.card-content {
    text-align: center;
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.card-content h4 {
    color: var(--text-primary);
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.card-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.card-stats {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stat {
    background: var(--stat-bg);
    color: var(--stat-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s;
}

.smart-card:hover .stat {
    background: #007bff;
    color: white;
}

/* ========== ANIMACIONES ESPECÍFICAS PARA TARJETAS ========== */

/* Animación CPU */
.cpu-animation .chip {
    width: 60px;
    height: 60px;
    background: var(--text-primary);
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 6px;
    position: relative;
}

.core {
    background: #3498db;
    border-radius: 2px;
    opacity: 0.3;
}

.core.active {
    opacity: 1;
    animation: core-pulse 2s infinite;
}

.core:nth-child(1) { animation-delay: 0s; }
.core:nth-child(2) { animation-delay: 0.5s; }
.core:nth-child(3) { animation-delay: 1s; }
.core:nth-child(4) { animation-delay: 1.5s; }

@keyframes core-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Animación Procesos */
.process-animation .timeline {
    display: flex;
    gap: 8px;
    align-items: end;
    height: 50px;
}

.process {
    width: 20px;
    border-radius: 3px;
    animation: process-life 4s infinite;
}

.process[data-state="running"] {
    background: #28a745;
    height: 40px;
    animation-delay: 0s;
}

.process[data-state="waiting"] {
    background: #ffc107;
    height: 25px;
    animation-delay: 1s;
}

.process[data-state="ready"] {
    background: #17a2b8;
    height: 35px;
    animation-delay: 2s;
}

@keyframes process-life {
    0%, 100% { opacity: 0.5; transform: scaleY(0.8); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* Animación Memoria */
.memory-animation .ram-bar {
    width: 30px;
    height: 80px;
    background: var(--stat-bg);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.segment {
    width: 100%;
    transition: all 0.5s;
}

.kernel { background: #e74c3c; }
.user { background: #3498db; }
.free { background: #27ae60; }

.ram-bar:hover .segment {
    transform: scaleX(1.1);
}

/* Animación Almacenamiento */
.storage-animation .file-structure {
    display: flex;
    gap: 5px;
}

.folder {
    width: 20px;
    background: #ffc107;
    border-radius: 2px;
    position: relative;
}

.folder.main {
    height: 30px;
    animation: folder-glow 3s infinite;
}

.folder.nested {
    height: 20px;
    background: #fd7e14;
    animation: folder-glow 3s infinite reverse;
}

.file {
    width: 15px;
    height: 4px;
    background: #34495e;
    border-radius: 1px;
    margin: 1px 0;
    animation: file-blink 2s infinite;
}

@keyframes folder-glow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes file-blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ========================================================= */
/* === FOOTER === */
/* ========================================================= */
footer {
    background: linear-gradient(135deg, var(--footer-bg) 0%, #34495e 100%);
    color: white;
    padding: 30px 20px 15px;
    margin-top: 50px;
    border-top: 4px solid var(--accent-primary);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.footer-info, .footer-refs, .footer-contact {
    padding: 0.8rem;
}

.footer-info h3, .footer-refs h3, .footer-contact h3 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-left: 3px solid var(--accent-primary);
    padding-left: 0.6rem;
    border-bottom: none;
}

.footer-info p, .footer-contact p {
    margin-bottom: 0.6rem;
    line-height: 1.5;
}

.footer-info strong {
    color: var(--accent-primary);
}

.footer-refs ul {
    list-style: none;
    padding: 0;
}

.footer-refs li {
    margin-bottom: 0.5rem;
    padding-left: 0.8rem;
    position: relative;
}

.footer-refs li::before {
    content: '📚';
    position: absolute;
    left: -0.3rem;
}

.footer-bottom {
    max-width: 1200px;
    margin: 1.5rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid #3e566d;
    text-align: center;
}

.copyright {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.project-info {
    font-size: 0.8rem;
    opacity: 0.6;
    font-style: italic;
}

/* ========================================================= */
/* === BOTÓN MODO OSCURO === */
/* ========================================================= */
.theme-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px var(--shadow);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
}

/* ========================================================= */
/* === ANIMACIONES Y EFECTOS ESPECIALES === */
/* ========================================================= */

/* Animación de aparición de secciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación del botón hamburguesa cuando está activo */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Animación de aparición para tarjetas inteligentes */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fade-in-up 0.6s ease-out forwards;
}

/* Efecto de rebote para el botón de tema */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0) scale(1.1);
    }
    70% {
        transform: translate3d(0, -4px, 0) scale(1.05);
    }
}

/* Efecto de onda expansiva */
@keyframes rippleExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(8);
        opacity: 0;
    }
}

/* Efecto de brillo */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(26, 188, 156, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(26, 188, 156, 0.8);
    }
    100% {
        box-shadow: 0 4px 15px var(--shadow);
    }
}

.theme-toggle:active {
    animation: glow 0.3s ease;
}

/* Efecto de partículas */
@keyframes floatParticle {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.theme-toggle.particle-effect::before {
    content: '✦';
    position: absolute;
    font-size: 0.8rem;
    animation: floatParticle 1s ease-out forwards;
    pointer-events: none;
}

/* ========================================================= */
/* === SCROLLBAR PERSONALIZADO === */
/* ========================================================= */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-content-alt);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #16a085, #2980b9);
}

/* ========================================================= */
/* === CLASE PARA DESHABILITAR TRANSICIONES === */
/* ========================================================= */
.no-transitions * {
    transition: none !important;
    animation: none !important;
}

/* ========================================================= */
/* === RESPONSIVIDAD - DISEÑO ADAPTATIVO === */
/* ========================================================= */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .banner-text h1 {
        font-size: 1.8rem;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    section {
        padding: 1.8rem;
    }
}

/* Móviles (Hasta 768px) */
@media (max-width: 768px) {
    /* Ocultar menú normal y mostrar hamburguesa */
    .nav-menu {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    .mobile-menu {
        display: flex;
    }

    .nav-brand {
        font-size: 1.3rem;
    }

    /* Ajustes generales para móviles */
    main {
        margin: 70px auto 20px;
        padding: 0 15px;
    }

    header {
        height: 200px;
    }

    .banner-text h1 {
        font-size: 1.4rem;
    }

    .banner-text {
        top: 50%;
    }

    .content-body {
        flex-direction: column;
        gap: 15px;
    }
    
    .text-area, .image-area {
        min-width: 100%;
    }
    
    section {
        padding: 1.2rem;
        margin-bottom: 15px;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    /* Grid de características en una columna */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Tarjetas inteligentes responsive */
    .interactive-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .smart-card {
        padding: 1rem;
    }
    
    .card-visual {
        height: 100px;
    }

    /* Botón modo oscuro más pequeño */
    .theme-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        bottom: 20px;
        right: 20px;
    }
}

/* Móviles pequeños (Hasta 480px) */
@media (max-width: 480px) {
    .nav-container {
        padding: 0.8rem;
    }

    .nav-brand {
        font-size: 1.1rem;
    }

    header {
        height: 180px;
    }

    .banner-text h1 {
        font-size: 1.3rem;
    }

    .banner-text {
        top: 50%;
    }

    .mobile-menu a {
        font-size: 1.3rem;
        padding: 1rem 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-info, .footer-refs, .footer-contact {
        text-align: center;
    }

    .footer-info h3, .footer-refs h3, .footer-contact h3 {
        border-left: none;
        border-bottom: 2px solid var(--accent-primary);
        padding-left: 0;
        padding-bottom: 0.4rem;
    }

    /* Stats más compactos en móviles pequeños */
    .card-stats {
        gap: 0.3rem;
    }
    
    .stat {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
}

/* ========================================================= */
/* === ESTILOS DEFINITIVOS PARA LOGO - SIN FONDOS BLANCOS === */
/* ========================================================= */

.logo-img {
    height: 40px;
    width: auto;
    transition: all 0.3s ease;
    display: block;
}

.nav-brand {
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-brand:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-brand:hover .logo-img {
    transform: scale(1.08);
}

/* Responsive */
@media (max-width: 768px) {
    .logo-img {
        height: 35px;
    }
}

/* ========================================================= */
/* === LOGO GRANDE - VERSIÓN COMPLETA === */
/* ========================================================= */
.logo-img {
    height: 95px; /* Tamaño principal - AJUSTA ESTE VALOR */
    width: auto;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: block;
    background: transparent !important;
    border: none !important;
}

/* Contenedor del logo */
.nav-brand {
    padding: 0.3rem 0.6rem;
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: center;
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Efecto hover mejorado */
.nav-brand:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px);
}

.nav-brand:hover .logo-img {
    transform: scale(1.1);
    filter: drop-shadow(0 0 12px rgba(26, 188, 156, 0.4));
}

/* Asegurar que el menú se ajuste al logo grande */
.nav-container {
    padding: 0.8rem 2rem; /* Más padding para contener logo grande */
}

/* Responsive */
@media (max-width: 1024px) {
    .logo-img {
        height: 50px;
    }
}

@media (max-width: 768px) {
    .logo-img {
        height: 45px;
    }
    
    .nav-brand {
        padding: 0.5rem 0.8rem;
    }
    
    .nav-container {
        padding: 0.8rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 40px;
    }
    
    .nav-brand {
        padding: 0.4rem 0.6rem;
    }
    
    .nav-container {
        padding: 0.8rem 1rem;
    }
}

/* ESTILOS PARA TEXTO ELEGANTE */
.intro-text-center {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
}

.intro-container {
    max-width: 850px;
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 255, 0.98));
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(91, 134, 229, 0.12);
    position: relative;
    overflow: hidden;
}

.intro-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #5B86E5, #36D1DC);
}

.lead-paragraph {
    font-size: 1.2em;
    line-height: 1.7;
    color: #2c3e50;
    margin-bottom: 30px;
    font-weight: 300;
    letter-spacing: 0.3px;
}

.lead-paragraph .highlight {
    background: linear-gradient(120deg, rgba(91, 134, 229, 0.15) 0%, rgba(91, 134, 229, 0.15) 100%);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.elegant-section {
    margin: 35px 0;
    padding: 25px;
    background: #f8faff;
    border-radius: 12px;
    border-left: 4px solid #5B86E5;
    text-align: left;
}

.section-title {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .underline {
    position: relative;
    padding-bottom: 5px;
}

.section-title .underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #5B86E5, transparent);
}

.elegant-section p {
    font-size: 1.05em;
    line-height: 1.7;
    color: #34495e;
    margin-bottom: 18px;
    text-align: justify;
    hyphens: auto;
}

.elegant-section strong {
    color: #5B86E5;
    font-weight: 600;
    position: relative;
}

.elegant-section strong::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(91, 134, 229, 0.3);
}

.closing-section {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid rgba(91, 134, 229, 0.2);
}

.invitation-text {
    font-size: 1.1em;
    line-height: 1.7;
    color: #2c3e50;
    font-style: italic;
    padding: 20px;
    background: linear-gradient(135deg, rgba(91, 134, 229, 0.05), rgba(54, 209, 220, 0.05));
    border-radius: 10px;
    border: 1px solid rgba(91, 134, 229, 0.1);
}

.invitation-text strong {
    color: #5B86E5;
    position: relative;
}

/* Efectos hover sutiles */
.elegant-section:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
    box-shadow: 0 8px 25px rgba(91, 134, 229, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .intro-container {
        padding: 25px 20px;
        margin: 0 15px;
    }
    
    .elegant-section {
        padding: 20px;
        margin: 25px 0;
    }
    
    .lead-paragraph {
        font-size: 1.1em;
        text-align: left;
    }
    
    .elegant-section p {
        text-align: left;
        font-size: 1em;
    }
    
    .section-title {
        font-size: 1.3em;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
/* VERSIÓN MÍNIMA CON MODO OSCURO */
.intro-text-center {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.intro-container {
    max-width: 750px;
    text-align: center;
    padding: 25px;
    border-radius: 12px;
    
    /* Modo claro */
    background: #ffffff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.lead-paragraph {
    font-size: 1.1em;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

.lead-paragraph .highlight {
    font-weight: 600;
    color: #5B86E5;
}

/* Modo oscuro */
[data-theme="dark"] .intro-container {
    background: #1a1a2e;
    color: #f0f0f0;
}

[data-theme="dark"] .lead-paragraph {
    color: #f0f0f0;
}

[data-theme="dark"] .lead-paragraph .highlight {
    color: #6d9cff;
}

/* ESTILOS PARA INTRODUCCIÓN CON MODO OSCURO GARANTIZADO */
.intro-text-center {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.intro-container {
    max-width: 800px;
    text-align: center;
    padding: 35px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    
    /* IMPORTANTE: Usar !important para forzar en modo claro */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.98)) !important;
    box-shadow: 0 8px 30px rgba(91, 134, 229, 0.15) !important;
    border: 1px solid rgba(91, 134, 229, 0.1) !important;
}

.lead-paragraph {
    font-size: 1.15em;
    line-height: 1.7;
    font-weight: 300;
    letter-spacing: 0.2px;
    margin: 0;
    
    /* IMPORTANTE: !important para modo claro */
    color: #2c3e50 !important;
}

.lead-paragraph .highlight {
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 500;
    
    /* IMPORTANTE: !important para modo claro */
    background: linear-gradient(120deg, rgba(91, 134, 229, 0.18), rgba(91, 134, 229, 0.12)) !important;
    color: #2c3e50 !important;
}

.lead-paragraph em {
    font-style: italic;
    color: #5B86E5 !important;
    font-weight: 400;
}

/* ========== MODO OSCURO ========== */
/* Asegurar que el selector tenga suficiente peso */
html[data-theme="dark"] .intro-container,
body[data-theme="dark"] .intro-container,
:root[data-theme="dark"] .intro-container {
    /* Fondo oscuro con !important */
    background: linear-gradient(135deg, rgba(30, 35, 50, 0.98), rgba(25, 30, 45, 0.98)) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(91, 134, 229, 0.2) !important;
}

html[data-theme="dark"] .lead-paragraph,
body[data-theme="dark"] .lead-paragraph {
    color: #e0e0e0 !important;
}

html[data-theme="dark"] .lead-paragraph .highlight {
    background: linear-gradient(120deg, rgba(91, 134, 229, 0.35), rgba(91, 134, 229, 0.25)) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .lead-paragraph em {
    color: #6d9cff !important;
}

/* Efecto hover */
.intro-container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.intro-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(91, 134, 229, 0.2) !important;
}

html[data-theme="dark"] .intro-container:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4) !important;
}

/* ESTILOS PARA INTRODUCCIÓN CON MODO OSCURO MANEJADO POR JS */
.intro-text-center {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.intro-container {
    max-width: 800px;
    text-align: center;
    padding: 35px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* ESTOS ESTILOS INICIALES SERÁN SOBREESCRITOS POR JS */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.98));
    box-shadow: 0 8px 30px rgba(91, 134, 229, 0.15);
    border: 1px solid rgba(91, 134, 229, 0.1);
}

.intro-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #5B86E5, #36D1DC);
}

.lead-paragraph {
    font-size: 1.15em;
    line-height: 1.7;
    font-weight: 300;
    letter-spacing: 0.2px;
    margin: 0;
    transition: color 0.3s ease;
    
    /* Color inicial - será sobreescrito por JS */
    color: #2c3e50;
}

.lead-paragraph .highlight {
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    
    /* Estilos iniciales - serán sobreescritos por JS */
    background: linear-gradient(120deg, rgba(91, 134, 229, 0.18), rgba(91, 134, 229, 0.12));
    color: #2c3e50;
}

.lead-paragraph em {
    font-style: italic;
    color: #5B86E5;
    font-weight: 400;
}

/* Efecto hover - funciona en ambos modos */
.intro-container:hover {
    transform: translateY(-3px);
}

/* Modo oscuro - backup por si JS falla */
[data-theme="dark"] .intro-container {
    background: linear-gradient(135deg, rgba(30, 35, 50, 0.98), rgba(25, 30, 45, 0.98)) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(91, 134, 229, 0.2) !important;
}

[data-theme="dark"] .lead-paragraph {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .lead-paragraph .highlight {
    background: linear-gradient(120deg, rgba(91, 134, 229, 0.35), rgba(91, 134, 229, 0.25)) !important;
    color: #ffffff !important;
}

/* Responsive */
@media (max-width: 768px) {
    .intro-container {
        padding: 25px 20px;
        margin: 0 15px;
    }
    
    .lead-paragraph {
        font-size: 1.05em;
        text-align: left;
        line-height: 1.6;
    }
}
