/* ============================================
   VARIABLES Y ESTILOS GENERALES
   ============================================ */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #dbeafe;
    --secondary: #64748b;
    --dark: #0f172a;
    --light-soft: #f8fafc;
    --gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    color: var(--dark);
    overflow-x: hidden;
}

/* ============================================
   UTILIDADES
   ============================================ */
.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-primary-soft {
    background-color: var(--primary-soft) !important;
}

.bg-light-soft {
    background-color: var(--light-soft) !important;
}

.bg-gradient-primary {
    background: var(--gradient) !important;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background: transparent;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-link {
    font-weight: 500;
    color: var(--dark) !important;
    padding: 0.5rem 1rem !important;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 60%;
}

.nav-link:hover {
    color: var(--primary) !important;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
    padding-top: 100px;
}

.hero-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    filter: blur(80px);
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: #7c3aed;
    bottom: -50px;
    left: -50px;
    filter: blur(80px);
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: #06b6d4;
    top: 40%;
    left: 30%;
    filter: blur(60px);
}

.shape-4 {
    width: 250px;
    height: 250px;
    background: #f59e0b;
    bottom: 20%;
    right: 20%;
    filter: blur(70px);
}

.hero-image-wrapper {
    display: inline-block;
    position: relative;
}

.hero-img {
    max-width: 380px;
    border: 4px solid #fff;
    transition: transform 0.5s ease;
}

.hero-img:hover {
    transform: scale(1.02) rotate(1deg);
}

.hero-image-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110%;
    height: 110%;
    background: var(--gradient);
    border-radius: 30px;
    filter: blur(40px);
    opacity: 0.3;
    z-index: -1;
}

.floating-badge {
    position: absolute;
    width: 55px;
    height: 55px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    animation: float 4s ease-in-out infinite;
}

.badge-network {
    background: var(--primary);
    top: 10%;
    right: -20px;
    animation-delay: 0s;
}

.badge-cloud {
    background: #7c3aed;
    bottom: 20%;
    left: -25px;
    animation-delay: 1s;
}

.badge-code {
    background: #06b6d4;
    bottom: 5%;
    right: 10%;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.stat-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.1);
}

/* ============================================
   SECCIONES
   ============================================ */
section {
    position: relative;
}

/* Sobre mí */
.about-img {
    max-height: 450px;
    object-fit: cover;
    width: 100%;
}

.experience-badge {
    bottom: -20px;
    right: -20px;
    text-align: center;
    min-width: 120px;
}

.icon-box-sm {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.icon-box {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* Habilidades */
.skill-item {
    transition: var(--transition);
    border: 1px solid transparent;
}

.skill-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-soft);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.1) !important;
}

.progress {
    background-color: var(--primary-soft);
    border-radius: 10px;
}

.progress-bar {
    border-radius: 10px;
    transition: width 1.5s ease-in-out;
}

/* Proyectos */
.project-card {
    transition: var(--transition);
    border: 1px solid transparent;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(37, 99, 235, 0.12) !important;
    border-color: var(--primary-soft);
}

.project-img-wrapper {
    height: 220px;
    overflow: hidden;
}

.project-img {
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover .project-img {
    transform: scale(1.08);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.85), rgba(124, 58, 237, 0.85));
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

/* Contacto */
.contact-form-card {
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.form-control {
    border: 2px solid #e2e8f0;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.social-btn {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    transition: var(--transition);
    text-decoration: none;
}

.social-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Footer */
.footer-section {
    background: var(--dark);
    color: #cbd5e1;
}

.footer-section a:hover {
    color: var(--primary) !important;
}

/* ============================================
   ANIMACIONES ON SCROLL
   ============================================ */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll indicator */
.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .hero-section {
        text-align: center;
    }

    .hero-img {
        max-width: 280px;
    }

    .experience-badge {
        bottom: -15px;
        right: 10px;
        min-width: 100px;
        padding: 1rem !important;
    }
}

@media (max-width: 575.98px) {
    .display-3 {
        font-size: 2.2rem;
    }

    .display-6 {
        font-size: 1.8rem;
    }

    .hero-img {
        max-width: 220px;
    }

    .floating-badge {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}
