/* Aviso: Cores vibrantes detectadas. Use com cautela para não ofuscar o recrutador. */

:root {
    interpolate-size: allow-keywords;
    --primaria: #6c5ce7;
    --primaria-escura: #5649c0;
    --secundaria: #a29bfe;
    --detalhe: #00cec9;
    --detalhe-escuro: #00a8a3;
    --fundo: #f0f2f5;
    --card-bg: #ffffff;
    --texto: #2d3436;
    --texto-suave: #636e72;
    --borda: #e2e8f0;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--fundo);
    color: var(--texto);
    margin: 0;
    padding: 12px;
    display: flex;
    justify-content: center;
    line-height: 1.55;
}

/* =========================================
   CONTAINER PRINCIPAL E CABEÇALHO
   ========================================= */
.curriculo {
    background: var(--card-bg);
    max-width: 880px;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-top: 8px solid var(--primaria);
}

header {
    background: linear-gradient(135deg, var(--primaria), var(--secundaria));
    color: #ffffff;
    padding: 36px 24px;
    text-align: center;
    position: relative;
}

header h1 {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    letter-spacing: -0.5px;
}

.contato {
    margin-top: 10px;
    margin-bottom: 0;
    opacity: 0.92;
    font-size: 0.9rem;
}

main {
    padding: 28px 32px;
}

/* Botão de Idioma */
#lang-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: var(--detalhe);
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.25s;
    z-index: 10;
}

#lang-toggle:hover {
    background-color: var(--primaria-escura);
}

/* Botão Voltar ao Topo */
#btnTopo {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--primaria);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35);
    transition: background-color 0.25s, transform 0.2s;
    z-index: 999;
}

#btnTopo:hover {
    background-color: var(--primaria-escura);
    transform: translateY(-2px);
}

/* =========================================
   ABAS DE NAVEGAÇÃO CENTRALIZADAS
   ========================================= */
nav,
.tabs,
.tab-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    margin: 0 auto 12px auto;
    background: var(--card-bg);
    border-bottom: 1px solid var(--borda);
    overflow-x: auto;
    scrollbar-width: none;
}

nav::-webkit-scrollbar,
.tabs::-webkit-scrollbar,
.tab-container::-webkit-scrollbar {
    display: none;
}

.tab-link {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 14px 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--texto-suave);
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.tab-link:hover {
    color: var(--primaria);
}

.tab-link.active {
    border-bottom-color: var(--primaria);
    color: var(--primaria);
}

.tab-content {
    animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   SEÇÕES E RESUMO
   ========================================= */
.cv-section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header h2,
section h2 {
    color: var(--primaria);
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    border-bottom: 2px solid var(--detalhe);
    display: inline-block;
    margin: 0;
    padding-bottom: 4px;
}

.summary-card {
    background: #f8f9fc;
    border-left: 4px solid var(--primaria);
    border-radius: 0 10px 10px 0;
    padding: 14px 16px;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--texto);
}

/* =========================================
   CURRÍCULO: TIMELINE INTERATIVA
   ========================================= */
