/* ========================================
   ESTILOS PRINCIPALES - FUTURO DE LA IA
   Diseñado algorítmicamente por una IA
   ======================================== */

/* Importación de fuentes */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ========================================
   VARIABLES Y RESET
   ======================================== */
:root {
    --primary: #8a8aff;
    --primary-dark: #6b6bff;
    --secondary: #ff6b6b;
    --bg-dark: #03030a;
    --bg-card: rgba(20, 20, 40, 0.7);
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --glow-color: rgba(138, 138, 255, 0.5);
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   EFECTOS DE FONDO GENERADOS POR IA
   ======================================== */

/* Fondo principal con gradiente dinámico */
#background-ai {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(circle at 30% 40%, #1a1a3a, #03030a);
}

/* Partículas inteligentes - Generadas por algoritmo de IA */
#particles-ai {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    filter: blur(1px);
    opacity: 0.3;
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg) scale(1.2);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg) scale(0.8);
    }
    100% {
        transform: translate(0, 0) rotate(360deg) scale(1);
    }
}

/* Olas digitales - Efecto generativo */
#digital-waves {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.1;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        transparent 0%,
        var(--primary) 1%,
        transparent 2%
    );
    mask: linear-gradient(90deg, transparent, black, transparent);
    animation: waveMove 8s ease-in-out infinite;
}

@keyframes waveMove {
    0%, 100% {
        transform: translateY(0) scaleY(0.5);
    }
    50% {
        transform: translateY(-20px) scaleY(1);
    }
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   HEADER
   ======================================== */
.header {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 2rem;
}

.header h1 {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 50px var(--glow-color);
    animation: titlePulse 4s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes titlePulse {
    0%, 100% {
        text-shadow: 0 0 50px var(--glow-color);
    }
    50% {
        text-shadow: 0 0 80px var(--primary);
    }
}

.header p {
    font-size: clamp(1rem, 3vw, 1.5rem);
    max-width: 900px;
    margin: 1rem auto;
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 30px;
    background: var(--bg-card);
    border: 1px solid rgba(138, 138, 255, 0.2);
    box-shadow: 0 0 30px rgba(138, 138, 255, 0.1);
}

/* ========================================
   SECCIÓN DE HISTORIA
   ======================================== */
.history-section {
    padding: 6rem 0;
    position: relative;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    text-align: center;
    margin-bottom: 4rem;
    background: linear-gradient(135deg, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.timeline-vertical {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.timeline-vertical::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, 
        transparent, 
        var(--primary), 
        var(--secondary), 
        transparent);
    border-radius: 2px;
    box-shadow: 0 0 20px var(--primary);
}

.timeline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6rem;
    position: relative;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-content {
    width: 45%;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(138, 138, 255, 0.2);
    border-radius: 30px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.timeline-content:hover {
    transform: scale(1.05) translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 0 40px var(--glow-color);
}

.timeline-year {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px var(--primary);
}

.timeline-svg {
    width: 45%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 30px var(--primary);
    animation: dotGlow 2s infinite;
}

@keyframes dotGlow {
    0%, 100% {
        box-shadow: 0 0 20px var(--primary);
    }
    50% {
        box-shadow: 0 0 40px var(--secondary);
    }
}

/* ========================================
   SVG ANIMACIONES
   ======================================== */
.brain-svg, .neural-svg, .chip-svg, .robot-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.brain-path, .neural-path, .chip-path, .robot-path {
    stroke: var(--primary);
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawPath 3s ease-in-out forwards;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

.brain-fill, .neural-fill, .chip-fill, .robot-fill {
    fill: rgba(138, 138, 255, 0.1);
    animation: fadeFill 3s ease-in-out forwards;
}

@keyframes fadeFill {
    from { fill-opacity: 0; }
    to { fill-opacity: 0.3; }
}

/* ========================================
   DOCUMENTACIÓN
   ======================================== */
.documentation {
    padding: 6rem 0;
}

.doc-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.doc-article {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(138, 138, 255, 0.1);
    border-radius: 30px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.doc-article:hover {
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--glow-color);
}

.doc-article h3 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(138, 138, 255, 0.3);
    padding-bottom: 0.5rem;
}

.doc-article p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.doc-article ul {
    list-style: none;
    padding: 0;
}

.doc-article li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.doc-article li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* ========================================
   FUTURO TIMELINE
   ======================================== */
.future-timeline {
    padding: 6rem 0;
    background: linear-gradient(135deg, rgba(20, 20, 50, 0.3), rgba(10, 10, 30, 0.5));
    position: relative;
    overflow: hidden;
}

.future-timeline::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(138, 138, 255, 0.02) 10px,
        rgba(138, 138, 255, 0.02) 20px
    );
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gridMove {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

.future-card {
    background: rgba(30, 30, 60, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(138, 138, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.4s ease;
}

.future-card:hover {
    transform: translateY(-10px);
    border-color: var(--secondary);
    box-shadow: 0 20px 40px rgba(255, 107, 107, 0.2);
}

.future-year {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 1rem;
}

/* ========================================
   ESTADÍSTICAS
   ======================================== */
.stats-section {
    padding: 6rem 0;
    background: rgba(0, 0, 0, 0.4);
    position: relative;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.stat-chart {
    text-align: center;
    padding: 2rem;
    background: rgba(30, 30, 60, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.stat-chart:hover {
    transform: scale(1.05);
    background: rgba(138, 138, 255, 0.1);
}

.chart-svg {
    width: 150px;
    height: 150px;
    margin: 0 auto 1rem;
}

.circle-bg {
    fill: none;
    stroke: rgba(138, 138, 255, 0.2);
    stroke-width: 8;
}

.circle-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
    animation: fillCircle 2s ease-in-out forwards;
    filter: drop-shadow(0 0 5px var(--primary));
}

@keyframes fillCircle {
    to {
        stroke-dashoffset: var(--offset);
    }
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid rgba(138, 138, 255, 0.2);
    position: relative;
}

.ia-signature {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--primary);
    margin-top: 2rem;
    padding: 1rem 2rem;
    border: 1px solid rgba(138, 138, 255, 0.3);
    border-radius: 50px;
    display: inline-block;
    background: rgba(138, 138, 255, 0.05);
    backdrop-filter: blur(5px);
    animation: signatureGlow 3s ease-in-out infinite;
}

@keyframes signatureGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(138, 138, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 107, 107, 0.3);
    }
}

/* ========================================
   ANIMACIONES DE ENTRADA
   ======================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   VERIFICACIÓN DE FUENTES
   ======================================== */
.sources-badge {
    display: inline-block;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid rgba(138, 138, 255, 0.2);
    margin: 0.5rem;
}

/* ========================================
   MEDIA QUERIES
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .timeline-item {
        flex-direction: column !important;
        gap: 2rem;
    }
    
    .timeline-content, .timeline-svg {
        width: 100%;
    }
    
    .timeline-vertical::before {
        left: 20px;
    }
    
    .timeline-dot {
        left: 20px;
    }
    
    .header h1 {
        font-size: 3rem;
    }
    
    .doc-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 2rem;
    }
    
    .timeline-year {
        font-size: 2rem;
    }
    
    .future-card {
        padding: 1.5rem;
    }
}