/* public/css/style.css */

/* --- VARIABLES GLOBALES --- */
:root {
    --bg-dark: #0b0f19;
    --bg-card: rgba(255, 255, 255, 0.05);
    --fc-red: #ff0000;
    --fc-red-glow: rgba(255, 0, 0, 0.6);
    --text-main: #ffffff;
    --text-muted: #a0aec0;
    --font-base: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* --- RESET Y BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-base);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- NUEVO HERO SECTION DE ALTO IMPACTO --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 2rem 2rem; /* Espacio extra arriba por el navbar */
    position: relative;
    background: #0b0f19; /* Fondo negro puro institucional */
    overflow: hidden;
}

/* Brillo sutil de fondo para darle profundidad */
.hero::before {
    content: ''; position: absolute; top: 20%; left: -10%;
    width: 50vw; height: 50vw; background: radial-gradient(circle, rgba(255,0,0,0.05) 0%, transparent 70%);
    z-index: 0; pointer-events: none;
}
.hero::after {
    content: ''; position: absolute; bottom: -20%; right: -10%;
    width: 40vw; height: 40vw; background: radial-gradient(circle, rgba(0, 229, 255, 0.03) 0%, transparent 70%);
    z-index: 0; pointer-events: none;
}

.hero-container {
    max-width: 1200px; width: 100%;
    display: grid; grid-template-columns: 1fr 1fr; gap: 4rem;
    align-items: center; z-index: 2; position: relative;
}