.tl-expand-btn {
    flex-shrink: 0;
    white-space: nowrap;
    background: rgba(108, 92, 231, 0.1);
    color: var(--primaria);
    border: 1px solid rgba(108, 92, 231, 0.28);
    border-radius: 999px;
    padding: 5px 13px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.tl-expand-btn:hover {
    background: var(--primaria);
    color: #ffffff;
}

.timeline {
    position: relative;
    padding-left: 22px;
    border-left: 2px solid rgba(108, 92, 231, 0.25);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tl-item {
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tl-dot {
    position: absolute;
    left: -29px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--primaria);
    transition: background-color 0.2s, transform 0.2s;
}

.tl-item.is-open .tl-dot {
    background: var(--primaria);
    transform: scale(1.15);
}

.tl-card {
    background: #ffffff;
    border: 1px solid var(--borda);
    border-radius: 12px;
    padding: 15px 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tl-item.is-open .tl-card {
    border-color: var(--primaria);
    box-shadow: 0 6px 18px rgba(108, 92, 231, 0.08);
}

.tl-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-right: 22px;
    position: relative;
}

.tl-header::after {
    content: "▾";
    position: absolute;
    right: 0;
    top: 0;
    font-size: 0.95rem;
    color: var(--texto-suave);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s ease;
}

.tl-item.is-open .tl-header::after {
    transform: rotate(180deg);
    color: var(--primaria);
}

.tl-role {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e272e;
}

.tl-org {
    margin: 0;
    font-size: 0.86rem;
    color: var(--texto-suave);
}

.tl-date {
    flex-shrink: 0;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--primaria);
    background: rgba(108, 92, 231, 0.1);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tl-details {
    height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
    border-top: 1px dashed transparent;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.55;
    transition:
        height 0.34s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.26s ease,
        margin-top 0.34s cubic-bezier(0.4, 0, 0.2, 1),
        padding-top 0.34s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.26s ease;
}

.tl-item.is-open .tl-details {
    height: auto;
    opacity: 1;
    margin-top: 12px;
    padding-top: 12px;
    border-top-color: var(--borda);
}

.tl-subtitle {
    margin: 0 0 8px 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primaria);
}

.tl-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.skill-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primaria);
    background: rgba(108, 92, 231, 0.09);
    padding: 3px 9px;
    border-radius: 6px;
}

/* Hover da timeline apenas em dispositivos com rato/trackpad */
@media (hover: hover) and (pointer: fine) {
    .tl-item:hover .tl-details {
        height: auto;
        opacity: 1;
        margin-top: 12px;
        padding-top: 12px;
        border-top-color: var(--borda);
    }

    .tl-item:hover .tl-dot {
        background: var(--primaria);
        transform: scale(1.15);
    }

    .tl-item:hover .tl-card {
        border-color: var(--primaria);
        box-shadow: 0 6px 18px rgba(108, 92, 231, 0.08);
    }

    .tl-item:hover .tl-header::after {
        transform: rotate(180deg);
        color: var(--primaria);
    }
}

/* =========================================
   SKILLS, BOLSAS E ATIVIDADES EXTRAS
   ========================================= */
.skills-grid,
.extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.skill-group-card,
.extra-card {
    background: #ffffff;
    border: 1px solid var(--borda);
    border-radius: 12px;
    padding: 15px 17px;
}

.skill-group-title {
    margin: 0 0 10px 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e272e;
}

.compact-list {
    margin: 0;
    padding-left: 18px;
    font-size: 0.88rem;
    color: var(--texto-suave);
    line-height: 1.55;
}

.compact-list li {
    margin-bottom: 6px;
}

.compact-list li:last-child {
    margin-bottom: 0;
}

.compact-list strong {
    color: var(--texto);
}

.compact-list a,
.tl-details a {
    color: var(--primaria);
    font-weight: 600;
    text-decoration: none;
}

.compact-list a:hover,
.tl-details a:hover {
    text-decoration: underline;
}

/* =========================================
   PUBLICAÇÕES (CARDS RESPONSIVOS)
   ========================================= */
.pub-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primaria);
    background: rgba(108, 92, 231, 0.12);
    padding: 3px 10px;
    border-radius: 999px;
}

.pubs-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pub-card {
    background: #ffffff;
    border: 1px solid var(--borda);
    border-left: 4px solid var(--primaria);
    border-radius: 12px;
    padding: 16px 18px;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}

.pub-card.has-award {
    border-left-color: #f59e0b;
}

@media (hover: hover) and (pointer: fine) {
    .pub-card:hover {
        border-color: var(--primaria);
        box-shadow: 0 8px 20px rgba(108, 92, 231, 0.1);
        transform: translateY(-1px);
    }
}

