/* Variables CSS */
:root {
    --primary-color: #8b5cf6;
    --secondary-color: #6c757d;
    --accent-color: #10b981;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    --gradient-secondary: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    --gradient-contact: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --navbar-height: 76px;
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #ffffff;
    padding-top: var(--navbar-height);
}

/* Navbar */
.navbar {
    background-color: rgba(33, 37, 41, 0.95) !important;
    backdrop-filter: blur(15px);
    transition: var(--transition);
    padding: 1rem 0;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Navbar con más transparencia al hacer scroll */
.navbar-scrolled {
    background-color: rgba(33, 37, 41, 0.98) !important;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-light);
}

/* Navbar en la parte superior (sin scroll) - más opaco */
.navbar-top {
    background-color: rgba(33, 37, 41, 0.98) !important;
    backdrop-filter: blur(10px);
}

/* Navbar brand oculto - solo centrar navegación */
.navbar-brand {
    display: none;
}

/* Centrar el navbar - sin brand */
.navbar-nav {
    text-align: center;
}

.navbar-toggler {
    border: 2px solid rgba(139, 92, 246, 0.6);
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.navbar-toggler::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.navbar-toggler:hover::before {
    left: 100%;
}

.navbar-toggler:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(6, 182, 212, 0.3) 100%);
    border-color: rgba(139, 92, 246, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.25);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Menú desplegable simple que funciona */
.navbar-collapse {
    background: rgba(33, 37, 41, 0.95);
    margin-top: 1rem;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 0.8rem 1rem;
    margin-bottom: 0.3rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-align: center;
}

.navbar-nav .nav-link:hover {
    color: #8b5cf6 !important;
    background: rgba(139, 92, 246, 0.1);
}

.navbar-nav .nav-link.active {
    color: #8b5cf6 !important;
    background: rgba(139, 92, 246, 0.15);
}

.navbar-nav .nav-link:last-child {
    margin-bottom: 0;
}

/* Desktop navbar links */
@media (min-width: 992px) {
    .navbar-collapse {
        background: none;
        backdrop-filter: none;
        margin-top: 0;
        border-radius: 0;
        border: none;
        padding: 0;
        box-shadow: none;
    }
    
    .navbar-nav .nav-link {
        font-weight: 500;
        margin: 0 1rem;
        transition: var(--transition);
        position: relative;
        padding: 0.8rem 0;
        color: rgba(255, 255, 255, 0.9) !important;
        border-radius: 0;
        background: none;
        margin-bottom: 0;
        border: none;
        font-size: 1rem;
    }
    
    .navbar-nav .nav-link::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 0;
        left: 50%;
        background: #8b5cf6;
        transition: var(--transition);
        transform: translateX(-50%);
    }
    
    .navbar-nav .nav-link:hover::after,
    .navbar-nav .nav-link.active::after {
        width: 80%;
    }
    
    .navbar-nav .nav-link:hover {
        color: #8b5cf6 !important;
        transform: none;
        box-shadow: none;
        border-color: transparent;
        background: none;
    }

    .navbar-nav .nav-link.active {
        color: #8b5cf6 !important;
        box-shadow: none;
        border-color: transparent;
        background: none;
    }
}

/* Botones personalizados */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: var(--transition);
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: var(--gradient-primary);
}

.btn-outline-primary {
    border: 2px solid #8b5cf6;
    color: #8b5cf6;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background: #8b5cf6;
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

/* Secciones */
.section-padding {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.section-title.text-start::after {
    left: 0;
    transform: none;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 3rem;
}

/* Estilos para Sobre mí */
.about-content .lead {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--secondary-color);
}

.tech-stack {
    margin-top: 2rem;
}

.tech-badges .badge {
    background-color: #8b5cf6 !important;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.about-image img {
    transition: var(--transition);
}

.about-image img:hover {
    transform: scale(1.05);
}

/* Timeline para experiencia */
.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-primary);
    margin-left: -1px;
}

.timeline-item {
    position: relative;
    padding-left: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid white;
    box-shadow: var(--shadow-light);
}

.timeline-item .card {
    margin-left: 0;
}

.tech-used {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.8s ease forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.8s ease forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.8s ease forwards;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    margin-top: 0 !important;
}

.social-links a {
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: #8b5cf6 !important;
    transform: translateY(-2px);
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--navbar-height);
}

/* RESPONSIVE - MÓVIL */
@media (max-width: 768px) {
    :root {
        --navbar-height: 70px;
    }
    
    body {
        padding-top: 70px;
    }
    
    .navbar {
        height: 70px !important;
        padding: 0.75rem 0 !important;
        background-color: rgba(33, 37, 41, 0.98) !important; 
    }
    
    /* Transparente al hacer scroll en móvil */
    .navbar-scrolled {
        background-color: rgba(33, 37, 41, 0.7) !important;
    }
    
    /* Volver a oscuro cuando menú abierto */
    .navbar.menu-open {
        background-color: rgba(33, 37, 41, 0.98) !important;
    }
    
    .navbar-toggler {
        margin: 0;
        padding: 0.5rem 0.7rem;
    }
    
    /* Menú desplegable con efecto scale rápido */
    .navbar-collapse {
        background: rgba(33, 37, 41, 0.95) !important;
        margin-top: 1rem !important;
        border-radius: 8px !important;
        padding: 1rem !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        transform: scale(0.95);
        transform-origin: top center;
        transition: transform 0.2s ease !important;
    }
    
    /* Cuando está visible */
    .navbar-collapse.show {
        transform: scale(1);
    }
    
    /* Estado de transición */
    .navbar-collapse.collapsing {
        transform: scale(0.98);
        transition: transform 0.2s ease !important;
        height: auto !important;
    }

    .navbar-nav .nav-link {
        color: rgba(255, 255, 255, 0.9) !important;
        padding: 0.8rem 1rem !important;
        margin-bottom: 0.3rem !important;
        border-radius: 6px !important;
        transition: all 0.2s ease !important;
        text-align: center !important;
        background: none !important;
        border: none !important;
        font-size: 1rem !important;
        font-weight: 500 !important;
    }

    .navbar-nav .nav-link:hover {
        color: #8b5cf6 !important;
        background: rgba(139, 92, 246, 0.1) !important;
    }

    .navbar-nav .nav-link.active {
        color: #8b5cf6 !important;
        background: rgba(139, 92, 246, 0.15) !important;
    }

    .navbar-nav .nav-link:last-child {
        margin-bottom: 0 !important;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-padding {
        padding: 60px 0;
    }
    
    .timeline::before {
        left: 15px;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-item::before {
        left: 9px;
    }
    
    .about-image {
        margin-top: 2rem;
    }
    
    .tech-badges .badge {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
}

/* MÓVILES PEQUEÑOS */
@media (max-width: 576px) {
    .navbar {
        height: 70px !important;
        padding: 0.5rem 0 !important;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-padding {
        padding: 50px 0;
    }
}