/* ====== VARIABLES ====== */
:root {
    /* Typography */
    --font-family: 'Poppins', sans-serif;
    --font-size-base: 1.2rem;
    --font-size-h1: 3rem;
    --font-size-h2: 2.2rem;
    --font-size-h3: 2rem;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Colors - Dark Theme (default) */
    --primary-bg: #1B3D36;
    --secondary-bg: #2F534A;
    --text-primary: #f8f9fa;
    --text-secondary: #dce0de;
    --accent-1: #FFD85F;
    --accent-2: #A1D88F;
    --secondary-bg-rgb: 47, 83, 74;
}

/* Light theme */
[data-theme="light"] {
    --primary-bg: #ffffff;
    --secondary-bg: #f0f2f1;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent-1: #cc9900;
    --accent-2: #4a8d3d;
    --secondary-bg-rgb: 200, 200, 200;
}

/* ====== BASE STYLES ====== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--primary-bg);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

/* Typography */
h1 { font-size: var(--font-size-h1); margin-bottom: var(--spacing-lg); }
h2 { font-size: var(--font-size-h2); margin-bottom: var(--spacing-md); color: var(--text-primary); }
h3 { font-size: var(--font-size-h3); margin-bottom: var(--spacing-sm); }

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-2);
    transform: translateY(-2px);
}

/* ====== LAYOUT COMPONENTS ====== */
/* Header */
header {
    position: fixed;
    top: 0;
    height: 5%;
    min-height: 50px;
    width: 100%;
    background: rgba(var(--secondary-bg-rgb), 0.7);
    backdrop-filter: blur(2px);
    z-index: 999;
    transition: transform 0.4s ease, padding 0.4s ease, height 0.4s ease;
    padding: var(--spacing-xs) var(--spacing-sm);
}

header.shrink { padding: 0.3rem var(--spacing-sm); }
header.nav-up { transform: translateY(-100%); }

/* Navigation */
.navbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
    list-style: none;
}

/* Links do menu */
.nav-links li a {
    color: var(--text-light);
    font-weight: bold;
    transition: color 0.3s ease;
    padding: 0.3rem 0.5rem;
    text-size-adjust: 160%;
}
.nav-links li a:hover {
    color: var(--accent-1);
}
/* Dropdown Translate button */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: rgb(var(--secondary-bg-rgb),0.7);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    min-width: 150px;
    z-index: 1000;
    list-style: none;
    padding: 0;
    border-radius: 5px;
    overflow: hidden;
}

.dropdown-menu li {
    padding: 10px;
    cursor: pointer;
    text-align: left;
}

.dropdown-menu li:hover {
    background-color: var(--accent-2);
}

/* Hamburger (mobile) */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    margin: 0 0 10px 0;
    padding: 5px;
    position: relative;
    width: 30px;
    height: 24px;
    z-index: 1000;
}
.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    margin: 5px 0;
    background-color: var(--text-primary);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Theme toggle button */
.theme-toggle {
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* ====== SECTIONS ====== */
.section {
    min-height: 100vh;
    padding: var(--spacing-xl) var(--spacing-md);
    position: relative;
    margin: 2%;
    scroll-snap-align: start;
    overflow-y: hidden;
}

/* Introduction */
.intro {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}
.intro-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}
.intro-content {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
    z-index: 1;
    text-align: left;
}
.intro::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      rgba(27, 61, 54, 0.1),
      var(--primary-bg)
    );
    backdrop-filter: blur(2px);
}
.profileimage img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    margin-bottom: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}
.profileimage img:hover {
    transform: scale(1.05);
    border-color: var(--accent-2);
}
.tagline {
    font-style: italic;
    margin-top: var(--spacing-sm);
}

/* social links */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    position: relative;
}
.social-links a {
    font-size: var(--font-size-h1);
    color: var(--text-light);
    transition: color 0.3s ease;
    align-self: flex-start;
}
.social-links a:hover {
    color: var(--accent-2);
}

/* ABOUT */
.about-content {
    line-height: 1.6;
    margin: 0 1%;
}
.about-content p {
    margin-bottom: var(--spacing-md);
    line-height: var(--spacing-md);
    line-height: 1.8;
}
.about-container {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: center;
    gap: 50px;
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .about-image img {
    float: left;
    width: 250px;
    height: 250px;
    margin-right: 30px;
    margin-bottom: 30px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    shape-outside: circle(50%);
    clip-path: circle(50%);
  }
  
  /* Skills Section */
.skills {
    display: flex;
    justify-content: flex-start;
    gap: 40px;
    margin-top: 30px;
  }
  
  .skills div {
    text-align: center;
  }
  
  .skills i {
    font-size: 3rem;
    color: #6c63ff;
  }
  
  .skills p {
    margin-top: 10px;
    font-weight: 600;
  }
  
  /* Call to Action */
  .cta {
    margin-top: 40px;
    text-align: left;
  }

/* PROJECTS */
.search-container {
    position: relative;
    max-width: 400px;
    margin-bottom: var(--spacing-sm);
}
.search-container input {
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 4px;
    border: 1px solid #aaa;
    font-size: 1rem;
}
.search-container i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
}

