/* ==========================================================================
   PORTAL DE EDUCAÇÃO TECNOLÓGICA - IN-FOTON & LABTEL / UFES
   Design System Oficial (Azul LabTel #0972B6 + Fundo Branco Puro)
   Docente Responsável: Prof. Marcelo Eduardo Vieira Segatto
   ========================================================================== */

:root {
  --color-primary: #0972B6;       /* Azul oficial LabTel */
  --color-primary-dark: #064A75;  /* Marinho institucional */
  --color-primary-light: #F0F6FA; /* Névoa suave para cards e blocos */
  --color-secondary: #00A389;     /* Verde fotônica IN-FOTON */
  --color-accent-coral: #E63946;  /* Coral vibrante */
  --color-text-main: #1E293B;     /* Grafite escuro para leitura */
  --color-text-muted: #64748B;    /* Texto secundário */
  --color-border: #E2E8F0;        /* Bordas sutis */
  --color-bg-pure: #FFFFFF;       /* Branco puro */
  --color-bg-subtle: #F8FAFC;     /* Fundo suave para contraste */
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;
  
  --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 -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-pure);
  color: var(--color-text-main);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   NAVBAR SUPERIOR
   ========================================================================== */
.site-header {
  background-color: var(--color-bg-pure);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
}

.brand-logos {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand-logos img {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 32px;
  background-color: var(--color-border);
}

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

/* --------------------------------------------------------------------------
   MENUS SUSPENSOS (DROPDOWNS)
   -------------------------------------------------------------------------- */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-main);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.nav-dropdown-btn:hover,
.nav-dropdown.active .nav-dropdown-btn,
.nav-dropdown:focus-within .nav-dropdown-btn {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
  border-color: rgba(2, 132, 199, 0.2);
}

.nav-dropdown-btn .dropdown-chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.nav-dropdown:hover .dropdown-chevron,
.nav-dropdown.active .dropdown-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 300px;
  max-width: 370px;
  max-height: min(500px, calc(100vh - 100px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.16), 0 4px 12px -2px rgba(0, 0, 0, 0.08);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 2000;
  scrollbar-width: thin;
  scrollbar-color: #0972B6 #F1F5F9;
}

/* Invisible bridge between button and menu so hover is never lost */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.nav-dropdown-menu::-webkit-scrollbar {
  width: 7px;
}

.nav-dropdown-menu::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 4px;
}

.nav-dropdown-menu::-webkit-scrollbar-thumb {
  background-color: #0972B6;
  border-radius: 4px;
}

.nav-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background-color: #075985;
}

.nav-dropdown-menu.align-right {
  left: auto;
  right: 0;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.active .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--color-text-main) !important;
  background: transparent !important;
  transition: background 0.15s ease, transform 0.15s ease;
  margin-bottom: 2px;
}

.nav-dropdown-item:hover,
.nav-dropdown-item.active {
  background: #F0F7FD !important;
  color: var(--color-primary-dark) !important;
}

.dropdown-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #EBF3FA;
  flex-shrink: 0;
  color: var(--color-primary);
  font-size: 1rem;
}

.dropdown-item-icon img,
.dropdown-item-icon svg {
  width: 18px;
  height: 18px;
}

.dropdown-item-content {
  flex: 1;
  min-width: 0;
}

.dropdown-item-title {
  font-weight: 600;
  font-size: 0.86rem;
  line-height: 1.3;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.nav-dropdown-item:hover .dropdown-item-title {
  color: var(--color-primary);
}

.dropdown-item-desc {
  font-size: 0.74rem;
  color: var(--color-text-muted);
  line-height: 1.3;
  margin-top: 0.2rem;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 0.4rem 0.5rem;
}

.dropdown-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: #EFF6FF;
  color: #1D4ED8;
}

/* --------------------------------------------------------------------------
   BOTÃO MINIMALISTA DE USUÁRIO / LOGIN (ÍCONE 👤)
   -------------------------------------------------------------------------- */
.auth-user-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
}

.auth-user-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #FFFFFF;
  color: var(--color-text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  padding: 0;
}

.auth-user-icon-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #F0F7FD;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.auth-user-icon-btn.logged-in {
  background: #0284C7;
  border-color: #0284C7;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.85rem;
}

.auth-user-icon-btn .online-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  background: #10B981;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
}

/* MENU SUSPENSO DO PERFIL DO USUÁRIO */
.user-profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.15);
  padding: 0.6rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2100;
}

.auth-user-container:hover .user-profile-menu,
.auth-user-container:focus-within .user-profile-menu,
.auth-user-container.active .user-profile-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-profile-header {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.4rem;
}

.user-profile-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-email {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

.user-profile-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-main);
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}

.user-profile-item:hover {
  background: #F1F5F9;
  color: var(--color-primary-dark);
}

.user-profile-item.logout {
  color: #DC2626;
}

.user-profile-item.logout:hover {
  background: #FEF2F2;
}

