/* --- VARIABLES GLOBALES --- */
:root {
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --glass-bg: rgba(20, 20, 25, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.15);
    --accent-cyan: #00f0ff;
}

/* Escala global al 80% */
html { font-size: 80%; } 

/* =========================================
   MAGIA ANTI-BARRAS DE SCROLL GLOBALES
   ========================================= */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', sans-serif; 
    
    /* Oculta en Firefox, IE y Edge */
    scrollbar-width: none !important; 
    -ms-overflow-style: none !important; 
}

/* Oculta en Chrome, Edge (Chromium), Safari y Opera */
*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

body {
    background-color: #050505;
    color: var(--text-main);
    overflow: hidden; 
    width: 100vw; height: 100dvh;
}


#webgl-canvas { position: absolute; top: 0; left: 0; width: 100vw; height: 100dvh; z-index: 1; outline: none; }
#ui-layer { position: absolute; top: 0; left: 0; width: 100vw; height: 100dvh; z-index: 10; pointer-events: none; display: flex; flex-direction: column; justify-content: center; }

.interactive { pointer-events: auto; }

/* Estilo Base Tarjetas de Cristal */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: transform 0.3s, background 0.3s, border 0.3s;
}

/* --- SISTEMA DE VISTAS --- */
.view-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 8vw;
    opacity: 0; visibility: hidden; transform: scale(0.95);
    transition: all 0s;
    overflow-y: auto; scrollbar-width: none; 
    padding-bottom: 140px; 
}
.view-container::-webkit-scrollbar { display: none; }
.view-container.active { opacity: 1; visibility: visible; transform: scale(1); }
.view-title { font-size: 3rem; font-weight: 700; text-align: center; margin-bottom: 40px; width: 100%; }

/* --- VISTA: INICIO --- */
.left-hero { max-width: 550px; padding: 20px 0; }

.hero-profile { display: flex; align-items: center; gap: 30px; text-align: left; margin-bottom: 20px; }
.hero-profile h1 { font-size: 4rem; font-weight: 700; line-height: 1.1; letter-spacing: -2px; }
.hero-profile h1 span { color: var(--text-muted); font-weight: 300; }
.profile-img { width: 170px; height: 170px; border-radius: 50%; object-fit: cover; border: 2px solid var(--glass-border); flex-shrink: 0;}

.left-hero p { font-size: 1.2rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 30px; }

