/* Reset avançado e variáveis */
:root {
    /* Paleta de cores ajustada para maior contraste */
    --primary-dark: #1e293b;
    --primary: #3b4462;
    --primary-light: #dbeafe;
    --secondary: #059669;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
    --off-white: #f9fafb;
    --bg-main: #f3f4f6;
    --card-bg: #ffffff;
    --card-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    --section-gap: 48px;
    --border-radius: 12px;
    --transition-speed: 0.3s;
    
    /* Tipografia */
    --font-main: 'Inter', system-ui, sans-serif;
    --font-heading: 'Montserrat', system-ui, sans-serif;
}

/* Importação de fontes */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@500;600;700&display=swap');

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

body {
    font-family: var(--font-main);
    line-height: 1.7;
    background-color: var(--bg-main);
    color: var(--text-dark);
    padding: 0;
    overflow-x: hidden;
    font-weight: 400;
}

/* Container principal */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* Header */
header {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    margin-bottom: var(--section-gap);
    background-color: var(--primary);
    color: var(--white);
    padding: 64px 48px;
    min-height: 350px; /* Altura mínima para evitar colapso */
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    z-index: -2;
}

.header-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: -1;
}

.wave1 {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z' style='fill: rgba(255,255,255,0.1);'%3E%3C/path%3E%3C/svg%3E");
}

.wave2 {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' style='fill: rgba(255,255,255,0.12);'%3E%3C/path%3E%3C/svg%3E");
    opacity: 0.8;
}

.header-placeholder {
    display: none;
    height: 0;
    width: 100%;
}

.fixed-header.visible + .header-placeholder {
    display: block;
    height: 350px; /* Valor inicial, será ajustado via JS */
}

.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.profile-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid var(--white);
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    object-fit: cover;
    cursor: pointer; /* Indica que a imagem é clicável */
}

.profile-header h1 {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--white);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 40px;
    transition: all var(--transition-speed);
    backdrop-filter: blur(6px);
}

.contact-item:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-4px);
}

.contact-item svg {
    width: 20px;
    height: 20px;
    fill: var(--white);
}

.contact-item a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
}

/* Fixed Header */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    padding: 12px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 64px;
    opacity: 0;
    transition: opacity var(--transition-speed) ease-out;
}

.fixed-header.visible {
    opacity: 1;
}

.fixed-header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.fixed-profile-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    object-fit: cover;
    cursor: pointer;
}

.fixed-profile-header h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Seções */
.section {
    margin-bottom: var(--section-gap);
    padding: 40px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transform: translateY(40px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative; /* Necessário para sticky funcionar */
}

.section.visible {
    transform: translateY(0);
    opacity: 1;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 28px;
    position: sticky;
    top: 64px;
    background-color: var(--card-bg);
    padding: 8px 24px;
    width: calc(100% + 50px);
    margin-left: -30px;
    z-index: 500;
}

.section-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.section-icon svg {
    width: 22px;
    height: 22px;
    fill: var(--primary);
}

h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary-dark);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-light), var(--off-white));
}

.timeline-item {
    position: relative;
    padding: 24px 0;
    transition: transform var(--transition-speed);
}

.timeline-item:hover {
    transform: translateX(6px);
}

.timeline-item:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.timeline-item::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary);
    left: -40px;
    top: 32px;
    border: 3px solid var(--primary-light);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.timeline-title {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary-dark);
}

.timeline-period {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
    padding: 4px 12px;
    background-color: var(--primary-light);
    border-radius: 24px;
}

.timeline-subtitle {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 12px;
}

.timeline-content {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.65;
}

/* Projetos */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
    margin-top: 32px;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: all var(--transition-speed);
    height: 100%;
}

.project-scroller .project-card {
    min-width: 320px;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

.card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header {
    padding: 24px;
    background-color: var(--primary-light);
}

.language-badge {
    padding: 6px 12px;
    background-color: var(--primary);
    color: var(--white);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 24px;
    text-transform: uppercase;
}

.card-header h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: var(--primary-dark);
}

.card-header a {
    color: inherit;
    text-decoration: none;
}

.card-header a:hover {
    color: var(--primary);
}