.btn-header {
  background-color: var(--color-primary);
  color: white !important;
  padding: 0.45rem 0.9rem !important;
  border-radius: var(--radius-md);
  font-weight: 600 !important;
  font-size: 0.85rem !important;
}

.btn-header:hover {
  background-color: var(--color-primary-dark) !important;
}

/* ==========================================================================
   HERO BANNER
   ========================================================================== */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  background: linear-gradient(180deg, #F0F6FA 0%, #FFFFFF 100%);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background-color: #E0EFF8;
  color: var(--color-primary-dark);
  font-size: 0.825rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  line-height: 1.2;
  margin-bottom: 1.2rem;
  letter-spacing: -0.02em;
}

.hero-title span {
  color: var(--color-primary);
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  max-width: 820px;
  margin: 0 auto 2rem;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.95rem;
  color: var(--color-text-main);
  flex-wrap: wrap;
}

.hero-meta strong {
  color: var(--color-primary-dark);
}

/* ==========================================================================
   HERO COM FUNDO ESCURO (SIMULADORES E LABS)
   ========================================================================== */
.hero-section[style*="linear-gradient(135deg"],
.hero-section[style*="background: linear-gradient(135deg"],
.hero-section.hero-dark-bg {
  color: #F8FAFC !important;
}

.hero-section[style*="linear-gradient(135deg"] .hero-title,
.hero-section[style*="background: linear-gradient(135deg"] .hero-title,
.hero-section.hero-dark-bg .hero-title {
  color: #FFFFFF !important;
}

.hero-section[style*="linear-gradient(135deg"] .hero-title span,
.hero-section[style*="background: linear-gradient(135deg"] .hero-title span,
.hero-section.hero-dark-bg .hero-title span {
  color: #38BDF8 !important;
}

.hero-section[style*="linear-gradient(135deg"] .hero-subtitle,
.hero-section[style*="background: linear-gradient(135deg"] .hero-subtitle,
.hero-section.hero-dark-bg .hero-subtitle {
  color: #E2E8F0 !important;
}

.hero-section[style*="linear-gradient(135deg"] .hero-meta,
.hero-section[style*="background: linear-gradient(135deg"] .hero-meta,
.hero-section.hero-dark-bg .hero-meta {
  color: #CBD5E1 !important;
}

.hero-section[style*="linear-gradient(135deg"] .hero-meta strong,
.hero-section[style*="background: linear-gradient(135deg"] .hero-meta strong,
.hero-section.hero-dark-bg .hero-meta strong {
  color: #93C5FD !important;
}

/* ==========================================================================
   GRID DE TRILHAS E CARDS
   ========================================================================== */
.section-padding {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
}

.track-card {
  background: var(--color-bg-pure);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.track-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-primary);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.track-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #B9D9EB;
}

.track-card:hover::before {
  opacity: 1;
}

.track-card.active-track::before {
  opacity: 1;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.card-badge {
  align-self: flex-start;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.badge-active {
  background-color: #DCFCE7;
  color: #15803D;
}

.badge-coming {
  background-color: #F1F5F9;
  color: #64748B;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.75rem;
}

.card-desc {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card-features {
  list-style: none;
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
}

.card-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  color: var(--color-text-main);
}

.card-features li svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

.card-action {
  margin-top: auto;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.25rem;
  background-color: var(--color-primary);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  color: white;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.25rem;
  background-color: transparent;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary);
}

/* ==========================================================================
   TABELAS E CALLOUTS DE CONTEÚDO ACADÊMICO
   ========================================================================== */
.table-responsive {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.academic-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.academic-table th {
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
  padding: 0.85rem 1.1rem;
  border-bottom: 2px solid var(--color-border);
}

.academic-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--color-border);
}

.academic-table tr:hover td {
  background-color: #FAFBFD;
}

.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.callout-info {
  background-color: var(--color-primary-light);
  border-left-color: var(--color-primary);
}

.callout-info h4 {
  color: var(--color-primary-dark);
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.callout-tip {
  background-color: #ECFDF5;
  border-left-color: var(--color-secondary);
}

.callout-tip h4 {
  color: #065F46;
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

/* ==========================================================================
   RODAPÉ GERAL
   ========================================================================== */
.site-footer {
  background-color: #0F172A;
  color: #94A3B8;
  padding: 3.5rem 0 2rem;
  margin-top: 5rem;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-brand h3 {
  color: white;
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  line-height: 1.6;
  margin-bottom: 1rem;
}

.footer-col h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: #94A3B8;
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #1E293B;
  padding-top: 1.75rem;
  text-align: center;
  font-size: 0.85rem;
}

/* ==========================================================================
   CARDS DE BIOGRAFIAS E CIENTISTAS
   ========================================================================== */
.scientist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.75rem;
  margin: 2rem 0;
}

.scientist-card {
  background: var(--color-bg-pure);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.scientist-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: #B9D9EB;
}

.scientist-img-container {
  width: 100%;
  height: 260px;
  overflow: hidden;
  position: relative;
  background-color: #F1F5F9;
}

.scientist-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s ease;
}