/* Izquierda: Textos */
.hero-content-left {
    animation: slideInLeft 1s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

.tech-badge {
    display: inline-block; padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px; color: var(--text-muted); font-size: 0.85rem; font-family: monospace;
    margin-bottom: 1.5rem; letter-spacing: 1px;
}

.hero-title {
    font-size: 3.5rem; font-weight: 900; line-height: 1.1; margin-bottom: 1.5rem; color: #ffffff;
}

.highlight-red {
    color: var(--fc-red);
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
}

.highlight-blue {
    color: #00e5ff; /* Acento azul tecnológico */
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.hero-description {
    font-size: 1.15rem; color: var(--text-muted); margin-bottom: 2.5rem; max-width: 90%; line-height: 1.7;
}

.hero-buttons {
    display: flex; gap: 1rem;
}

/* Derecha: Visual (Editor de Código) */
.hero-visual-right {
    position: relative;
    animation: slideInRight 1s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
    perspective: 1000px;
}

.ide-window {
    background: #05070a; border: 1px solid #222; border-radius: 12px; overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(255,255,255,0.05);
    transform: rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.ide-window:hover {
    transform: rotateY(0deg) rotateX(0deg);
}

.ide-header {
    background: #111; padding: 12px 16px; display: flex; align-items: center; border-bottom: 1px solid #222;
}

.ide-buttons { display: flex; gap: 8px; }
.ide-btn { width: 12px; height: 12px; border-radius: 50%; }
.ide-btn.close { background: #ff5f56; }
.ide-btn.minimize { background: #ffbd2e; }
.ide-btn.maximize { background: #27c93f; }

.ide-title {
    flex-grow: 1; text-align: center; color: #666; font-family: monospace; font-size: 0.85rem;
}

.ide-body {
    padding: 1.5rem; font-family: 'Courier New', Courier, monospace; font-size: 0.9rem; line-height: 1.6; color: #a9b7c6;
}

.code-line { display: flex; flex-wrap: wrap; }
.code-line.empty { height: 1.6rem; }
.indented { padding-left: 2rem; }
.indented-2 { padding-left: 4rem; }

/* Colores de sintaxis (Syntax Highlighting) */
.keyword { color: #cc7832; font-weight: bold; }
.class-name { color: #ffc66d; }
.function { color: #ffc66d; }
.method { color: #ffc66d; }
.variable { color: #9876aa; }
.string { color: #6a8759; }
.boolean { color: #cc7832; font-weight: bold; }

/* Efecto del Cursor */
.cursor-block {
    display: inline-block; width: 8px; height: 15px; background: #fff; margin-left: 5px;
    animation: ideBlink 1s infinite;
}

.floating-badge {
    position: absolute; bottom: -20px; right: -20px;
    background: rgba(11, 15, 25, 0.9); border: 1px solid var(--fc-red);
    padding: 10px 20px; border-radius: 30px; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); color: #fff; font-size: 0.9rem; font-weight: bold;
    animation: floatBadge 3s ease-in-out infinite alternate;
}

/* Animaciones del Hero */
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes ideBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes floatBadge { from { transform: translateY(0px); } to { transform: translateY(-15px); } }

/* Adaptación a Móviles (Para que no se rompa el diseño) */
@media (max-width: 992px) {
    .hero-container { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
    .hero-content-left { display: flex; flex-direction: column; align-items: center; }
    .hero-description { max-width: 100%; }
    .ide-window { transform: none; }
    .ide-window:hover { transform: none; }
    .hero-title { font-size: 2.8rem; }
}

@media (max-width: 600px) {
    .hero-title { font-size: 2.2rem; }
    .hero-buttons { flex-direction: column; width: 100%; }
    .hero-buttons .btn { width: 100%; }
    .ide-body { font-size: 0.75rem; padding: 1rem; }
    .floating-badge { display: none; /* Ocultamos el badge en celulares muy pequeños para hacer espacio */ }
}

/* BOTONES INTERACTIVOS */
.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--fc-red);
    color: #fff;
    border: 2px solid var(--fc-red);
    box-shadow: 0 4px 15px var(--fc-red-glow);
}

.btn-primary:hover {
    background-color: transparent;
    transform: translateY(-3px);
}

.btn-outline {
    background-color: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.2);
}

.btn-outline:hover {
    border-color: #fff;
    transform: translateY(-3px);
}

/* --- SECCIÓN DE SERVICIOS (TARJETAS) --- */
.services-section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #fff;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* EFECTO GLASSMORPHISM EN TARJETAS */
.service-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    text-align: left;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.5s ease;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--fc-red);
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.15);
}

.service-card:hover::before {
    left: 100%;
}

.service-card .icon {
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: rgba(255, 0, 0, 0.05); /* Un fondo rojizo muy sutil */
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 14px;
    transition: all 0.3s ease;
}

.service-card .icon svg {
    width: 36px;
    height: 36px;
    stroke: var(--fc-red); /* El icono tomará el rojo exacto de tu variable */
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.service-card:hover .icon {
    background: rgba(255, 0, 0, 0.15);
    transform: scale(1.1);
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #fff;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- ANIMACIONES --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive básico */
@media (max-width: 768px) {
    .glow-text { font-size: 2.2rem; }
    .hero-buttons { flex-direction: column; }
}

/* =========================================
   DISEÑO RESPONSIVE (Móviles y Tablets)
   ========================================= */

/* Ajustes para pantallas medianas (Tablets) */
@media (max-width: 992px) {
    .glow-text {
        font-size: 2.8rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
}

/* Ajustes para pantallas pequeñas (Teléfonos móviles) */
@media (max-width: 768px) {
    
    /* 1. Ajustes de la cabecera (Hero) */
    .hero {
        padding: 1.5rem;
        min-height: 85vh; /* Evita que ocupe demasiado espacio innecesario en vertical */
    }

    .glow-text {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    /* 2. Botones táctiles a pantalla completa */
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        width: 100%; /* Toma todo el ancho disponible */
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
        padding: 1rem; /* Botones más altos para que sea fácil tocarlos con el dedo */
    }

    /* 3. Ajustes de la sección de servicios */
    .services-section {
        padding: 3rem 1.5rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .service-card {
        padding: 1.5rem; /* Reducimos un poco el relleno interno en móviles */
    }
}

/* Ajustes para pantallas muy pequeñas (Teléfonos antiguos/estrechos) */
@media (max-width: 480px) {
    .glow-text {
        font-size: 1.8rem;
    }
}

/* --- BARRA DE NAVEGACIÓN --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
    padding: 1rem 0;
}
.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { color: var(--text-main); text-decoration: none; font-weight: 500; transition: color 0.3s; }
.nav-links a:hover { color: var(--fc-red); }
.btn-nav {
    background: rgba(255, 0, 0, 0.1); border: 1px solid var(--fc-red);
    padding: 0.5rem 1.2rem; border-radius: 6px; color: var(--fc-red) !important;
}
.btn-nav:hover { background: var(--fc-red); color: #fff !important; }

/* --- TECH BANNER --- */
.tech-banner {
    background: #151a28; border-top: 1px solid rgba(255,0,0,0.2); border-bottom: 1px solid rgba(255,0,0,0.2);
    padding: 1.5rem 0; text-align: center; color: var(--text-muted);
}
.tech-stack {
    margin-top: 0.5rem; display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap;
    font-weight: 700; color: #fff; font-size: 1.1rem;
}
.tech-stack .dot { color: var(--fc-red); }

/* --- SECCIÓN NOSOTROS --- */
.about-section {
    padding: 5rem 2rem; max-width: 1200px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
}
.about-content p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1.1rem; }
.tech-box {
    background: #000; border: 1px solid #333; border-radius: 8px; padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); position: relative;
}
.blinking-dot {
    position: absolute; top: 15px; right: 15px; width: 10px; height: 10px;
    background-color: #0f0; border-radius: 50%;
    animation: blink 1.5s infinite;
}
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.2; } 100% { opacity: 1; } }

/* --- FORMULARIO DE CONTACTO --- */
.contact-section { background: #151a28; padding: 5rem 2rem; }
.contact-container { max-width: 600px; margin: 0 auto; }
.contact-form { background: var(--bg-dark); padding: 3rem; border-radius: 16px; border: 1px solid rgba(255,0,0,0.1); }
.input-group { margin-bottom: 1.5rem; }
.input-group input, .input-group select, .input-group textarea {
    width: 100%; padding: 1rem; background: #0a0d16; border: 1px solid #333;
    border-radius: 8px; color: #fff; font-family: inherit; font-size: 1rem; transition: border 0.3s;
}
.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    outline: none; border-color: var(--fc-red); box-shadow: 0 0 10px rgba(255,0,0,0.2);
}
.file-upload label { display: block; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.file-upload input[type="file"] { padding: 0.5rem; font-size: 0.85rem; color: var(--text-muted); border: 1px dashed #444; }

/* --- FOOTER --- */
.footer { background: #0a0d16; padding: 3rem 2rem; border-top: 1px solid #222; }
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.footer-info { text-align: right; color: var(--text-muted); font-size: 0.9rem; }

/* --- MEJORAS SECCIÓN NOSOTROS (TERMINAL Y CEO) --- */

/* 1. Candado Global Anti-Desbordamiento (Añadir al inicio de la sección) */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* 2. Estructura Base Blindada */
.about-section {
    padding: 5rem 2rem; max-width: 1200px; margin: 0 auto;
    width: 100%; box-sizing: border-box;
}
/* Terminal Animada */
.terminal-pro {
    background: #05070a; border: 1px solid #222; border-radius: 10px; overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), inset 0 0 20px rgba(0,255,0,0.05);
    width: 100%;
}
.terminal-header {
    background: #111; padding: 10px 15px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #222;
}
.terminal-header .dot { width: 12px; height: 12px; border-radius: 50%; }
.term-title { color: #666; font-family: monospace; font-size: 0.85rem; margin-left: 10px; }
.terminal-body { padding: 20px; font-family: monospace; font-size: 0.95rem; color: #888; }
.terminal-body p { margin-bottom: 8px; color: #a9b7c6; }
.terminal-body p[style*="color: #0f0;"] { color: #0f0 !important; text-shadow: 0 0 5px rgba(0,255,0,0.5); }

/* Animación de Tipeo */
.typewriter { overflow: hidden; white-space: nowrap; width: 0; animation: typing 1s forwards; }
.delay-1 { animation-delay: 1s; } .delay-2 { animation-delay: 2s; }
.delay-3 { animation-delay: 3s; } .delay-4 { animation-delay: 4.5s; }
.delay-5 { animation-delay: 6s; }
@keyframes typing { from { width: 0; } to { width: 100%; } }
.cursor { animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Tarjeta del CEO */
.ceo-card {
    background: linear-gradient(145deg, #111520 0%, #0a0d16 100%);
    border: 1px solid rgba(255,0,0,0.2); border-radius: 20px; padding: 3rem 2rem;
    position: relative; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    width: 100%; box-sizing: border-box;
}
.ceo-scanner {
    position: absolute; top: -100%; left: 0; width: 100%; height: 50%;
    background: linear-gradient(to bottom, transparent, rgba(255,0,0,0.05), transparent);
    animation: scanCeo 6s infinite linear; pointer-events: none;
}
@keyframes scanCeo { 0% { top: -50%; } 100% { top: 150%; } }

/* Foto del CEO (Fija para no romperse) */
.ceo-photo-container { flex-shrink: 0; margin: 0 auto; }
.ceo-photo-frame {
    width: 200px; height: 200px; position: relative; padding: 10px;
    background: rgba(0,0,0,0.5); border-radius: 16px; border: 1px solid #333;
}
.ceo-img { 
    width: 100%; height: 100%; object-fit: cover; border-radius: 10px; 
    filter: grayscale(20%) contrast(120%); background: #151a28; /* Color de fondo si la foto no carga */
}
.frame-corners::before, .frame-corners::after {
    content: ''; position: absolute; width: 30px; height: 30px; border: 2px solid var(--fc-red);
}
.frame-corners::before { top: -1px; left: -1px; border-right: none; border-bottom: none; border-radius: 16px 0 0 0; }
.frame-corners::after { bottom: -1px; right: -1px; border-left: none; border-top: none; border-radius: 0 0 16px 0; }

/* Info del CEO */
.ceo-badge {
    display: inline-block; padding: 5px 12px; background: rgba(255,0,0,0.1); border: 1px solid var(--fc-red);
    color: var(--fc-red); font-family: monospace; font-size: 0.85rem; border-radius: 4px; margin-bottom: 1rem;
}
.ceo-name { font-size: 2.2rem; color: #fff; margin-bottom: 0.5rem; letter-spacing: -1px; line-height: 1.2; }
.ceo-tech-stack { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1.5rem; justify-content: center; }
.ceo-tech-stack span {
    font-size: 0.85rem; color: #888; background: #000; padding: 4px 10px; border-radius: 20px; border: 1px solid #222;
}
.ceo-bio { color: #a9b7c6; line-height: 1.7; margin-bottom: 1rem; font-size: 1.05rem; }
.ceo-signature { margin-top: 2rem; border-top: 1px solid #222; padding-top: 1rem; display: flex; align-items: center; justify-content: center; gap: 15px; flex-direction: column; }
.ceo-signature span { font-family: monospace; font-size: 0.8rem; color: #555; text-transform: uppercase; }

/* Ajustes Mobile */
@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; gap: 2rem; }
    .ceo-layout { flex-direction: column; text-align: center; }
    .ceo-tech-stack { justify-content: center; }
    .ceo-signature { flex-direction: column; gap: 5px; }
}

/* Actualización Mobile (Reemplaza o ajusta tus media queries si es necesario) */
@media (max-width: 768px) {
    .nav-links { display: none; /* Simplificado para celular, luego agregamos menú hamburguesa */ }
    .about-section { grid-template-columns: 1fr; gap: 2rem; }
    .footer-content { flex-direction: column; text-align: center; gap: 1rem; }
    .footer-info { text-align: center; }
}

/* --- CORRECCIÓN GLOBAL DE BOTONES PARA MÓVILES --- */
.btn {
    display: inline-block;
    white-space: normal; /* Permite que el texto baje de línea naturalmente */
    line-height: 1.4;    /* Le da espacio de respiración si hay dos líneas */
    height: auto;
    text-align: center;
    box-sizing: border-box;
}

/* Regla específica para pantallas de celulares (delgadas) */
@media (max-width: 500px) {
    .btn.btn-primary {
        padding: 1rem 1.5rem !important; /* Reduce el padding lateral excesivo */
        font-size: 1rem !important;      /* Ajusta el tamaño de la fuente */
        width: 100%;                     /* Hace que el botón ocupe todo el ancho disponible */
        max-width: 320px;                /* Evita que sea gigante en tablets pequeñas */
    }
}
/* ==========================================================================
   CORRECCIÓN DEFINITIVA DE DESBORDAMIENTO (ANTI-OVERFLOW ESTRICTO)
   ========================================================================== */

/* 1. Bloqueo a nivel de página */
html, body {
    overflow-x: hidden !important; /* Fuerza la eliminación del scroll horizontal */
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
}

/* 2. Blindaje de Secciones y Contenedores */
.about-section, .about-grid, .about-content, .about-visual, .ceo-container {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow: hidden; /* Oculta cualquier cosa que intente salir de la caja */
}

/* 3. Corrección Estricta para la Tarjeta del CEO */
.ceo-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* Ajustamos el padding para que no empuje el contenido en móviles */
    padding: 2rem 1.5rem !important; 
}

.ceo-layout, .ceo-info {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 4. Control de Textos Largos */
.ceo-info h3, .ceo-name, .ceo-bio, p {
    /* Estas tres líneas obligan a CUALQUIER texto a bajar de línea si no cabe */
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100%;
}

/* 5. Terminal Animada: Prevención del efecto Typewriter */
.terminal-pro {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.typewriter {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis; /* Si el texto de la terminal choca, pone "..." */
}

/* ==========================================================================
   AJUSTES FINOS PARA PANTALLAS DE CELULAR (TIPO iPHONE)
   ========================================================================== */
@media (max-width: 600px) {
    /* Márgenes más amigables para pantallas estrechas */
    .about-section {
        padding: 3rem 1rem !important;
    }
    
    /* Reducimos ligeramente el tamaño de la foto para que no apriete el texto */
    .ceo-photo-frame {
        width: 160px !important;
        height: 160px !important;
    }
    
    /* Ajustamos el título del CEO para que no se rompa feo */
    .ceo-name {
        font-size: 1.8rem !important;
    }
}