/* Base Styles */
:root {
    --primary: #6C63FF;
    --secondary: #00F5A0;
    --accent: #FF3366;
    --dark: #121212;
    --light: #ffffff;
    --transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light); /* Cambiado a fondo blanco */
    color: var(--dark); /* Cambiado a texto oscuro */
    overflow-x: hidden;
    line-height: 1.6;
}

/* Custom Cursor - Solo visible en pantallas grandes */
.cursor-follower {
    position: fixed;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: width 0.3s, height 0.3s;
    display: none; /* Oculto por defecto, se mostrará solo en pantallas grandes */
}

.cursor-follower.active {
    width: 50px;
    height: 50px;
    background: var(--accent);
    mix-blend-mode: screen;
}

@media (min-width: 1024px) {
    body {
        cursor: none; /* Hide default cursor only on large screens */
    }
    
    .cursor-follower {
        display: block; /* Mostrar en pantallas grandes */
    }
}

/* Interactive Background */
.interactive-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3; /* Aumentar la opacidad para que sea más visible pero sutil */
}

#bgCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Layout */
header, section, footer {
    padding: 4rem 8%;
    position: relative;
}

header {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-container {
    text-align: center;
    transform: translateY(-30px);
    width: 100%; /* Asegurar que tome el ancho completo */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    max-width: 80%;
    height: auto;
    margin-bottom: 1.5rem;
}

.logo-text {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.8;
    color: var(--dark);
    max-width: 90%;
    text-align: center;
}

/* Hero Section */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    position: relative;
    color: var(--dark);
}

.highlight-text {
    position: relative;
    color: var(--primary);
}

.highlight-text::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 8px;
    background: var(--secondary);
    left: 0;
    bottom: 5px;
    z-index: -1;
    opacity: 0.6;
}

.subtitle {
    font-size: 1.5rem;
    max-width: 600px;
    margin: 0 auto 3rem;
    opacity: 0.8;
    color: var(--dark);
}

/* Floating Icons */
.floating-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 4rem;
}

.tech-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(108, 99, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.tech-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.tech-icon:hover {
    transform: translateY(-10px);
}

.tech-icon:hover::before {
    opacity: 1;
    transform: scale(1.1);
}

.icon-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
}

/* Services Section */
.services-section {
    background: rgba(108, 99, 255, 0.05);
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    color: var(--dark);
}

.section-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background: var(--primary);
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
}

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

.service-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: 15px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    z-index: 1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.service-card:hover {
    transform: translateY(-10px);
}

.service-card:hover::before {
    opacity: 0.1;
}

.service-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
    background: rgba(108, 99, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.service-card p {
    color: rgba(18, 18, 18, 0.8);
}

/* Projects Section */
.projects-section {
    background: linear-gradient(to bottom, var(--light), rgba(240, 240, 250, 1));
}

.project-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    height: 280px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.9), transparent);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-image {
    transform: scale(1.1);
}