.project-list, .research-list {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    overflow-x: auto;
    scrollbar-width: thin;  /* Firefox e Brave */
    scrollbar-color: rgba(var(--secondary-bg-rgb), 0.9) rgba(var(--secondary-bg-rgb), 0.0); 
    scrollbar-gutter: stable both-edges; /* Ajuda a esconder as setas */
    -ms-overflow-style: none; /* IE/Edge */
}

.project-list::-webkit-scrollbar {
    height: 10px;
}

.project-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.project-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    transition: background 0.3s;
}

.project-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Remove setas (botões de track) */
.project-list::-webkit-scrollbar-button {
    display: none;
}


/* Project Cards */
.repository, .publication {
    background: rgba(var(--secondary-bg-rgb),0.5);
    border-radius: 8px;
    padding: var(--spacing-md);
    width: clamp(300px, 40vw, 400px);
    height: clamp(300px, 40vh, 600px);
    min-width: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.3s ease;
    backdrop-filter: blur(4px);
    scroll-snap-align: start;
}
.repository:hover, .publication:hover {
    transform: translateY(-4px);
    background: rgba(var(--secondary-bg-rgb), 0.7);
}
.repository img, .publication img {
    width: 50%;
    height: 50%;
    object-fit: contain;
    margin: 0 auto var(--spacing-sm);
}
.repo-content h4, .publication h4 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--accent-2);
    text-align: center;
    margin-bottom: var(--spacing-xs);
}
.repo-content p, .publication p {
    color: var(--text-medium);
    line-height: 1.4;
    text-align: center;
    margin: 0;
    display: -webkit-box;
    line-clamp: 4;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* SCROLL BTNS */
.scroll-btn {
    display:inline;
    position: absolute;
    top: 50%;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transform: translateY(-50%);
    backdrop-filter: blur(4px);
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 10;
}
.scroll-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}
.scroll-left {
    left: var(--spacing-sm);
}
.scroll-right {
    right: var(--spacing-sm);
}

/* RESEARCH */
.research-list {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    overflow-x: auto;
}
.research-list::-webkit-scrollbar {
    display: none;
}

/* TEACHING */
.teaching-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}
.teaching-card {
    background: rgba(var(--secondary-bg-rgb),0.5);
    border: 1px solid rgba(--border, 0.1);
    border-radius: 8px;
    padding: var(--spacing-md);
    width: clamp(250px, 25vw, 350px);
    min-height: 200px;
    transition: transform 0.3s ease;
    backdrop-filter: blur(4px);
}
.teaching-card:hover {
    transform: translateY(-4px);
    background: rgba(var(--secondary-bg-rgb),0.8);
}
.teaching-card i {
    font-size: 2.2rem;
    margin-bottom: var(--spacing-xs);
    display: block;
}
.teaching-card h3 {
    color: var(--accent-2);
    margin-bottom: var(--spacing-xs);
    font-size: 1.1rem;
}
.teaching-card p {
    color: var(--text-medium);
    margin-bottom: var(--spacing-sm);
}

/* CTA button in teaching */
.cta-button {
    display: inline-block;
    background: var(--secondary-bg);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s ease;
    text-decoration: none;
}
.cta-button:hover {
    background: var(--primary-bg);
}

/* CONTACT */
.contact p {
    margin: 0 auto;
    text-align: left;
    line-height: 1.6;
}
.contact .social-links {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
}

/* FOOTER */
footer {
    text-align: center;
    padding: var(--spacing-md);
    background: rgba(var(--secondary-bg-rgb), 0.9);
    color: var(--text-light);
}

/* BACK TO TOP BUTTON */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
}
.back-to-top:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Seção de Links Sociais */

/* ======== MODAL CONTAINER ======== */
.social-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--modal-width);
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    padding: var(--spacing-md); /* Add padding to the modal */
}

.social-modal.show {
    opacity: 1;
    visibility: visible;
}
.social-modal {
    opacity: 0;
    transform: translateX(-0%) scale(0.95); /* Ligeiramente acima e menor */
    visibility: hidden;  /* Inacessível para cliques */
    pointer-events: none;  /* Evita que interfira no fluxo */
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s 0.4s;
    z-index: 900;
    background: linear-gradient(to right, rgba(var(--secondary-bg-rgb), 0.9), rgba(255, 255, 255, 0));
    border: 1px solid rgba(var(--secondary-bg-rgb), 0.7);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    width: clamp(300px, 100vw, 400px);
    margin: -20px calc((100vw - 400px) / 2) 0 auto;
}

/* Modal Visível (Fade-in) */
.social-modal.show {
    opacity: 1;
    transform: translateY(10px) translateX(50%) scale(1);  /* Tamanho e posição normais */
    visibility: visible;
    pointer-events: auto;  /* Torna interativo novamente */
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ======== MODAL HEADER ======== */
.profile-header {
    display: flex;
    align-items: center;
    background-color: var(--secondary-color);
    border-bottom: 1px solid #ddd;
    margin-bottom: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);
    gap: var(--spacing-xs);
}

