:root {
    --color-primary: #007acc;
    --color-primary-dark: #005a9e;
    --color-bg-light: #f9fafb;
    --color-bg-dark: #1a202c;
    --color-text-light: #1e293b;
    --color-text-dark: #e2e8f0;
    --color-card-light: #ffffff;
    --color-card-dark: #2d3748;
    --color-border-light: #e2e8f0;
    --color-border-dark: #4a5568;
    --color-accent: #f59e0b;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--color-text-light);
    background-color: var(--color-bg-light);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    color: var(--color-text-dark);
    background-color: var(--color-bg-dark);
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(ellipse 80% 80% at 50% -20%, rgba(120, 119, 198, 0.3), transparent);
}

body.dark-mode .background {
    background: radial-gradient(ellipse 80% 80% at 50% -20%, rgba(60, 60, 120, 0.4), transparent);
}

/* Logo */
.logo {
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-primary);
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Contador de visitas */
.visit-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--color-card-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    opacity: 0.6;
    border: 1px solid var(--color-border-light);
    z-index: 50;
    transition: opacity 0.3s ease;
}

body.dark-mode .visit-counter {
    background: var(--color-card-dark);
    border-color: var(--color-border-dark);
}

.visit-counter:hover {
    opacity: 1;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--color-border-light);
    padding: 0.5rem 0;
}

body.dark-mode header {
    background: rgba(26, 32, 44, 0.85);
    border-bottom: 1px solid var(--color-border-dark);
}

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

nav a {
    color: var(--color-text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

body.dark-mode nav a {
    color: var(--color-text-dark);
}

nav a:hover {
    color: var(--color-primary);
}

.theme-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.theme-btn:hover {
    transform: scale(1.1);
}

/* Main */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem;
}

/* Hero */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4rem;
}

.hero-content {
    text-align: center;
    width: 100%;
}
.profile-section {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.profile-section > div {
    text-align: left;
    max-width: 600px;
}
.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 4px solid var(--color-primary);
    box-shadow: 0 10px 30px rgba(0, 122, 204, 0.3);
    flex-shrink: 0;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-light);
}

body.dark-mode .subtitle {
    color: var(--color-text-dark);
}

.subtitle strong {
    color: var(--color-accent);
    font-weight: 600;
}

.description {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}


.btn-primary, .btn-secondary {
    padding: 0.8rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}
.btn-primary svg,
.btn-secondary svg,
.contact-btn svg {
    vertical-align: middle;
    margin-right: 0.5rem;
}

.btn-primary,
.btn-secondary,
.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 122, 204, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

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

/* Sections */
.section {
    margin-bottom: 4rem;
    scroll-margin-top: 100px;
}

.section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--color-text-light);
}

body.dark-mode .section h2 {
    color: var(--color-text-dark);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

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

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.timeline-item::before {
    content: '●';
    position: absolute;
    left: -2.35rem;
    color: var(--color-accent);
    font-size: 2rem;
    line-height: 1;
}

.timeline-date h3 {
    color: var(--color-accent);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.timeline-date h4 {
    color: var(--color-text-light);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

body.dark-mode .timeline-date h4 {
    color: var(--color-text-dark);
}

.timeline-date time {
    color: var(--color-text-light);
    opacity: 0.7;
    font-size: 0.9rem;
    display: block;
}

body.dark-mode .timeline-date time {
    color: var(--color-text-dark);
}

.location {
    color: var(--color-text-light);
    opacity: 0.6;
    font-size: 0.85rem;
    display: block;
    margin-top: 0.25rem;
}

body.dark-mode .location {
    color: var(--color-text-dark);
}

.timeline-content p {
    line-height: 1.8;
    margin-bottom: 1rem;
}

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

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

.timeline-content strong {
    color: var(--color-accent);
}

/* Cards */
.education-item, .project-card {
    background: var(--color-card-light);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--color-border-light);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .education-item,
body.dark-mode .project-card {
    background: var(--color-card-dark);
    border-color: var(--color-border-dark);
}

.education-item:hover,
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.education-item h3,
.project-card h3 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.education-item time,
.project-card time {
    color: var(--color-text-light);
    opacity: 0.7;
    font-size: 0.9rem;
}

body.dark-mode .education-item time,
body.dark-mode .project-card time {
    color: var(--color-text-dark);
}

.grade {
    color: var(--color-accent);
    font-weight: 600;
    margin: 0.5rem 0;
}

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

.skill-category {
    background: var(--color-card-light);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--color-border-light);
}

body.dark-mode .skill-category {
    background: var(--color-card-dark);
    border-color: var(--color-border-dark);
}

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

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

.tag {
    background: var(--color-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

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

.tech-stack {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.tech-stack span {
    background: var(--color-accent);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
}

/* Contact */
.contact-intro {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.contact-info {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.contact-info p {
    margin: 0.5rem 0;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-btn {
    background: var(--color-card-light);
    color: var(--color-text-light);
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid var(--color-border-light);
    transition: all 0.3s ease;
}

body.dark-mode .contact-btn {
    background: var(--color-card-dark);
    color: var(--color-text-dark);
    border-color: var(--color-border-dark);
}

.contact-btn:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: 0 10px 25px rgba(0, 122, 204, 0.2);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--color-border-light);
}

body.dark-mode footer {
    border-top-color: var(--color-border-dark);
}

/* Responsive */
@media (max-width: 768px) {
    main {
        padding: 5rem 1rem 1rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .description {
        font-size: 1rem;
    }
    
    .profile-section {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-section > div {
        text-align: center;
    }
    
    .profile-pic {
        width: 100px;
        height: 100px;
    }
    
    .timeline {
        padding-left: 1.5rem;
    }
    
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .timeline-item::before {
        left: -1.85rem;
        font-size: 1.5rem;
    }
    
    nav {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }
    
    nav a {
        font-size: 0.9rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .section h2 {
        font-size: 2rem;
    }
    
    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-links {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem;
    }
    
    .contact-btn {
        width: 100%;
        justify-content: center;
    }
    
    .visit-counter {
        bottom: 10px;
        right: 10px;
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .timeline-date h3 {
        font-size: 1.1rem;
    }
    
    .timeline-date h4 {
        font-size: 1rem;
    }
}