.scientist-card:hover .scientist-img {
  transform: scale(1.04);
}

.scientist-body {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.scientist-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.2rem;
}

.scientist-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.scientist-desc {
  font-size: 0.9rem;
  color: var(--color-text-main);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.scientist-formula {
  background-color: var(--color-primary-light);
  border: 1px solid #D0E4F2;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.5rem;
  text-align: center;
  margin-top: auto;
  font-size: 0.92rem;
}

/* Responsividade */
@media (max-width: 768px) {
  .hero-title { font-size: 2.1rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .header-inner { flex-direction: column; gap: 1rem; }
  .scientist-grid { grid-template-columns: 1fr; }
}

/* Utilitários para renderização de fórmulas matemáticas (KaTeX & MathJax) */
.math-scroll-box {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  margin: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
}
.math-scroll-box mjx-container,
.math-scroll-box .katex-display,
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding: 0.25rem 0;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   ESTILOS DO MODAL / POPUP INTERATIVO DE PERSONALIDADES (OBSIDIAN SYNC)
   ========================================================================== */

/* Cartão Interativo */
.scientist-card {
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.scientist-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.18);
  border-color: #059669;
}
.scientist-card:focus-visible {
  outline: 3px solid #059669;
  outline-offset: 3px;
}
.scientist-card-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #065F46;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.scientist-card:hover .scientist-card-cta {
  background: #059669;
  color: #FFFFFF;
}

/* Modal Overlay & Backdrop */
.scientist-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.scientist-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Dialog Box */
.scientist-modal-dialog {
  background: #FFFFFF;
  width: 100%;
  max-width: 980px;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.38);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transform: scale(0.96) translateY(12px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.scientist-modal-overlay.is-open .scientist-modal-dialog {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.scientist-modal-header {
  padding: 1.25rem 1.75rem;
  background: #0F172A;
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #059669;
}
.scientist-modal-tags {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.scientist-modal-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(52, 211, 153, 0.35);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.scientist-modal-country {
  color: #94A3B8;
  font-size: 0.8rem;
  font-weight: 500;
}
.scientist-modal-name {
  font-size: 1.55rem;
  font-weight: 800;
  margin: 0;
  color: #FFFFFF;
  line-height: 1.2;
}
.scientist-modal-meta {
  font-size: 0.88rem;
  color: #CBD5E1;
  margin: 0.2rem 0 0;
}
.scientist-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #CBD5E1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}
.scientist-modal-close:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
  transform: rotate(90deg);
}

/* Modal Content & Grid Layout */
.scientist-modal-content {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.scientist-modal-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Sidebar */
.scientist-modal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.scientist-modal-img-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border: 1px solid #E2E8F0;
  background-color: #F8FAFC;
}
.scientist-modal-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.scientist-modal-caption {
  font-size: 0.8rem;
  color: #64748B;
  font-style: italic;
  line-height: 1.45;
  margin: 0;
  background: #F8FAFC;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border-left: 3px solid #CBD5E1;
}
.scientist-modal-epithet-box {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  padding: 0.75rem 0.95rem;
}
.epithet-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #166534;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}
.epithet-text {
  font-size: 0.86rem;
  font-weight: 600;
  color: #14532D;
  line-height: 1.4;
}
.scientist-modal-meta-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 0.75rem 0.95rem;
}
.meta-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}
.meta-text {
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.4;
}

/* Main Content Area inside Modal */
.scientist-modal-main {
  font-size: 0.94rem;
  color: #334155;
  line-height: 1.7;
}
.scientist-modal-main h3 {
  border-bottom: 2px solid #E2E8F0;
  padding-bottom: 0.4rem;
}

/* Modal Footer & Navigation */
.scientist-modal-footer {
  padding: 1rem 1.75rem;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.scientist-modal-nav-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.scientist-modal-btn {
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.scientist-modal-btn.btn-nav {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #334155;
}
.scientist-modal-btn.btn-nav:hover {
  background: #059669;
  color: #FFFFFF;
  border-color: #059669;
}
.scientist-modal-counter {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748B;
  padding: 0 0.4rem;
}
.scientist-modal-btn.btn-close {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #475569;
}
.scientist-modal-btn.btn-close:hover {
  background: #E2E8F0;
  color: #0F172A;
}

/* Responsividade do Modal */
@media (max-width: 860px) {
  .scientist-modal-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .scientist-modal-sidebar {
    max-width: 320px;
    margin: 0 auto;
  }
  .scientist-modal-header {
    padding: 1rem 1.25rem;
  }
  .scientist-modal-content {
    padding: 1.25rem;
  }
  .scientist-modal-footer {
    padding: 0.85rem 1.25rem;
    flex-wrap: wrap;
  }
}