.project-card:hover .project-info {
    transform: translateY(0);
    opacity: 1;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-tag {
    background: var(--primary);
    padding: 0.2rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    color: white;
}

/* Contact Section */
.contact-section {
    background: rgba(42, 128, 185, 0.08); /* Fondo azul muy suave que coincide con el logo */
    text-align: center;
    border-radius: 12px;
    margin: 2rem 0;
}

.contact-form-container {
    max-width: 600px;
    margin: 3rem auto 0;
    width: 100%;
    padding: 0 20px;
}

.interactive-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Mejora visual para formulario de contacto */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group label {
    position: static;
    display: block;
    margin-bottom: 0.3rem;
    font-size: 1rem;
    color: #2a80b9;
    background: none;
    text-align: left;
    pointer-events: none;
    transition: none;
    z-index: 2;
    padding: 0;
}

.interactive-input {
    width: 100%;
    padding: 0.9rem 1rem;
    background: rgba(255,255,255,0.95);
    border: 1.5px solid #2a80b9;
    border-radius: 8px;
    color: #181c27;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(42,128,185,0.04);
}

.interactive-input:focus {
    border-color: #00F5A0;
    box-shadow: 0 0 0 2px rgba(0,245,160,0.15);
}

.interactive-input:focus + label,
.interactive-input:not(:placeholder-shown) + label,
.interactive-input:not(:empty) + label {
    top: -0.7rem;
    left: 1rem;
    font-size: 0.85rem;
    color: #2a80b9;
    background: none;
    padding: 0;
}

textarea.interactive-input {
    min-height: 100px;
    resize: vertical;
}

.submit-button {
    padding: 1rem 2rem;
    background: #2a80b9; /* Color azul del logo */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #2a80b9, #1d567c); /* Tonos de azul del logo */
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.submit-button:hover {
    transform: translateY(-3px);
}

.submit-button:hover::before {
    opacity: 1;
}

/* Footer */
footer {
    background: #1d567c; /* Color azul oscuro del logo */
    padding: 3rem 8%;
    color: var(--light);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-links, .social-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link, .social-link {
    color: var(--light);
    text-decoration: none;
    transition: var(--transition);
}

.footer-link:hover, .social-link:hover {
    color: var(--secondary);
}

.copyright {
    text-align: center;
    opacity: 0.6;
    font-size: 0.9rem;
}

/* Animación de código en vivo */
.live-code-terminal {
    background: #181c27;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(42,128,185,0.08);
    max-width: 480px;
    margin: 2rem auto 0;
    padding: 1.5rem 1rem 1rem 1rem;
    color: #e0e0e0;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
    position: relative;
    overflow: hidden;
}
.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}
.terminal-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.terminal-header .red { background: #ff5f56; }
.terminal-header .yellow { background: #ffbd2e; }
.terminal-header .green { background: #27c93f; }
.terminal-title {
    margin-left: 12px;
    font-size: 0.95rem;
    color: #b0b0b0;
    font-family: inherit;
}
.code-area {
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
    min-height: 120px;
    letter-spacing: 0.5px;
    background: none;
    color: #e0e0e0;
    border: none;
    outline: none;
}
@media (max-width: 600px) {
    .live-code-terminal {
        max-width: 98vw;
        font-size: 0.95rem;
        padding: 1rem 0.5rem 0.5rem 0.5rem;
    }
    .code-area {
        font-size: 0.95rem;
    }
}

/* Interactive Elements Animations */
.interactive-element,
.interactive-section,
.interactive-text {
    transition: transform var(--transition), opacity var(--transition);
}

/* Responsive Styles - Mejorados para móviles */
@media (max-width: 1024px) {
    h1 {
        font-size: 3rem;
    }
    
    .floating-icons {
        gap: 1rem;
    }
    
    .tech-icon {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 768px) {
    header, section, footer {
        padding: 3rem 5%;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .logo-container {
        transform: translateY(0);
    }
    
    .logo-text {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    header, section, footer {
        padding: 2rem 1rem;
    }
    
    h1 {
        font-size: 2rem;
        padding: 0 10px;
    }
    
    .subtitle {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .services-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
    }
    
    .project-showcase {
        grid-template-columns: 1fr;
    }
    
    .floating-icons {
        gap: 1rem;
        margin-top: 2rem;
    }
    
    .tech-icon {
        width: 60px;
        height: 60px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-links, .social-links {
        justify-content: center;
        gap: 1.2rem;
    }
}

/* Tarjeta interactiva de tecnología */
.tech-info-card {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    min-width: 280px;
    max-width: 90vw;
    background: #fff;
    color: #181c27;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(42,128,185,0.18);
    z-index: 99999;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    font-family: 'Poppins', 'Fira Mono', monospace;
}
.tech-info-card.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}
.tech-info-card .close-btn {
    position: absolute;
    top: 12px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #2a80b9;
    cursor: pointer;
    transition: color 0.2s;
}
.tech-info-card .close-btn:hover {
    color: #FF3366;
}
.tech-info-card h3 {
    margin-top: 0;
    font-size: 1.3rem;
    color: #2a80b9;
}
.tech-info-card .tech-list {
    margin: 0.5rem 0 1rem 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}
.tech-info-card .tech-list li {
    background: #eaf6fb;
    color: #181c27;
    border-radius: 6px;
    padding: 0.3rem 0.7rem;
    font-size: 0.95rem;
}
.tech-info-card .example {
    background: #181c27;
    color: #e0e0e0;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-family: 'Fira Mono', 'Consolas', monospace;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}
@media (max-width: 600px) {
    .tech-info-card {
        min-width: 90vw;
        padding: 1.2rem 0.5rem 1rem 0.5rem;
        font-size: 0.95rem;
    }
    .tech-info-card h3 {
        font-size: 1.1rem;
    }
}

/* Animation Keyframes */
@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes colorRotate {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

@media (max-width: 600px) {
    .logo-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 40vh;
        padding-top: 2.5rem;
        padding-bottom: 1.5rem;
    }
    .logo {
        max-width: 80vw;
        height: auto;
        margin: 0 auto 0.5rem auto;
        display: block;
    }
    .tagline {
        text-align: center;
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        width: 100%;
        color: #181c27;
    }
    .live-code-terminal {
        margin-top: 2.5rem;
        margin-bottom: 1.5rem;
        min-height: 100px;
        max-width: 95vw;
        box-shadow: 0 4px 16px rgba(42,128,185,0.10);
    }
}

/* Evita que se corte la palabra 'Móvil' en el título y ajusta el tamaño de fuente en móviles para mejor visualización */
.hero-content h1.interactive-text {
    word-break: keep-all;
}

@media (max-width: 600px) {
    .hero-content h1.interactive-text {
        font-size: 2rem;
        line-height: 1.2;
        word-break: keep-all;
    }
}