:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
    --text-light: #7f8c8d;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --bg-color: #f9f9f9;
    --text-color: #333;
    --card-bg: white;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --card-bg: #2d2d2d;
    --primary-color: #3498db;
    --light-color: #333;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Header Styles */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 3rem 0;
    text-align: center;
    position: relative;
}

header .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    color: var(--light-color);
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

/* Contact Info */
.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.contact-info a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.contact-info a:hover {
    color: var(--secondary-color);
}

.contact-info i {
    font-size: 1.2rem;
}

/* Download Buttons */
.download-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow);
    border: none;
    cursor: pointer;
}

.download-btn.french {
    background-color: #0055A4;
    color: white;
}

.download-btn.french:hover {
    background-color: #003d7a;
}

.download-btn.english {
    background-color: #E63946;
    color: white;
}

.download-btn.english:hover {
    background-color: #c1121f;
}

.download-btn.spanish {
    background-color: #F1BF00;
    color: #333;
}

.download-btn.spanish:hover {
    background-color: #d4a900;
}

/* Theme Toggle */
#theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

#theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Navigation */
#main-nav {
    background-color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

#main-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 1rem 0;
    flex-wrap: wrap;
}

#main-nav li {
    margin: 0 1rem;
}

#main-nav a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: var(--transition);
}

#main-nav a:hover {
    color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

/* Card Styles */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin: 2rem 0;
    animation: fadeIn 0.6s ease forwards;
}

.card h2 {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.card h2 i {
    color: var(--secondary-color);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 5rem; /* Increased padding to prevent overlap */
    margin-left: 1rem; /* Added margin for better spacing */
}

.timeline::before {
    content: '';
    position: absolute;
    left: 2.5rem; /* Adjusted position to align with new padding */
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--secondary-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem; /* Increased margin between items */
}

.timeline-date {
    position: absolute;
    left: -5rem; /* Adjusted to match new padding */
    top: 0;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    width: 4rem; /* Fixed width for consistent dates */
    text-align: center;
}

.timeline-content {
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: 8px;
    position: relative;
    margin-left: 1rem; /* Added margin to separate from line */
    box-shadow: var(--shadow);
}

.timeline-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.timeline-content ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.timeline-content li {
    margin-bottom: 0.5rem;
}

/* Add this to ensure timeline items don't overlap */
.timeline-item:last-child {
    margin-bottom: 0;
}

/* Skills */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.language-skills {
    margin-top: 1rem;
}

.language {
    margin-bottom: 1rem;
}

.progress-bar {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--secondary-color);
    border-radius: 5px;
    transition: width 1s ease;
}

.soft-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.soft-skills span {
    background-color: var(--light-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Interests */
.interests-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.interest {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 120px;
    text-align: center;
}

.interest i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    background-color: var(--light-color);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.interest:hover i {
    transform: scale(1.1);
    background-color: var(--secondary-color);
    color: white;
}

/* Projects */
.github-container {
    text-align: center;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.project-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.project-image {
    height: 160px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
}

.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-info {
    padding: 1.5rem;
}

.project-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.project-info p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.project-links {
    display: flex;
    justify-content: space-between;
}

.project-links a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.project-links a:hover {
    color: var(--primary-color);
}

.github-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    margin-top: 1rem;
}

.github-btn:hover {
    background-color: var(--secondary-color);
}

/* Contact Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

.submit-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    background-color: #2980b9;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

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

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--secondary-color);
}

/* Back to Top */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 99;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    header h2 {
        font-size: 1.2rem;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    #main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .timeline {
        padding-left: 2rem;
    }
    
    .timeline::before {
        left: 1rem;
    }
    
    .timeline-date {
        left: -2.5rem;
    }
    
    .download-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
    
    header {
        padding: 2rem 0 3rem;
    }
}