.hero-actions { display: flex; gap: 15px; flex-wrap: wrap; }
.btn { padding: 14px 28px; background: #fff; color: #000; border-radius: 40px; text-decoration: none; font-weight: 600; cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 8px; transition: 0.3s; font-size: 1rem;}
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(255,255,255,0.3); }
.btn-outline { background: transparent; color: #fff; border: 1px solid var(--glass-border); }
.btn-outline:hover { background: rgba(255,255,255,0.1); box-shadow: none; }

.right-widgets { display: flex; flex-direction: column; gap: 15px; width: 320px; }
.widget-card { padding: 20px; display: flex; align-items: center; gap: 20px; cursor: pointer; border-radius: 20px; }
.widget-card:hover { transform: translateX(-10px); background: var(--glass-hover); }
.widget-icon { width: 50px; height: 50px; border-radius: 14px; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; border: 1px solid var(--glass-border); color: var(--accent-cyan); }

/* --- FIX DE LA BARRA DERECHA EN PROYECTOS --- */
#view-projects { justify-content: center; flex-direction: column; padding-top: 60px; align-items: center; padding-left: 0; padding-right: 0;}

.projects-slider {
    display: flex; gap: 30px; 
    overflow-x: hidden; 
    padding: 50px 0 60px 0; 
    width: 100vw; 
    max-width: 100%; /* Fix para eliminar artefactos en los bordes */
    align-items: center;
}

.project-card { 
    width: 320px; min-width: 320px; max-width: 320px; 
    padding: 20px; flex-shrink: 0; pointer-events: auto; cursor: pointer;
    transition: transform 0.4s, background 0.3s, border 0.3s;
}
.project-card img { width: 100%; height: 180px; object-fit: cover; border-radius: 16px; margin-bottom: 15px; transition: 0.4s; pointer-events: none;}
.project-card:hover img { transform: scale(1.05); }

/* --- VISTA: PLANES --- */
#view-plans { justify-content: center; flex-direction: column; padding-top: 80px;}
.grid-cards { display: flex; gap: 30px; justify-content: center; flex-wrap: wrap; width: 100%;}
.plan-card { width: 90%; max-width: 300px; padding: 40px 30px; text-align: center; position: relative; }
.plan-card.pro { border-color: var(--accent-cyan); background: rgba(0, 240, 255, 0.05); }
.tag-popular { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent-cyan); color: #000; padding: 5px 15px; border-radius: 20px; font-weight: bold; font-size: 0.75rem; }
.plan-price { font-size: 2.8rem; font-weight: 700; margin: 15px 0; color: #fff; }
.plan-price span { font-size: 1rem; color: var(--text-muted); }
.plan-features { list-style: none; text-align: left; margin-bottom: 30px; color: var(--text-muted); }
.plan-features li { margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.plan-features li i { color: var(--accent-cyan); font-size: 1.2rem; }

/* --- VISTA: CONTACTO --- */
#view-contact { justify-content: center; flex-direction: column; padding-top: 80px;}
.contact-form { width: 100%; max-width: 450px; padding: 40px; }
input, textarea { width: 100%; padding: 16px 20px; margin-bottom: 20px; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); border-radius: 16px; color: #fff; outline: none; transition: 0.3s; font-size: 1rem; }
input:focus, textarea:focus { border-color: var(--accent-cyan); background: rgba(0,0,0,0.5); }

/* --- DOCK INFERIOR --- */
.bottom-dock {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px; padding: 10px 20px; border-radius: 40px;
    background: rgba(10, 10, 15, 0.7); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border); z-index: 1000;
}
.dock-btn { 
    color: var(--text-muted); background: transparent; border: none; font-size: 1rem; font-weight: 500; 
    padding: 10px 20px; border-radius: 30px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.3s;
}
.dock-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.dock-btn.active { color: #fff; background: rgba(255,255,255,0.15); box-shadow: inset 0 1px 1px rgba(255,255,255,0.2); }

/* --- FIX DE VENTANAS FLOTANTES (MODALES) CORTADAS --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
    background: rgba(5, 5, 5, 0.6); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    z-index: 2000; 
    display: flex; 
    justify-content: center; 
    /* Cambiado de center a flex-start para alinear desde arriba y permitir scroll */
    align-items: flex-start; 
    opacity: 0; visibility: hidden; transition: 0.3s ease; 
    /* FIX: Permitir scroll dentro de la ventana de fondo si el modal es muy alto */
    overflow-y: auto; 
    scrollbar-width: none;
    padding: 80px 20px; /* Padding superior crea espacio visual arriba y abajo */
}
.modal-overlay::-webkit-scrollbar { display: none; }
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-content { 
    max-width: 500px; 
    width: 95%; /* Un poco más responsivo */
    padding: 40px; 
    position: relative; 
    transform: scale(0.9) translateY(20px); /* Animación más sutil */
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1); /* Curva de animación Spatial */
    margin-bottom: 30px; /* Espacio extra para que el dock no tape al hacer scroll abajo */
}
.modal-overlay.active .modal-content { transform: scale(1) translateY(0); }
.modal-content img { width: 100%; border-radius: 16px; margin: 20px 0; height: 200px; object-fit: cover; }
.modal-content p { color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }
.close-btn { position: absolute; top: 20px; right: 20px; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; z-index: 10; }

/* =========================================
   RESPONSIVE DESIGN 
   ========================================= */
@media (max-width: 1024px) {
    #view-home { flex-direction: column; justify-content: flex-start; text-align: center; padding-top: 60px; gap: 40px;}
    .hero-profile { justify-content: center;}
    .hero-actions { justify-content: center; }
    .right-widgets { width: 100%; max-width: 500px; }
    .widget-card { justify-content: flex-start; text-align: left; }
}

@media (max-width: 768px) {
    .view-container { padding: 40px 5vw 140px 5vw; } 
    .hero-profile { gap: 15px;}
    .hero-profile h1 { font-size: 3.2rem; }
    .profile-img { width: 120px; height: 120px; } 
    h2.view-title { font-size: 2.5rem; }

    .bottom-dock { width: 92%; padding: 8px; justify-content: space-between; bottom: 20px; gap: 0;}
    .dock-btn { font-size: 0.85rem; padding: 10px 12px; flex-direction: column; gap: 4px; border-radius: 16px;}
    .dock-btn i { font-size: 1.2rem; }
    
    .project-card { width: 280px; min-width: 280px; max-width: 280px; padding: 15px;}
    .project-card img { height: 150px; }
    
    .modal-content { padding: 30px; } /* Modal más compacto en móvil */
    .close-btn { top: 15px; right: 15px; }
}