.profile-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;}

/* ======== MODAL BODY ======== */
.profile-card {
    padding: var(--spacing);
}
.profile-card h4 {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 0px;
    padding-bottom: 0px;
    color: var(--accent-2)
}

.profile-bio, .profile-metrics {
    color: var(--text-color);
    font-size: 0.9rem;
    margin-bottom: var(--spacing);
}

.profile-metrics span {
    display: inline-block;
    background-color: var(--secondary-color);
    padding: 6px 12px;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    margin: 4px 4px 0 0;
}

.profile-link {
    text-align: center;
}

.profile-link a {
    color: var(--primary-color);
    font-weight: 600;
    transition: color 0.3s;
    font-size: var(--text-medium);
}

.profile-link a:hover {
    color: #005bb5;
}

.citations-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    position: relative;
    height: 400px; /* Define a height for the chart */
    width: 100%;
    border-left: 2px solid var(--text-light); /* Y-axis */
    border-bottom: 2px solid var(--text-light); /* X-axis */
}

.citations-bar {
    background: var(--accent-1);
    border-radius: 4px;
    width: 40px; /* Width of each bar */
    transition: transform 0.3s ease;
    backdrop-filter: blur(4px);
    position: absolute;
    bottom: 0; /* Align bars to the bottom */
    display: flex;
    justify-content: center;
    align-items: flex-end;
    color: var(--text-light);
    font-size: 0.8rem;
    text-align: center;
}

.citations-bar:hover {
    transform: scale(1.05);
    background: var(--accent-2);
}

/* Labels for X and Y axes */
.citations-list::after {
    content: 'Citations';
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-light);
}

.citation-list::before {
    content: 'Years';
    position: absolute;
    top: 50%;
    left: -3rem;
    transform: translateY(-50%) rotate(-90deg);
    color: var(--text-light);
}

.citation-list::before {
    content: 'Years';
    position: absolute;
    top: 50%;
    left: -3rem;
    transform: translateY(-50%) rotate(-90deg);
    color: var(--text-light);
}
/* ======== ANIMAÇÃO DE ENTRADA ======== */
@keyframes fadeInUp {
    from {
        transform: translate(0%, 0%);
        opacity: 0;
    }
    to {
        transform: translate(50%, 0%);
        opacity: 1;
    }
}

.social-modal.show {
    animation: fadeInUp 0.3s ease;
}

/* ======== RESPONSIVIDADE ======== */
@media (max-width: 480px) {
    .social-modal {
        width: 90%;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-header img {
        margin-bottom: 10px;
    }
}

/* Chart styles */
.chart-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    height: 120px; /* Reduza a altura do contêiner do gráfico */
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100px; /* Reduza a altura das barras do gráfico */
    border-left: 1px solid var(--text-light); /* Y-axis */
    border-bottom: 1px solid var(--text-light); /* X-axis */
    width: 100%;
}

.chart-bars .bar {
    background: var(--accent-2);
    border-radius: 4px;
    width: 25px; /* Reduza a largura das barras do gráfico */
    transition: transform 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    color: var(--text-light);
    font-size: 0.8rem;
    text-align: center;
}

.chart-bars .bar:hover {
    transform: scale(1.05);
    background: var(--accent-1);
}

.chart-years {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 5px;
}

.chart-years .year {
    font-size: 0.8rem;
    color: var(--text-light);
    width: 25px; /* Match the width of the bars */
    text-align: center;
}

/* RESPONSIVE: MOBILE */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        height: 100vh;
        flex-direction: column;
        gap: var(--spacing-sm);
        padding: var(--spacing-xl);
        display: none;
        justify-content: flex-start;
    }
    .nav-links.active {
        display: flex;
    }

    .intro-content {
        text-align: center;
    }
    .intro-content h1 {
        font-size: 2rem;
    }

    .section h2 {
        text-align: center;
    }
    .intro-content .social-links {
        justify-content: center;
        text-align: center;
    }

    .modal-bubble {
        width: 90%;
        max-width: 340px;
    }

    .cta-button {
        width: 100%;
    }

    .social-modal {
        width: 90%;
        top: 10%; /* Adjust position to be above social-links */
    }

    .social-links {
        order: -1; /* Move social links above */
        width: 100%;
        justify-content: center;
        margin-bottom: var(--spacing-md);
    }

    .scroll-btn {
        display: none;
    }
}

@media (max-width: 480px) {
    .hamburger {
        display: block;
    }
    
    .social-links {
        order: -1; /* Move social links above */
        width: 100%;
        justify-content: center;
        margin-bottom: var(--spacing-md);
    }
    
    .nav-links {
        padding-left: 10%;
    }
}

/* ====== UTILITIES ====== */
.theme-transition {
    position: fixed;
    inset: 0;
    background-color: var(--primary-bg);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 5s ease;
}

body, header, footer, .about-container, .about-content {
    transition: background-color 1s ease, color 0.2s ease;
}
