/* Reset and Base Styles */
@import url('normalize.css');

/* CSS Variables */
:root {
    --primary-color: #14b8a6;
    --secondary-color: #06b6d4;
    --accent-color: #22d3ee;
    --info-color: #0ea5e9;
    --dark-bg: #111827;
    --dark-surface: #1f2937;
    --dark-border: #374151;
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Dark Mode Theme */
body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-secondary);
    background-color: var(--dark-bg);
    overflow-x: hidden;
}

/* Background Pattern */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(20, 184, 166, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(34, 211, 238, 0.1) 0%, transparent 50%);
    background-size: 100% 100%;
    z-index: -1;
}

.background-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(20, 184, 166, 0.03) 35px, rgba(20, 184, 166, 0.03) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(6, 182, 212, 0.03) 35px, rgba(6, 182, 212, 0.03) 70px);
    z-index: -1;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #0f766e, #0d5f56);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #ffffff, #e0f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: white;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #ffffff, #e0f2fe);
    transition: width 0.3s ease;
}

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

.cv-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cv-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(20, 184, 166, 0.4);
}

/* Main Content */
.main {
    margin-top: 80px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.7), rgba(31, 41, 55, 0.7)),
                url('recursos/hero-banner.jpg') center/cover no-repeat;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('recursos/hero-banner.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.4;
    z-index: -1;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 1rem;
    width: 100%;
}

.hero-text {
    animation: fadeInLeft 1s ease-out;
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Typing Animation */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 50% { border-color: transparent; }
    51%, 100% { border-color: #ffffff; }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8) !important;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #ffffff;
    animation: typing 3s steps(40) 1s 1 normal, blink 0.75s step-end infinite;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Hero Highlights */
.hero-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
}

.highlight-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(20, 184, 166, 0.3);
}

.highlight-item i {
    font-size: 1.75rem;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.highlight-item div {
    display: flex;
    flex-direction: column;
}

.highlight-item strong {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.highlight-item span {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Hero Skills Carousel */
.hero-skills-carousel {
    width: 100%;
    overflow: hidden;
    margin: 2rem 0;
    padding: 1.5rem 0;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.skills-track {
    display: flex;
    animation: scroll 18s linear infinite;
    width: fit-content;
}

.skill-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 90px;
    padding: 1rem 0.75rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.skill-logo i {
    font-size: 1.75rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.skill-logo span {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-muted);
}

.skill-logo:hover {
    transform: scale(1.08);
    background: rgba(20, 184, 166, 0.1);
    border-radius: 0.5rem;
}

.skill-logo:hover i {
    color: var(--accent-color);
    transform: translateY(-2px);
}

.skill-logo:hover span {
    color: var(--text-secondary);
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.hero-skills-carousel:hover .skills-track {
    animation-play-state: paused;
}

/* Hero CTA Buttons */
.hero-cta {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.cta-button.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.cta-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(20, 184, 166, 0.4);
}

.cta-button.secondary {
    background: rgba(31, 41, 55, 0.8);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    backdrop-filter: blur(10px);
}

.cta-button.secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Hero Video */
.hero-video {
    animation: fadeInRight 1s ease-out;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Projects Section */
.projects {
    padding: 6rem 2rem;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(31, 41, 55, 0.95));
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(20, 184, 166, 0.3);
}

.project-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 2rem;
}

.project-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: rgba(20, 184, 166, 0.15);
    color: #67e8f9;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(20, 184, 166, 0.3);
}

/* Timeline Section */
.timeline-section {
    padding: 6rem 2rem;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(31, 41, 55, 0.95));
}

.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(135deg, var(--info-color), var(--accent-color));
    transform: translateX(-50%);
    opacity: 0.3;
    border-radius: 1px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    opacity: 1; /* Hacer visible por defecto */
    transform: none; /* Eliminar transformación inicial */
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Si las animaciones están habilitadas, ocultar inicialmente */
@media (prefers-reduced-motion: no-preference) {
    .timeline-item {
        opacity: 0;
        transform: translateY(20px);
    }
}

.timeline-item:nth-child(odd) {
    padding-right: calc(50% + 1rem);
    text-align: right;
}

.timeline-item:nth-child(even) {
    padding-left: calc(50% + 1rem);
    text-align: left;
}

.timeline-content {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 0.75rem;
    padding: 1.5rem;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease;
    backdrop-filter: blur(10px);
}

.timeline-content:hover {
    transform: translateY(-3px);
    border-color: rgba(14, 165, 233, 0.5);
}

.timeline-icon {
    position: absolute;
    top: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: white;
    z-index: 2;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.timeline-item:nth-child(odd) .timeline-icon {
    right: calc(-1rem - 18px);
}

.timeline-item:nth-child(even) .timeline-icon {
    left: calc(-1rem - 18px);
}

.experience-item .timeline-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.education-item .timeline-icon {
    background: linear-gradient(135deg, var(--info-color), var(--accent-color));
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--info-color);
    font-weight: 500;
    margin-bottom: 0.25rem;
    opacity: 0.8;
}

.timeline-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.timeline-content h4 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 400;
}

.timeline-content ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
}

.timeline-content li {
    color: var(--text-secondary);
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1rem;
    line-height: 1.4;
    font-size: 0.875rem;
}

.timeline-content li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--info-color);
    font-weight: bold;
    font-size: 0.75rem;
}

.timeline-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.timeline-skills .skill-tag {
    background: rgba(14, 165, 233, 0.15);
    color: #67e8f9;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

/* Company Logos */
.company-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.inline-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 2px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Contact Section */
.contact {
    padding: 6rem 2rem;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(31, 41, 55, 0.95));
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-content h2 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3rem;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
}

.contact-item:hover {
    transform: translateY(-5px);
    border-color: rgba(20, 184, 166, 0.3);
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact-item span {
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(20, 184, 166, 0.4);
}

/* Footer */
.footer {
    background: var(--dark-surface);
    color: white;
    text-align: center;
    padding: 2rem;
}

/* Animations */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        padding: 0 1rem;
    }
    
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-link {
        font-size: 0.875rem;
    }
    
    .cv-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-highlights {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hero-cta {
        justify-content: center;
    }
    
    .cta-button {
        flex: 1;
        min-width: 150px;
        justify-content: center;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .contact-content h2 {
        font-size: 2rem;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
    }

    .timeline-line {
        left: 1.5rem;
    }
    
    .timeline-item {
        padding-left: 3rem !important;
        padding-right: 0 !important;
        text-align: left !important;
        margin-bottom: 1.5rem;
    }
    
    .timeline-icon {
        left: calc(-1rem - 18px) !important;
        right: auto !important;
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
        top: 1rem;
    }
    
    .timeline-content {
        padding: 1rem;
    }
    
    .timeline-content h3 {
        font-size: 1rem;
    }
    
    .timeline-content h4 {
        font-size: 0.8125rem;
    }
    
    .timeline-content li {
        font-size: 0.8125rem;
    }
}
