/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #1a0000;
    --primary-red: #400000;
    --accent-red: #660000;
    --light-red: #cc6666;
    --glow-red: #ff9999;
    --text-light: #f0f0f0;
    --text-muted: #cccccc;
    --card-bg: rgba(30, 0, 0, 0.7);
    --border-color: rgba(102, 0, 0, 0.3);
    --transition-speed: 0.3s;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-light);
    background-color: var(--primary-dark);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Fondo con efecto de gradiente y orbe interactivo */
.background-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 0% 0%, var(--primary-red) 0%, var(--primary-dark) 70%);
    z-index: -2;
    pointer-events: none;
}

.background-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
                rgba(255, 153, 153, 0.15) 0%, 
                rgba(64, 0, 0, 0.1) 30%, 
                transparent 70%);
    z-index: -1;
    transition: background 0.1s ease;
    pointer-events: none;
}

/* Panel lateral izquierdo */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    padding: 2rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: rgba(10, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 10;
    overflow: hidden;
}

.profile {
    margin-bottom: 1.5rem;
}

.name {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--text-light), var(--light-red));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
}

.title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--light-red);
    margin-bottom: 1.2rem;
    font-family: 'JetBrains Mono', monospace;
}

.description {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Navegación vertical */
.nav-vertical {
    margin: 1.5rem 0;
}

.nav-vertical ul {
    list-style: none;
}

.nav-vertical li {
    margin-bottom: 0.8rem;
}

.nav-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color var(--transition-speed) ease, transform 0.2s ease;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background-color: var(--light-red);
    transition: height var(--transition-speed) ease;
}

.nav-link:hover {
    color: var(--text-light);
    transform: translateX(5px);
}

.nav-link.active {
    color: var(--text-light);
}

.nav-link.active::before {
    height: 70%;
}

/* Enlaces sociales */
.social-links {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(64, 0, 0, 0.3);
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.social-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 153, 153, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.social-link:hover {
    color: var(--text-light);
    background-color: rgba(102, 0, 0, 0.5);
    transform: translateY(-3px);
}

.social-link:hover::after {
    opacity: 1;
}

.social-link i {
    font-size: 1.2rem;
}

/* Contenido principal */
.main-content {
    margin-left: 320px;
    width: calc(100% - 320px);
    padding: 3rem 8rem;
}

.content-section {
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.content-section.active {
    display: block;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 3px;
    background-color: var(--light-red);
    border-radius: 2px;
}

.section-content {
    max-width: 800px;
}

.section-content p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

/* Estilos para línea de tiempo de experiencia */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: var(--accent-red);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-year {
    position: absolute;
    left: -2rem;
    top: 0;
    transform: translateX(-100%);
    background-color: var(--accent-red);
    color: var(--text-light);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 70px;
    text-align: center;
}

.timeline-content {
    padding-left: 1.5rem;
}

.timeline-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

/* Estilos para etiquetas */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    background-color: rgba(102, 0, 0, 0.3);
    color: var(--light-red);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid rgba(204, 102, 102, 0.2);
    transition: all var(--transition-speed) ease;
}

.tag:hover {
    background-color: rgba(102, 0, 0, 0.5);
    border-color: rgba(204, 102, 102, 0.5);
    transform: translateY(-2px);
}

/* Estilos para proyectos */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 1.8rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed) ease;
    backdrop-filter: blur(5px);
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: rgba(204, 102, 102, 0.5);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.project-description {
    color: var(--text-muted);
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.empty-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    background-color: rgba(20, 0, 0, 0.5);
    border: 2px dashed var(--border-color);
}

.empty-card:hover {
    border-color: var(--light-red);
    background-color: rgba(30, 0, 0, 0.7);
}

.empty-project-content {
    text-align: center;
    color: var(--text-muted);
}

.empty-project-content i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--light-red);
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Keyframes para animaciones de entrada sofisticadas */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInItem {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Estados iniciales y animados del body */
body.loaded .sidebar {
    animation: slideInFromLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

body.loaded .main-content {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
}

/* Estilos iniciales sin animación */
.sidebar {
    opacity: 0;
    transform: translateX(-30px);
}

.main-content {
    opacity: 0;
    transform: translateY(30px);
}

/* Animación en cascada para elementos de navegación */
.nav-item {
    opacity: 0;
    transform: translateX(-20px);
}

body.loaded .nav-item {
    animation: slideInItem 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

body.loaded .nav-item[data-index="0"] {
    animation-delay: 0.8s;
}

body.loaded .nav-item[data-index="1"] {
    animation-delay: 1.0s;
}

body.loaded .nav-item[data-index="2"] {
    animation-delay: 1.2s;
}

/* Animación pop-in para iconos sociales */
.social-item {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
}

body.loaded .social-item {
    animation: popIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

body.loaded .social-item[data-index="0"] {
    animation-delay: 1.4s;
}

body.loaded .social-item[data-index="1"] {
    animation-delay: 1.5s;
}

body.loaded .social-item[data-index="2"] {
    animation-delay: 1.6s;
}

body.loaded .social-item[data-index="3"] {
    animation-delay: 1.7s;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
        padding: 2rem 1.5rem;
    }
    
    .main-content {
        margin-left: 280px;
        width: calc(100% - 280px);
        padding: 2rem;
    }
    
    .name {
        font-size: 1.9rem;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow-x: hidden;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 2rem;
    }
    
    .profile {
        margin-bottom: 1.5rem;
    }
    
    .nav-vertical {
        margin: 1.5rem 0;
    }
    
    .social-links {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 2rem;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline {
        padding-left: 1.5rem;
    }
    
    .timeline-year {
        position: relative;
        left: 0;
        transform: none;
        margin-bottom: 0.5rem;
        display: inline-block;
    }
    
    .timeline::before {
        left: 0.5rem;
    }
    
    .timeline-content {
        padding-left: 1rem;
    }
}

@media (max-width: 480px) {
    .sidebar, .main-content {
        padding: 1.5rem;
    }
    
    .name {
        font-size: 1.7rem;
    }
    
    .title {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
    }
    
    .tags {
        gap: 0.4rem;
        margin-top: 1rem;
    }
    
    .tag {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }
}