.creation-date {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-body {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-description {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.65;
    margin-bottom: 16px;
    flex-grow: 1;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    overflow: visible;
}

.card-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-speed);
    overflow: visible;
}

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

.card-button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 32px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: var(--border-radius);
    margin-top: var(--section-gap);
    position: relative;
    overflow: hidden;
}

/* Botão de salvar PDF */
.save-pdf-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--secondary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
    margin: 10px auto;
    display: block;
}

.save-pdf-button:hover {
    background-color: var(--primary);
    transform: translateY(-2px);
}

.save-pdf-button svg {
    width: 20px;
    height: 20px;
}

/* Animação de scroll infinito */
.project-scroller {
    overflow: hidden;
    width: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--off-white));
    border-radius: var(--border-radius);
    padding: 32px 0;
    margin-top: 32px;
    position: relative;
}

.project-scroller::before,
.project-scroller::after {
    content: '';
    position: absolute;
    top: 0;
    width: 120px;
    height: 100%;
    z-index: 2;
}

.project-scroller::before {
    left: 0;
    background: linear-gradient(90deg, var(--primary-light), transparent);
}

.project-scroller::after {
    right: 0;
    background: linear-gradient(-90deg, var(--primary-light), transparent);
}

.project-track {
    display: flex;
    width: max-content;
    animation: scroll 60s linear infinite;
    gap: 24px;
    padding: 0 24px;
}

.project-track:hover {
    animation-play-state: paused;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 12px;
}

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

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

/* Animação de scroll */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-50% - 12px));
    }
}

/* Responsividade */
@media (max-width: 1024px) {
    :root {
        --section-gap: 36px;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .profile-header h1 {
        font-size: 2.25rem;
    }
    
    .contact-info {
        gap: 12px;
    }
    
    .contact-item {
        padding: 8px 16px;
        font-size: 0.95rem;
    }
    
    .section {
        padding: 32px;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .fixed-profile-header h1 {
        font-size: 1.2rem;
    }
    
    .profile-image {
        width: 100px;
        height: 100px;
    }
    
    .fixed-profile-image {
        width: 40px;
        height: 40px;
    }
    
    .contact-info {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .section {
        padding: 24px;
    }
    
    .section-header {
        top: 64px;
        padding: 8px 16px;
        width: calc(100% + 20px);
        margin-left: -10px;
    }
    
    .section-icon {
        width: 36px;
        height: 36px;
    }
    
    .section-icon svg {
        width: 18px;
        height: 18px;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .timeline {
        padding-left: 24px;
    }
    
    .timeline-item::before {
        left: -32px;
        width: 12px;
        height: 12px;
    }
    
    .timeline-header {
        flex-direction: column;
        gap: 6px;
    }
}

@media print {
    body {
        background: none; /* Remover fundo para PDF */
        margin: 0;
        padding: 0;
    }

    .container {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }

    /* Desativar elementos fixos ou sticky */
    .fixed-header,
    .header-placeholder,
    .section-header {
        position: static !important;
        top: auto !important;
    }

    /* Garantir que seções não sejam quebradas */
    .section,
    .project-card,
    .timeline-item {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Ajustar margens e espaçamentos */
    .section {
        margin-bottom: 20px;
        padding: 20px;
        box-shadow: none;
    }

    /* Remover animações e transições */
    .section,
    .project-card,
    .timeline-item,
    .contact-item,
    .card-button {
        transform: none !important;
        transition: none !important;
        opacity: 1 !important;
    }

    /* Ajustar o header principal */
    header {
        min-height: auto;
        padding: 20px;
        margin-bottom: 20px;
    }

    .header-waves,
    .header-bg {
        display: none; /* Remover elementos decorativos */
    }

    /* Garantir que o footer não flutue */
    footer {
        position: relative;
        margin-top: 20px;
        padding: 20px;
    }

    /* Ajustar a rolagem de projetos */
    .project-scroller {
        overflow: visible;
        animation: none;
    }

    .project-track {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        width: 100%;
        animation: none;
        gap: 20px;
    }

    /* Evitar quebras no meio de cartões */
    .project-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Remover barras de rolagem */
    ::-webkit-scrollbar {
        display: none;
    }
}