/* Modern Academic Theme for Leonardo Araujo */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-subtle: #eff6ff;
  --accent: #0284c7;
  
  --badge-book-bg: #f3e8ff;
  --badge-book-txt: #6b21a8;
  --badge-code-bg: #ecfdf5;
  --badge-code-txt: #047857;
  --badge-paper-bg: #eff6ff;
  --badge-paper-txt: #1d4ed8;
  --badge-teaching-bg: #e0f2fe;
  --badge-teaching-txt: #0369a1;
  --badge-media-bg: #fffbeb;
  --badge-media-txt: #b45309;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --max-width: 1080px;
}

[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #172033;
  --bg-subtle: #1f293d;
  --border-color: #2b3548;
  --border-subtle: #374151;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-subtle: rgba(59, 130, 246, 0.15);
  --accent: #38bdf8;
  
  --badge-book-bg: rgba(168, 85, 247, 0.2);
  --badge-book-txt: #c084fc;
  --badge-code-bg: rgba(16, 185, 129, 0.2);
  --badge-code-txt: #34d399;
  --badge-paper-bg: rgba(59, 130, 246, 0.2);
  --badge-paper-txt: #93c5fd;
  --badge-teaching-bg: rgba(14, 165, 233, 0.2);
  --badge-teaching-txt: #38bdf8;
  --badge-media-bg: rgba(245, 158, 11, 0.2);
  --badge-media-txt: #fbbf24;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navbar */
.site-header {
  position: sticky;
  top: 0;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .site-header {
  background-color: rgba(11, 15, 25, 0.85);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.brand-logo {
  height: 28px;
  max-height: 30px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

[data-theme="dark"] .brand-logo {
  filter: invert(1) brightness(1.2);
}

.brand-title {
  letter-spacing: -0.01em;
}

.brand-role {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-left: 1px solid var(--border-color);
  padding-left: 0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  line-height: 1.2;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--primary);
  background-color: var(--primary-subtle);
}

.nav-link.active {
  color: var(--primary);
  background-color: var(--primary-subtle);
  font-weight: 600;
}

/* Dropdown Menu */
.nav-item-dropdown {
  position: relative;
  list-style: none;
  display: inline-flex;
  align-items: center;
}

.dropdown-chevron {
  transition: transform 0.2s ease;
  vertical-align: middle;
  pointer-events: none;
}

.nav-item-dropdown:hover .dropdown-chevron,
.nav-item-dropdown:focus-within .dropdown-chevron,
.nav-item-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  list-style: none;
  z-index: 150;
  margin-top: 0;
}

/* Invisible bridge so mouse never loses hover connection */
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}

.nav-item-dropdown:hover .dropdown-menu,
.nav-item-dropdown:focus-within .dropdown-menu,
.nav-item-dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.dropdown-item:hover, .dropdown-item.active {
  color: var(--primary);
  background-color: var(--primary-subtle);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle, .menu-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-toggle:hover, .menu-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.menu-toggle {
  display: none;
}

/* Hero Section */
.hero-section {
  padding: 3.5rem 0 2.5rem;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-color);
}

.hero-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-avatar-wrap {
  text-align: center;
}

.hero-avatar {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 3px solid var(--border-color);
  box-shadow: var(--shadow-md);
  background-color: var(--bg-card);
}

.hero-name {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.hero-title {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.hero-affiliation {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.hero-quote {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-left: 3px solid var(--primary);
  padding: 0.35rem 0.85rem;
  margin: 1rem 0 1.25rem;
  background: var(--bg-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.hero-quote-author {
  display: block;
  font-size: 0.825rem;
  font-style: normal;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-weight: 600;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-subtle);
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.825rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-book { background-color: var(--badge-book-bg); color: var(--badge-book-txt); }
.badge-code { background-color: var(--badge-code-bg); color: var(--badge-code-txt); }
.badge-paper { background-color: var(--badge-paper-bg); color: var(--badge-paper-txt); }
.badge-teaching { background-color: var(--badge-teaching-bg); color: var(--badge-teaching-txt); }
.badge-media { background-color: var(--badge-media-bg); color: var(--badge-media-txt); }

/* Main Content */
.main-content {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

.page-header {
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* Sections */
.section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Cards & Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card-text {
  font-size: 0.925rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Publication Item */
.pub-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}

.pub-item:hover {
  border-color: var(--primary);
}

.pub-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.pub-year {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.pub-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.pub-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
}

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

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-secondary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.search-box {
  position: relative;
  min-width: 240px;
}

.search-input {
  width: 100%;
  padding: 0.45rem 0.85rem 0.45rem 2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* CV Specific Styles */
.cv-lattes-banner {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.08) 0%, rgba(2, 132, 199, 0.08) 100%);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cv-lattes-text h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.cv-lattes-text p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.cv-timeline {
  position: relative;
  padding-left: 1.75rem;
  border-left: 2px solid var(--border-color);
  margin-left: 0.5rem;
  margin-bottom: 2.5rem;
}

.cv-timeline-item {
  position: relative;
  margin-bottom: 1.75rem;
}

.cv-timeline-item::before {
  content: "";
  position: absolute;
  left: -2.35rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-primary);
}

.cv-timeline-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-mono);
  margin-bottom: 0.2rem;
}

.cv-timeline-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cv-timeline-place {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.cv-timeline-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Info Box / Contact Table */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.info-table th, .info-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  text-align: left;
}

.info-table th {
  color: var(--text-muted);
  font-weight: 600;
  width: 25%;
}

.info-table td {
  color: var(--text-primary);
}

.key-code {
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  word-break: break-all;
}

/* Teaching & Course Syllabus */
.syllabus-list {
  list-style: none;
}

.syllabus-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  margin-bottom: 0.65rem;
  font-size: 0.925rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.syllabus-item a:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: auto;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--primary);
}

/* Mobile responsive */
@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
  }
  
  .hero-avatar {
    width: 140px;
    height: 140px;
  }
  
  .hero-cta {
    justify-content: center;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 3.75rem;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    gap: 0.35rem;
  }
  
  .nav-links.open {
    display: flex;
  }

  .nav-item-dropdown .dropdown-menu {
    position: static;
    display: block;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    margin-top: 0;
    background: transparent;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    width: 100%;
  }
}
