/* ==========================================================================
   VARIÁVEIS GERAIS
   ========================================================================== */
:root {
  --primary-color: #2E7D32;
  --primary-hover: #1B5E20;
  --secondary-color: #F57C00;
  --secondary-hover: #E65100;
  --accent-color: #FFC107;
  --text-dark: #333333;
  --text-light: #F8F9FA;
  --bg-light: #F8F9FA;
  --bg-white: #FFFFFF;
  --border-color: #E0E0E0;
  --shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .075);
  --shadow-md: 0 .5rem 1rem rgba(0, 0, 0, .15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, .175);
  --transition: all 0.3s ease-in-out;
}

/* ==========================================================================
   ALTO CONTRASTE — Cobertura Completa WCAG AA
   ========================================================================== */
body.high-contrast {
  --primary-color: #FFD600;
  --primary-hover: #F9A825;
  --secondary-color: #FFD600;
  --secondary-hover: #F9A825;
  --text-dark: #FFFFFF;
  --text-light: #000000;
  --bg-light: #0A0A0A;
  --bg-white: #121212;
  background-color: #000000 !important;
  color: #FFFFFF !important;
}

/* Fundo de todos os containers e seções */
body.high-contrast section,
body.high-contrast header,
body.high-contrast footer,
body.high-contrast nav,
body.high-contrast .card,
body.high-contrast .modal-content,
body.high-contrast .dropdown-menu,
body.high-contrast .bg-white,
body.high-contrast .bg-light,
body.high-contrast .bg-dark {
  background-color: #121212 !important;
  color: #FFFFFF !important;
}

/* Bordas bem visíveis */
body.high-contrast *,
body.high-contrast .card,
body.high-contrast .form-control,
body.high-contrast .input-group-text {
  border-color: #FFD600 !important;
  outline-color: #FFD600 !important;
}

/* Links e ícones primários */
body.high-contrast a,
body.high-contrast .text-primary,
body.high-contrast .nav-link,
body.high-contrast .navbar-brand,
body.high-contrast .dropdown-item {
  color: #FFD600 !important;
  text-decoration: underline;
}

body.high-contrast a:hover,
body.high-contrast .nav-link:hover,
body.high-contrast .dropdown-item:hover {
  color: #FFFFFF !important;
  background-color: #333300 !important;
}

/* Botões primários */
body.high-contrast .btn-primary,
body.high-contrast .btn-primary-custom,
body.high-contrast .bg-primary {
  background-color: #000000 !important;
  color: #FFD600 !important;
  border: 2px solid #FFD600 !important;
}

body.high-contrast .btn-primary:hover,
body.high-contrast .btn-primary-custom:hover {
  background-color: #FFD600 !important;
  color: #000000 !important;
}

/* Botões secundários */
body.high-contrast .btn-secondary,
body.high-contrast .btn-secondary-custom,
body.high-contrast .bg-secondary {
  background-color: #000000 !important;
  color: #FFFFFF !important;
  border: 2px solid #FFFFFF !important;
}

/* Botões outline */
body.high-contrast .btn-outline-primary,
body.high-contrast .btn-outline-secondary,
body.high-contrast .btn-outline-light {
  background-color: #000000 !important;
  color: #FFD600 !important;
  border: 2px solid #FFD600 !important;
}

body.high-contrast .btn-outline-primary:hover,
body.high-contrast .btn-outline-secondary:hover,
body.high-contrast .btn-outline-light:hover {
  background-color: #FFD600 !important;
  color: #000000 !important;
}

/* Texto muted vira legível */
body.high-contrast .text-muted,
body.high-contrast .text-white-50,
body.high-contrast .text-secondary {
  color: #CCCCCC !important;
}

/* Badges */
body.high-contrast .badge {
  background-color: #000000 !important;
  color: #FFD600 !important;
  border: 1px solid #FFD600 !important;
}

/* Formulários */
body.high-contrast .form-control,
body.high-contrast .input-group-text {
  background-color: #1A1A1A !important;
  color: #FFFFFF !important;
  caret-color: #FFD600;
}

body.high-contrast .form-control::placeholder {
  color: #999999 !important;
}

/* Navbar */
body.high-contrast .navbar {
  background-color: #0A0A0A !important;
  border-bottom: 2px solid #FFD600 !important;
}

