/* Modern Portfolio Styles - Rafael Ortiz */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --accent-color: #06b6d4;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --white: #ffffff;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    background: var(--white);
}

body.loaded {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.display-1 { font-size: 5rem; }
.display-2 { font-size: 4.5rem; }
.display-3 { font-size: 4rem; }
.display-4 { font-size: 3.5rem; }

/* Navigation */
.navbar {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    padding: 1rem 0;
}

.navbar.scrolled {
    background: rgba(15, 23, 42, 0.98);
    box-shadow: var(--shadow-lg);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: var(--transition);
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--white) !important;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition);
    transform: translateX(-50%);
}

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

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    font-size: 0.875rem;
}

.lang-btn:hover {
    border-color: var(--white);
    color: var(--white);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--white);
}

.flag {
    margin-right: 0.25rem;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,133.3C960,128,1056,96,1152,90.7C1248,85,1344,107,1392,117.3L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    pointer-events: none;
}

.hero-content h1 {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

.hero-content h2 {
    color: #ffffff;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    font-weight: 800;
}

.hero-name {
    color: #ffffff;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.hero-name::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100px;
    height: 4px;
    background: #ffffff;
    border-radius: 2px;
}

.hero-content .h5 {
    color: rgba(255, 255, 255, 0.8);
}

.hero-content .lead {
    color: rgba(255, 255, 255, 0.9);
}

.hero-buttons .btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-buttons .btn-primary {
    background: var(--white);
    color: var(--primary-color);
    border: none;
}

.hero-buttons .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.hero-buttons .btn-outline-primary {
    border: 2px solid var(--white);
    color: var(--white);
}

.hero-buttons .btn-outline-primary:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Profile Image */
.profile-img {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border: 8px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.profile-img:hover {
    transform: scale(1.05);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* Section Styles */
section {
    padding: 5rem 0;
}

section.py-5 {
    padding: 5rem 0;
}

.bg-light {
    background: var(--light-bg) !important;
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content .lead {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Skills Section */
.skill-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* opacity: 0; */
    /* transform: translateY(30px); */
}

.skill-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.skill-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--white);
}

.skill-card h4 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.skill-card p {
    color: var(--text-light);
    margin-bottom: 0;
}

/* Projects Section */
.project-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    height: 100%;
    opacity: 0;
    transform: translateY(30px);
}

.project-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.project-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: var(--dark-bg);
}

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

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

.video-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.video-fallback.show {
    opacity: 1;
    pointer-events: auto;
}

.video-fallback .btn {
    background: var(--gradient-primary);
    border: none;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition);
}

.video-fallback .btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.project-content {
    padding: 2rem;
}

.project-content h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.project-tech {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.project-content p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

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

.tag {
    background: var(--gradient-accent);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Experience Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-primary);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    /* opacity: 0; */
    /* transform: translateX(-30px); */
}

.timeline-item.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.timeline-dot {
    position: absolute;
    left: 30px;
    top: 0;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border: 4px solid var(--white);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: var(--shadow-md);
}

.timeline-date-badge {
    position: relative;
    left: 80px;
    top: 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    line-height: 20px;
}

.timeline-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    margin-left: 50px;
    margin-top: 10px;
    position: relative;
}

.timeline-content h4 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.timeline-date {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-light);
    margin-bottom: 0;
}

/* Technology Tags */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-tag {
    background: var(--gradient-primary);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    white-space: nowrap;
}

/* Contact Section */
.contact-content {
    text-align: center;
}

.contact-content .lead {
    color: var(--text-light);
    margin-bottom: 3rem;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: var(--white);
    border-radius: 50px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-dark);
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    color: var(--primary-color);
}

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

/* Footer */
footer {
    background: var(--dark-bg) !important;
    color: rgba(255, 255, 255, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    .display-2 { font-size: 3rem; }
    .display-4 { font-size: 2.5rem; }
    
    .hero-section .row {
        text-align: center;
    }
    
    .hero-section .col-lg-6:first-child {
        order: 2;
    }
    
    .hero-section .col-lg-6:last-child {
        order: 1;
    }
    
    .profile-img {
        width: 250px;
        height: 250px;
        margin-bottom: 2rem;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-dot {
        left: 30px;
    }

    .timeline-date-badge {
        left: 80px;
        top: 0;
        font-size: 0.8rem;
        line-height: 20px;
    }
    
    .timeline-content {
        margin-left: 50px !important;
        margin-top: 10px !important;
        margin-right: 0 !important;
    }
    
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 50px !important;
        margin-right: 0 !important;
    }
    
    .contact-info {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-item {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    section {
        padding: 3rem 0;
    }
    
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .skill-card,
    .project-card {
        margin-bottom: 2rem;
    }
}

/* Loading Animation */
body:not(.loaded) .hero-section,
body:not(.loaded) .skill-card,
body:not(.loaded) .project-card,
body:not(.loaded) .timeline-item {
    opacity: 0;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Selection Styling */
::selection {
    background: var(--primary-color);
    color: var(--white);
}

/* Focus States */
.btn:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .navbar,
    .hero-buttons,
    .language-switcher {
        display: none !important;
    }
    
    .hero-section {
        background: none !important;
        color: var(--text-dark) !important;
        min-height: auto !important;
        padding: 2rem 0 !important;
    }
    
    .hero-section * {
        color: var(--text-dark) !important;
    }
}