.pub-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.pub-year {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--primaria);
    background: rgba(108, 92, 231, 0.12);
    padding: 2px 9px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

.pub-type {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--texto-suave);
    background: #f1f3f5;
    padding: 2px 8px;
    border-radius: 6px;
}

.pub-award {
    font-size: 0.75rem;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    padding: 2px 9px;
    border-radius: 999px;
}

.pub-title {
    margin: 0 0 6px 0;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.4;
}

.pub-title a {
    color: #1e272e;
    text-decoration: none;
    transition: color 0.2s;
}

.pub-title a:hover {
    color: var(--primaria);
}

.pub-authors {
    margin: 0 0 12px 0;
    font-size: 0.88rem;
    color: var(--texto-suave);
}

.pub-self {
    color: var(--texto);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--detalhe);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.pub-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--borda);
}

.pub-venue {
    font-size: 0.84rem;
    color: #4b5563;
    line-height: 1.45;
}

.pub-link-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primaria);
    background: rgba(108, 92, 231, 0.08);
    border: 1px solid rgba(108, 92, 231, 0.25);
    padding: 6px 11px;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s;
}

.pub-link-btn:hover {
    background: var(--primaria);
    color: #ffffff;
}

/* =========================================
   MISCELLANEOUS (CARDS E GALERIA)
   ========================================= */
.misc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.misc-card {
    background: #ffffff;
    border: 1px solid var(--borda);
    border-top: 4px solid var(--detalhe);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .misc-card:hover {
        border-color: var(--primaria);
        box-shadow: 0 8px 20px rgba(108, 92, 231, 0.1);
        transform: translateY(-2px);
    }
}

.misc-card-top {
    margin-bottom: 8px;
}

.misc-badge {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--primaria);
    background: rgba(108, 92, 231, 0.1);
    padding: 2px 9px;
    border-radius: 999px;
}

.misc-title {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e272e;
}

.misc-desc {
    margin: 0 0 14px 0;
    font-size: 0.9rem;
    color: var(--texto-suave);
    flex-grow: 1;
}

.misc-card-footer {
    padding-top: 10px;
    border-top: 1px dashed var(--borda);
}

/* Carrossel */
.carousel-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--borda);
    background: #111827;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.carousel-item {
    display: none;
    width: 100%;
    position: relative;
}

.carousel-item.active {
    display: block;
    animation: fade 0.4s ease-in-out;
}

.carousel-item img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    display: block;
}

.caption {
    background: linear-gradient(to top, rgba(17, 24, 39, 0.92), rgba(17, 24, 39, 0.72));
    color: #f9fafb;
    padding: 12px 16px;
    text-align: center;
    font-size: 0.9rem;
}

.prev,
.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(4px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s, border-color 0.2s;
    z-index: 2;
}

.prev:hover,
.next:hover {
    background: var(--primaria);
    border-color: var(--primaria);
}

.prev { left: 12px; }
.next { right: 12px; }

@keyframes fade {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* =========================================
   RESPONSIVIDADE MOBILE
   ========================================= */
@media (max-width: 680px) {
    body {
        padding: 0;
        background-color: var(--card-bg);
    }

    .curriculo {
        border-radius: 0;
        box-shadow: none;
        border-top-width: 6px;
    }

    header {
        padding: 58px 16px 24px 16px;
    }

    #lang-toggle {
        top: 12px;
        right: 12px;
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    main {
        padding: 18px 14px;
    }

    .tl-header {
        flex-direction: column;
        gap: 6px;
    }

    .skills-grid,
    .extras-grid,
    .misc-grid {
        grid-template-columns: 1fr;
    }

    .pub-card {
        padding: 14px;
    }

    .pub-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .pub-link-btn {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
    }

    .carousel-item img {
        max-height: 320px;
    }

    .prev,
    .next {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .tab-link {
        font-size: 0.92rem;
        padding: 12px 6px;
    }
}