/* Footer */
body.high-contrast .footer {
  background-color: #0A0A0A !important;
  border-top: 2px solid #FFD600 !important;
}

/* Hero section */
body.high-contrast .hero-section {
  background: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.85)),
    url('../img/hero-principal.jpeg') center / cover no-repeat !important;
  border-bottom: 3px solid #FFD600 !important;
}

/* Cards PcD em high-contrast */
body.high-contrast .pcd-card {
  background: #1A1A1A !important;
  border: 2px solid #FFD600 !important;
}

/* Foco visível (WCAG 2.4.7) */
body.high-contrast *:focus,
body.high-contrast *:focus-visible {
  outline: 3px solid #FFD600 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 4px rgba(255, 214, 0, 0.4) !important;
}

/* ==========================================================================
   RESET BASIC & TIPOGRAFIA
   ========================================================================== */
body {
  font-family: 'Open Sans', sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-light);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

a {
  text-decoration: none;
  transition: var(--transition);
}

/* ==========================================================================
   LOader
   ========================================================================== */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-white);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(46, 125, 50, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   COMPONENTES FIXOS
   ========================================================================== */
#btn-back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  z-index: 1000;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

#btn-back-to-top:hover {
  background-color: var(--primary-hover);
  transform: translateY(-3px);
}

#btn-accessibility {
  position: fixed;
  top: 70px;
  right: 0;
  z-index: 1040;
  background-color: #000;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 20px 0 0 20px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn-floating-donate {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  background-color: var(--secondary-color);
  color: white;
  padding: 15px 20px;
  border-radius: 30px 0 0 30px;
  font-weight: bold;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-floating-donate:hover {
  background-color: var(--secondary-hover);
  color: white;
  padding-right: 30px;
}

/* ==========================================================================
   CARDS, BADGES E COMPONENTES
   ========================================================================== */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.card-img-top.placeholder-img {
  height: 200px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.badge-custom {
  padding: 8px 12px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.85rem;
}

.btn-primary-custom {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

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

.btn-secondary-custom {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: white;
}

.btn-secondary-custom:hover {
  background-color: var(--secondary-hover);
  border-color: var(--secondary-hover);
  color: white;
}

/* HERO SECTION */
.hero-section {
  position: relative;
  background:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url('../img/hero-principal.jpeg') center / cover no-repeat;
  color: #fff;
  padding: 200px 0;
}

/* PROGRESS BAR */
.progress {
  height: 10px;
  border-radius: 5px;
}

.progress-bar {
  background-color: var(--primary-color);
}

/* MEDIA QUERIES MANUAIS */
@media (max-width: 768px) {
  .hero-section {
    padding: 80px 0;
  }

  .btn-floating-donate {
    padding: 10px 15px;
    font-size: 0.85rem;
  }
}

/* FOOTER */
.footer {
  background-color: var(--primary-color);
  color: white;
  padding-top: 60px;
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
}

.footer a:hover {
  color: white;
}

/* ==========================================================================
   CARDS PcD — Acessibilidade
   ========================================================================== */
.pcd-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition);
}

.pcd-card:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.pcd-icon-wrap {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: var(--transition);
}

.pcd-card:hover .pcd-icon-wrap {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

kbd {
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.78rem;
  color: #fff;
  font-family: monospace;
}

/* ==========================================================================
   BUSCA HERO — Campo de busca e resultados dropdown
   ========================================================================== */
#hero-search-input {
  min-width: 0;
  background-color: #ffffff;
  color: #333;
}

#hero-search-input:focus {
  box-shadow: none;
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: #333;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item:focus {
  background-color: #f0f7f0;
  color: var(--primary-color);
}

.search-result-item .sri-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 1rem;
}

.search-result-item .sri-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.search-result-item .sri-sub {
  font-size: 0.78rem;
  color: #777;
}

#hero-search-results .search-no-results {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 0.9rem;
}

/* ==========================================================================
   MODO FOCO — Destaque visual de foco para teclado
   ========================================================================== */
body.focus-mode *:focus,
body.focus-mode *:focus-visible {
  outline: 3px solid #2E7D32 !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 5px rgba(46, 125, 50, 0.35) !important;
  border-radius: 4px;
}

/* Ajusta posição relativa do wrapper de busca para dropdown posicionar certo */
.hero-search-wrapper {
  position: relative;
}