/* =====================================================
   ANIMACIÓN 3D - CÓDIGO FLOTANTE
   Animación de elementos de código y desarrollo web
   ===================================================== */

.hero-animation-container {
    position: relative;
    width: 100%;
    height: 500px;
    perspective: 1000px;
    overflow: hidden;
}

/* Escena 3D */
.code-scene {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

/* Ventana de código flotante */
.code-window {
    position: absolute;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(25, 118, 210, 0.1));
    border: 2px solid rgba(33, 150, 243, 0.3);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(33, 150, 243, 0.2);
    animation: float 6s ease-in-out infinite;
    transform-style: preserve-3d;
}

.code-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: rgba(33, 150, 243, 0.2);
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid rgba(33, 150, 243, 0.3);
}

.code-window-dots {
    position: absolute;
    top: 10px;
    left: 15px;
    display: flex;
    gap: 8px;
    z-index: 1;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

/* Líneas de código */
.code-lines {
    margin-top: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.code-line {
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    opacity: 0;
    animation: typeLine 0.5s forwards;
}

.code-line:nth-child(1) { animation-delay: 0.5s; }
.code-line:nth-child(2) { animation-delay: 1s; }
.code-line:nth-child(3) { animation-delay: 1.5s; }
.code-line:nth-child(4) { animation-delay: 2s; }
.code-line:nth-child(5) { animation-delay: 2.5s; }

.code-keyword { color: #2196F3; font-weight: bold; }
.code-string { color: #4CAF50; }
.code-function { color: #FF9800; }
.code-comment { color: #9E9E9E; font-style: italic; }

/* Posicionamiento de ventanas */
.window-1 {
    top: 10%;
    left: 5%;
    width: 280px;
    animation-delay: 0s;
    z-index: 3;
}

.window-2 {
    top: 40%;
    right: 10%;
    width: 300px;
    animation-delay: 2s;
    z-index: 2;
}

.window-3 {
    bottom: 15%;
    left: 15%;
    width: 250px;
    animation-delay: 4s;
    z-index: 1;
}

/* Elementos flotantes decorativos */
.floating-element {
    position: absolute;
    font-size: 3rem;
    color: rgba(33, 150, 243, 0.3);
    animation: floatRotate 8s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(33, 150, 243, 0.5);
}

.element-1 {
    top: 20%;
    right: 20%;
    animation-delay: 0s;
}

.element-2 {
    bottom: 25%;
    right: 15%;
    animation-delay: 2s;
}

.element-3 {
    top: 60%;
    left: 35%;
    animation-delay: 4s;
}

/* Partículas de fondo */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(33, 150, 243, 0.6);
    border-radius: 50%;
    animation: particleFloat 15s linear infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; }
.particle:nth-child(4) { left: 40%; animation-delay: 6s; }
.particle:nth-child(5) { left: 50%; animation-delay: 8s; }
.particle:nth-child(6) { left: 60%; animation-delay: 10s; }
.particle:nth-child(7) { left: 70%; animation-delay: 12s; }
.particle:nth-child(8) { left: 80%; animation-delay: 14s; }
.particle:nth-child(9) { left: 90%; animation-delay: 16s; }

/* Grid de fondo */
.grid-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(33, 150, 243, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(33, 150, 243, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    animation: gridMove 20s linear infinite;
}

/* Animaciones */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: translateY(-20px) rotateX(5deg) rotateY(-5deg);
    }
    50% {
        transform: translateY(0) rotateX(0deg) rotateY(5deg);
    }
    75% {
        transform: translateY(-15px) rotateX(-5deg) rotateY(0deg);
    }
}

@keyframes floatRotate {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-30px) rotate(180deg);
        opacity: 0.6;
    }
}

@keyframes typeLine {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

@keyframes gridMove {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(50px);
    }
}

/* Cursor interactivo */
.cursor-blink {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #2196F3;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-animation-container {
        height: 350px;
    }
    
    .code-window {
        padding: 15px;
        font-size: 12px;
    }
    
    .window-1, .window-2, .window-3 {
        width: 200px;
    }
    
    .floating-element {
        font-size: 2rem;
    }
    
    .window-2 {
        display: none; /* Ocultar ventana en móvil */
    }
}

@media (max-width: 576px) {
    .hero-animation-container {
        height: 280px;
    }
    
    .window-3 {
        display: none;
    }
    
    .code-lines {
        font-size: 11px;
    }
}

/* Efecto de brillo en hover */
.code-window:hover {
    border-color: rgba(33, 150, 243, 0.6);
    box-shadow: 0 12px 48px rgba(33, 150, 243, 0.4);
    transform: translateZ(20px);
}

/* Terminal style alternativo */
.terminal-style {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(33, 150, 243, 0.4);
}

.terminal-style .code-line {
    color: #00ff00;
}

.terminal-prompt {
    color: #2196F3;
    margin-right: 5px;
}

/* Iconos de tecnología flotantes */
.tech-icon-float {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.2;
    animation: techFloat 10s ease-in-out infinite;
}

.tech-icon-float:nth-child(1) {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
}

.tech-icon-float:nth-child(2) {
    top: 70%;
    right: 25%;
    animation-delay: 3s;
}

.tech-icon-float:nth-child(3) {
    bottom: 20%;
    right: 10%;
    animation-delay: 6s;
}

@keyframes techFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.2;
    }
    50% {
        transform: translateY(-40px) scale(1.2);
        opacity: 0.4;
    }
}