/* ========================================
   Modern Portfolio CSS - Álvaro Aláez
   ======================================== */

:root {
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --accent-color: #FF3B30;
    --dark-color: #1C1C1E;
    --light-color: #F2F2F7;
    --text-primary: #000000;
    --text-secondary: #3C3C43;
    --text-tertiary: #C7C7CC;
    --bg-light: #FFFFFF;
    --bg-dark: #000000;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Base Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--secondary-color);
}

/* ========================================
   Navigation
   ======================================== */

.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    transition: var(--transition-base);
}

.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color) !important;
}

.brand-text {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav .nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition-base);
}

.navbar-nav .nav-link:hover {
    background: var(--light-color);
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link.active {
    background: var(--gradient-secondary);
    color: white !important;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* ========================================
   Hero Section
   ======================================== */

.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 600;
    margin-bottom: 1rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-description {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.4s both;
}

.hero-buttons {
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.6s both;
}

.hero-buttons .btn {
    margin: 0.5rem;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition-base);
}

.btn-primary {
    background: white;
    color: var(--primary-color);
    border: 2px solid white;
}

.btn-primary:hover {
    background: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-primary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline-primary:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
}

.hero-social {
    animation: fadeInUp 1s ease 0.8s both;
}

.social-icon {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin: 0 0.5rem;
    transition: var(--transition-base);
}

.social-icon:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-3px);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

/* ========================================
   Sections
   ======================================== */

.section-padding {
    padding: 80px 0;
}

.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-divider {
    width: 80px;
    height: 4px;
    background: var(--gradient-secondary);
    margin: 0 auto;
    border-radius: 2px;
}

/* ========================================
   About Section
   ======================================== */

.about-image {
    text-align: center;
    margin-bottom: 2rem;
}

.about-image img {
    max-width: 300px;
    width: 100%;
    height: auto;
    border: 5px solid white;
    box-shadow: var(--shadow-lg);
}

.about-content h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.about-content .lead {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.info-list ul {
    list-style: none;
    padding: 0;
}

.info-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.info-list i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

/* ========================================
   Skills Section
   ======================================== */

.skill-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    text-align: center;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.skill-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.skill-card h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.skill-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--light-color);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ========================================
   Timeline
   ======================================== */

.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: var(--light-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    width: 50%;
}

.timeline-item:nth-child(odd) {
    padding-right: 3rem;
    text-align: right;
}

.timeline-item:nth-child(even) {
    margin-left: 50%;
    padding-left: 3rem;
}

.timeline-item::after {
    content: '';
    position: absolute;
    top: 0;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}

.timeline-item:nth-child(odd)::after {
    right: -8px;
}

.timeline-item:nth-child(even)::after {
    left: -8px;
}

.timeline-date {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-content {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.timeline-content h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-content ul {
    text-align: left;
    padding-left: 1.5rem;
}

/* ========================================
   Projects Section
   ======================================== */

.project-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    text-align: center;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.project-card h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tech-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--gradient-secondary);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ========================================
   Contact Section
   ======================================== */

.contact-item {
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.contact-item i {
    color: var(--primary-color);
}

.contact-item h5 {
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.contact-item a,
.contact-item p {
    color: var(--text-secondary);
    margin: 0;
}

.social-links {
    margin-top: 2rem;
}

.social-link {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    border-radius: 50%;
    background: var(--gradient-secondary);
    color: white;
    margin: 0 0.5rem;
    font-size: 1.25rem;
    transition: var(--transition-base);
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
    color: white;
}

/* ========================================
   Footer
   ======================================== */

.footer {
    background: var(--dark-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    margin: 0.5rem 0;
}

.footer .small {
    opacity: 0.8;
}

/* ========================================
   Back to Top Button
   ======================================== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-secondary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 991px) {
    .navbar-nav {
        text-align: center;
        padding: 1rem 0;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 60px !important;
        padding-right: 0 !important;
        text-align: left !important;
        margin-left: 0 !important;
    }
    
    .timeline-item::after {
        left: 22px !important;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .about-image img {
        max-width: 200px;
    }
    
    .skill-card,
    .project-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .timeline {
        padding-left: 0;
    }
    
    .timeline::before {
        left: 15px;
    }
    
    .timeline-item {
        padding-left: 40px !important;
    }
    
    .timeline-item::after {
        left: 7px !important;
    }
    
    .contact-item {
        margin-bottom: 1rem;
    }
}

/* ========================================
   Utilities
   ======================================== */

.text-gradient {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-light {
    background-color: var(--light-color) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}