/* =========================================
   VARIABLES GLOBALES
========================================= */
:root {
    --bg-color: #050505;
    --surface-color: #111111;
    --surface-hover: #1a1a1a;
    --text-primary: #f0f0f0;
    --text-secondary: #999999;
    --accent-color: #3b82f6; /* Azul eléctrico */
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.3);
    
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    --border-radius: 12px;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================
   RESET & ESTILOS BASE
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-color);
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Tipografía */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: #ffffff;
    line-height: 1.2;
}

.highlight {
    color: var(--accent-color);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-padding {
    padding: 100px 0;
}

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

/* =========================================
   BOTONES
========================================= */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    border: none;
    font-family: var(--font-main);
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-block {
    display: block;
    width: 100%;
}

/* =========================================
   HEADER & NAVEGACIÓN
========================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 1000;
    transition: all var(--transition-fast);
    background: transparent;
}

.header.scrolled {
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
}

.logo span {
    color: var(--accent-color);
}

.nav-list {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--accent-color);
    transition: width var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* =========================================
   HERO SECTION
========================================= */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 2;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 10px;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 20px;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

.hero-3d {
    flex: 1;
    height: 500px;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

.hero-3d spline-viewer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% + 120px);
    transform: translateY(-60px);
}

spline-viewer::part(logo) {
    display: none !important;
}

/* =========================================
   ABOUT / FILOSOFÍA
========================================= */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.about-card {
    position: relative;
    background: linear-gradient(145deg, rgba(25,25,30,0.8) 0%, rgba(15,15,20,0.9) 100%);
    padding: 40px 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    z-index: 1;
}

.about-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, var(--accent-color), transparent, #8b5cf6);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.about-card:hover::before {
    opacity: 1;
}

.about-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px rgba(59, 130, 246, 0.2);
}

.card-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    position: relative;
    color: var(--accent-color);
    transition: all 0.4s ease;
}

.card-icon-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: var(--accent-color);
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.about-card:hover .card-icon-wrapper {
    background: var(--accent-color);
    color: #fff;
    transform: rotate(-10deg) scale(1.1);
}

.about-card:hover .card-icon-wrapper::after {
    opacity: 0.5;
}

.card-icon-wrapper svg {
    width: 32px;
    height: 32px;
}

.about-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

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

/* =========================================
   HABILIDADES
========================================= */
.skills-carousel-container {
    overflow: hidden;
    padding: 20px 0;
    /* Efecto de desvanecimiento a los bordes */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.swiper-wrapper {
    transition-timing-function: linear !important;
}

.swiper-slide {
    width: auto !important;
}

.skill-card-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: linear-gradient(145deg, rgba(25,25,30,0.6) 0%, rgba(15,15,20,0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px 40px;
    min-width: 150px;
    height: 150px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
    cursor: grab;
}

.skill-card-vertical:active {
    cursor: grabbing;
}

.skill-card-vertical:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), 0 0 15px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.skill-card-vertical i, .skill-card-vertical svg {
    font-size: 3rem;
    transition: transform 0.3s ease;
}

.skill-card-vertical:hover i, .skill-card-vertical:hover svg {
    transform: scale(1.1) rotate(-5deg);
}

.skill-card-vertical span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* =========================================
   PROYECTOS
========================================= */

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.project-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform var(--transition-fast);
    display: flex;
    flex-direction: column;
}



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

.mockup-showcase {
    position: relative;
    width: 100%;
    height: 200px;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

@media (min-width: 900px) {
    .mockup-showcase {
        height: 200px;
    }
}

.mockup-device {
    position: absolute;
    background: #0f172a;
    border-radius: 12px;
    border: 3px solid #334155;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.device-screen {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #111827;
}

.device-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 5s ease;
    cursor: zoom-in;
}

.project-card:hover .device-screen img {
    transform: translateY(-10%); /* Efecto sutil de scroll en la imagen */
}

/* Laptop (Center) */
.mockup-laptop {
    width: 260px;
    height: 160px;
    z-index: 2;
    bottom: 40px;
    border-width: 4px;
    border-bottom-width: 12px;
    border-radius: 8px 8px 4px 4px;
}

/* Tablet (Left) */
.mockup-tablet {
    width: 130px;
    height: 170px;
    left: 2%;
    bottom: 30px;
    z-index: 1;
    transform: rotate(-5deg);
}

/* Phone (Right) */
.mockup-phone {
    width: 80px;
    height: 150px;
    right: 4%;
    bottom: 20px;
    z-index: 3;
    transform: rotate(8deg);
    border-radius: 16px;
    border-width: 4px;
}
.mockup-phone .device-screen {
    border-radius: 12px;
}

/* Escalar en pantallas grandes */
@media (min-width: 900px) {
    .mockup-laptop {
        width: 250px;
        height: 156px;
        bottom: 25px;
        border-bottom-width: 10px;
    }
    .mockup-tablet {
        width: 110px;
        height: 145px;
        left: 2%;
        bottom: 15px;
    }
    .mockup-phone {
        width: 65px;
        height: 130px;
        right: 4%;
        bottom: 10px;
    }
}

/* Hover Effects 3D */
.project-card:hover .mockup-laptop {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), 0 0 20px rgba(59, 130, 246, 0.2);
}
.project-card:hover .mockup-tablet {
    transform: scale(1.05) translate(-10px, -5px) rotate(-8deg);
}
.project-card:hover .mockup-phone {
    transform: scale(1.05) translate(10px, -10px) rotate(12deg);
}

.project-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-info h3 {
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.project-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

@media (min-width: 900px) {
    .project-info {
        padding: 25px;
    }
    .project-info h3 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    .project-info p {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 15px;
    }
}

.project-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.project-tags span {
    font-size: 0.8rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--accent-color);
}

/* =========================================
   CONTACTO
========================================= */
.contact-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    transition: border-color var(--transition-fast);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* =========================================
   FOOTER
========================================= */
.footer {
    background-color: var(--surface-color);
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer p {
    color: var(--text-secondary);
}

.footer .footer-note {
    font-size: 0.85rem;
    margin-top: 10px;
    opacity: 0.7;
}

.social-links {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    font-size: 1.1rem;
}

.social-links a {
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.social-links a:hover {
    color: var(--accent-color);
}

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 900px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
        padding-top: 40px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-description {
        margin: 0 auto 30px;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-3d {
        width: 100%;
        height: 400px;
    }
}

@media (max-width: 768px) {
    .nav-list {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* =========================================
   LIGHTBOX MODAL
========================================= */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
    transform: scale(1.1);
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* =========================================
   ALL PROJECTS MODAL
========================================= */
.all-projects-modal {
    display: none;
    position: fixed;
    z-index: 9998;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.all-projects-modal.active {
    display: block;
}

.all-projects-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.all-projects-header .section-title {
    margin: 0;
    font-size: 1.8rem;
}

.all-projects-close {
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.all-projects-close:hover {
    color: var(--accent-color);
}

/* Ocultar proyectos despues del 4to en la grid principal */
.main-projects-grid .project-card:nth-child(n+5) {
    display: none !important;
}

/* =========================================
   Boton Flotante WhatsApp
========================================= */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    animation: float-pulse 2s infinite;
}

.whatsapp-float svg {
    width: 35px;
    height: 35px;
    fill: #fff;
}

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 15px 30px rgba(37, 211, 102, 0.6);
    background-color: #1ebe57;
}

@keyframes float-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    .whatsapp-float svg {
        width: 30px;
        height: 30px;
    }
}
