/* ============================================
   DARK MODE - FC CONCURSOS (VERSÃO MELHORADA)
   Design tech, futurista e agradável
   ============================================ */

/* ===== VARIÁVEIS DE COR ===== */
:root {
  /* Light Mode */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --border-color: #dee2e6;
  --card-bg: #ffffff;
  --card-border: #dee2e6;
  --input-bg: #ffffff;
  --input-border: #ced4da;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-hover: rgba(0, 0, 0, 0.15);
  --accent-primary: #0d6efd;
  --accent-glow: rgba(13, 110, 253, 0.3);
}

html[data-bs-theme="dark"] {
  /* Dark Mode - Paleta Tech/Futurista */
  --bg-primary: #0a0e27;
  --bg-secondary: #151932;
  --bg-tertiary: #1e2442;
  --text-primary: #e4e6eb;
  --text-secondary: #b0b3c1;
  --border-color: #2d3352;
  --card-bg: #151932;
  --card-border: #2d3352;
  --input-bg: #1e2442;
  --input-border: #2d3352;
  --shadow: rgba(0, 0, 0, 0.5);
  --shadow-hover: rgba(13, 110, 253, 0.2);
  --accent-primary: #4da3ff;
  --accent-glow: rgba(77, 163, 255, 0.4);
}

/* ===== APLICAÇÃO GLOBAL ===== */
body {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html[data-bs-theme="dark"] body {
  background: linear-gradient(180deg, #0a0e27 0%, #0d1129 100%);
}

/* Remove sublinhados globalmente da navbar */
.navbar a {
  text-decoration: none !important;
}

.navbar .nav-link.active {
  text-decoration: none !important;
  border-bottom: none !important;
}

/* ===== HERO SECTION - MODO ESCURO APRIMORADO ===== */
html[data-bs-theme="dark"] .hero {
  background: linear-gradient(135deg, #1a1f3a 0%, #0d1129 100%);
  position: relative;
  overflow: hidden;
}

html[data-bs-theme="dark"] .hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(77, 163, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(13, 110, 253, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

html[data-bs-theme="dark"] .hero__bg {
  background: linear-gradient(135deg, #1e2442 0%, #0d1129 100%);
  opacity: 0.4;
}

html[data-bs-theme="dark"] .hero__title {
  color: #ffffff !important;
  text-shadow:
    0 0 20px rgba(77, 163, 255, 0.5),
    0 0 40px rgba(77, 163, 255, 0.3),
    2px 2px 4px rgba(0, 0, 0, 0.8);
  font-weight: 700;
}

html[data-bs-theme="dark"] .hero__subtitle {
  color: #b0b3c1 !important;
  text-shadow:
    0 0 10px rgba(77, 163, 255, 0.3),
    1px 1px 3px rgba(0, 0, 0, 0.6);
}

/* ===== CARDS - MODO ESCURO TECH ===== */
html[data-bs-theme="dark"] .card,
html[data-bs-theme="dark"] .folder-card,
html[data-bs-theme="dark"] .action-card {
  background: linear-gradient(145deg, #151932 0%, #1a1f3a 100%) !important;
  border: 1px solid var(--card-border) !important;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(77, 163, 255, 0.1) inset !important;
  color: #ffffff !important;
}

html[data-bs-theme="dark"] .card *,
html[data-bs-theme="dark"] .folder-card *,
html[data-bs-theme="dark"] .action-card * {
  color: #ffffff !important;
}

html[data-bs-theme="dark"] .action-card {
  position: relative;
  overflow: hidden;
}

html[data-bs-theme="dark"] .action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(77, 163, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

html[data-bs-theme="dark"] .action-card:hover::before {
  left: 100%;
}

html[data-bs-theme="dark"] .action-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary) !important;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.6),
    0 0 20px var(--accent-glow),
    0 0 0 1px var(--accent-primary) inset !important;
}

html[data-bs-theme="dark"] .action-card i {
  color: var(--accent-primary) !important;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

html[data-bs-theme="dark"] .action-card span {
  color: #ffffff !important;
}

/* ===== FOLDER CARD HEADER ===== */
html[data-bs-theme="dark"] .folder-card__header {
  background: linear-gradient(135deg, #1e2442 0%, #1a1f3a 100%) !important;
  border-bottom: 1px solid rgba(77, 163, 255, 0.2) !important;
  position: relative;
}

html[data-bs-theme="dark"] .folder-card__header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0.3;
}

html[data-bs-theme="dark"] .folder-card__header h5,
html[data-bs-theme="dark"] .folder-card__header * {
  color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ===== LIST GROUP ITEMS - EFEITO TECH ===== */
html[data-bs-theme="dark"] .list-group-item {
  background-color: rgba(30, 36, 66, 0.6) !important;
  border-color: var(--border-color) !important;
  border-left: 2px solid transparent !important;
  transition: all 0.3s ease;
  position: relative;
}

/* NOMES DAS PASTAS - AZUL HIPERLINK */
html[data-bs-theme="dark"] .list-group-item a:not(.btn):not([data-bs-toggle]) {
  color: #5eb0ff !important;
  text-decoration: none;
  font-weight: 800;
}

html[data-bs-theme="dark"] .list-group-item a:not(.btn):not([data-bs-toggle]):hover {
  color: #80c8ff !important;
  text-shadow: 0 0 12px rgba(94, 176, 255, 0.6);
  text-decoration: underline;
}

html[data-bs-theme="dark"] .list-group-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--accent-primary), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

html[data-bs-theme="dark"] .list-group-item:hover {
  background: linear-gradient(90deg, rgba(77, 163, 255, 0.1) 0%, rgba(30, 36, 66, 0.8) 100%) !important;
  border-left-color: var(--accent-primary) !important;
  transform: translateX(2px);
}

html[data-bs-theme="dark"] .list-group-item:hover::before {
  opacity: 1;
}

/* ===== BADGES - GLOW EFFECT ===== */
html[data-bs-theme="dark"] .badge {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #0d6efd 100%);
  box-shadow: 0 0 10px var(--accent-glow);
  border: 1px solid rgba(77, 163, 255, 0.3);
  color: #ffffff !important;
}

/* ===== ÍCONES DE PASTA - AMARELO DOURADO ===== */
html[data-bs-theme="dark"] .bi-folder,
html[data-bs-theme="dark"] .bi-folder-open,
html[data-bs-theme="dark"] .bi-folder-fill,
html[data-bs-theme="dark"] .fa-folder,
html[data-bs-theme="dark"] .fa-folder-open,
html[data-bs-theme="dark"] .fa-folder-closed {
  color: #ffd700 !important;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.6));
}

/* ===== BOTÕES DE AÇÃO - VERDE NEON ===== */
html[data-bs-theme="dark"] .list-group-item .bi-plus-circle,
html[data-bs-theme="dark"] .list-group-item .bi-plus-lg,
html[data-bs-theme="dark"] .list-group-item .bi-plus,
html[data-bs-theme="dark"] .list-group-item .bi-gear,
html[data-bs-theme="dark"] .list-group-item .bi-gear-fill,
html[data-bs-theme="dark"] .list-group-item .bi-list-ul,
html[data-bs-theme="dark"] .list-group-item .bi-bar-chart,
html[data-bs-theme="dark"] .list-group-item .bi-graph-up,
html[data-bs-theme="dark"] .list-group-item .fa-plus,
html[data-bs-theme="dark"] .list-group-item .fa-cog,
html[data-bs-theme="dark"] .list-group-item .fa-gear,
html[data-bs-theme="dark"] .list-group-item .fa-list,
html[data-bs-theme="dark"] .list-group-item .fa-chart-bar {
  color: #00ff88 !important;
  filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.7));
}

html[data-bs-theme="dark"] .list-group-item button:hover,
html[data-bs-theme="dark"] .list-group-item .btn-link:hover,
html[data-bs-theme="dark"] .list-group-item a[data-bs-toggle]:hover {
  transform: scale(1.1);
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.5);
}

/* ===== CONTADORES E NÚMEROS ===== */
html[data-bs-theme="dark"] .list-group-item small,
html[data-bs-theme="dark"] .list-group-item .text-muted {
  color: #b8d0ff !important;
  font-weight: 600;
}

/* ===== INPUTS E FORMS ===== */
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
  background-color: var(--input-bg) !important;
  border: 1px solid var(--input-border) !important;
  color: var(--text-primary) !important;
  transition: all 0.3s ease;
}

html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-select:focus {
  background-color: var(--input-bg) !important;
  border-color: var(--accent-primary) !important;
  box-shadow:
    0 0 0 0.25rem var(--accent-glow),
    0 0 20px var(--accent-glow) inset !important;
}

html[data-bs-theme="dark"] .form-control::placeholder {
  color: var(--text-secondary) !important;
  opacity: 0.6;
}

/* ===== MODAIS - DESIGN FUTURISTA ===== */
html[data-bs-theme="dark"] .modal-content {
  background: linear-gradient(145deg, #151932 0%, #1a1f3a 100%) !important;
  border: 1px solid rgba(77, 163, 255, 0.2) !important;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(77, 163, 255, 0.1) inset;
}

html[data-bs-theme="dark"] .modal-header {
  background: linear-gradient(135deg, #1e2442 0%, #1a1f3a 100%) !important;
  border-bottom: 1px solid rgba(77, 163, 255, 0.2) !important;
}

html[data-bs-theme="dark"] .modal-footer {
  background: linear-gradient(135deg, #1a1f3a 0%, #151932 100%) !important;
  border-top: 1px solid rgba(77, 163, 255, 0.2) !important;
}

/* ===== DROPDOWNS ===== */
html[data-bs-theme="dark"] .dropdown-menu {
  background: linear-gradient(145deg, #151932 0%, #1a1f3a 100%) !important;
  border: 1px solid rgba(77, 163, 255, 0.2) !important;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(77, 163, 255, 0.1) inset;
}

html[data-bs-theme="dark"] .dropdown-item {
  color: var(--text-primary) !important;
  transition: all 0.2s ease;
}

html[data-bs-theme="dark"] .dropdown-item:hover {
  background: linear-gradient(90deg, rgba(77, 163, 255, 0.15) 0%, rgba(30, 36, 66, 0.8) 100%) !important;
  color: var(--accent-primary) !important;
  transform: translateX(4px);
}

/* ===== BOTÕES ===== */
html[data-bs-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #0d6efd 100%);
  border: 1px solid rgba(77, 163, 255, 0.3);
  box-shadow: 0 4px 15px var(--accent-glow);
}

html[data-bs-theme="dark"] .btn-primary:hover {
  box-shadow: 0 6px 20px var(--accent-glow);
  transform: translateY(-2px);
}

html[data-bs-theme="dark"] .btn-secondary {
  background: linear-gradient(135deg, #1e2442 0%, #151932 100%) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

html[data-bs-theme="dark"] .btn-secondary:hover {
  background: linear-gradient(135deg, #2d3352 0%, #1e2442 100%) !important;
  border-color: var(--accent-primary) !important;
}

/* ===== NAVBAR - MAIS TECH ===== */
html[data-bs-theme="dark"] .navbar {
  background: linear-gradient(135deg, #0d1129 0%, #1a1f3a 100%) !important;
  border-bottom: 1px solid rgba(77, 163, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

/* Remove TODOS os sublinhados da navbar */
html[data-bs-theme="dark"] .navbar a,
html[data-bs-theme="dark"] .navbar .nav-link,
html[data-bs-theme="dark"] .navbar .dropdown-toggle,
html[data-bs-theme="dark"] .navbar .navbar-brand {
  text-decoration: none !important;
  text-underline-offset: 0 !important;
  border-bottom: none !important;
}

html[data-bs-theme="dark"] .navbar .nav-link {
  color: #e4e6eb !important;
  transition: all 0.3s ease;
  position: relative;
}

/* Garante que não há sublinhado em nenhum estado */
html[data-bs-theme="dark"] .navbar .nav-link:hover,
html[data-bs-theme="dark"] .navbar .nav-link:focus,
html[data-bs-theme="dark"] .navbar .nav-link:active,
html[data-bs-theme="dark"] .navbar .nav-link.active,
html[data-bs-theme="dark"] .navbar .nav-link.show {
  text-decoration: none !important;
  border-bottom: none !important;
}

html[data-bs-theme="dark"] .navbar .dropdown-toggle::after {
  vertical-align: middle;
  margin-left: 0.5em;
}

html[data-bs-theme="dark"] .navbar .nav-link:hover {
  color: var(--accent-primary) !important;
  text-shadow: 0 0 10px var(--accent-glow);
}

/* ===== FOOTER - DESIGN HARMONIOSO ===== */
html[data-bs-theme="dark"] .site-footer {
  background: linear-gradient(135deg, #0d1129 0%, #0a0e27 100%) !important;
  border-top: 1px solid rgba(77, 163, 255, 0.2);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
}

/* ===== SCROLLBAR - ESTILO TECH ===== */
html[data-bs-theme="dark"] ::-webkit-scrollbar {
  width: 10px;
  background-color: var(--bg-primary);
}

html[data-bs-theme="dark"] ::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #0a0e27 0%, #151932 100%);
  border-left: 1px solid rgba(77, 163, 255, 0.1);
}

html[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-primary) 0%, #0d6efd 100%);
  border-radius: 10px;
  box-shadow: 0 0 10px var(--accent-glow);
}

html[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6eb4ff 0%, var(--accent-primary) 100%);
  box-shadow: 0 0 15px var(--accent-glow);
}

/* ===== EFEITOS DE GLOW EM ÍCONES ===== */
html[data-bs-theme="dark"] .bi,
html[data-bs-theme="dark"] .fa-solid,
html[data-bs-theme="dark"] .fa-brands {
  filter: drop-shadow(0 0 2px rgba(77, 163, 255, 0.3));
}

/* ===== LINKS ===== */
html[data-bs-theme="dark"] a {
  color: var(--accent-primary);
  transition: all 0.3s ease;
}

html[data-bs-theme="dark"] a:hover {
  color: #6eb4ff;
  text-shadow: 0 0 8px var(--accent-glow);
}

/* ===== TEXTO MUTED ===== */
html[data-bs-theme="dark"] .text-muted {
  color: var(--text-secondary) !important;
}

/* ===== BORDAS COM GLOW SUTIL ===== */
html[data-bs-theme="dark"] .border {
  border-color: rgba(77, 163, 255, 0.2) !important;
}

/* ===== TRANSIÇÕES SUAVES ===== */
* {
  transition: background-color 0.3s ease,
              color 0.3s ease,
              border-color 0.3s ease;
}

/* ===== CLOSE BUTTON ===== */
html[data-bs-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.8;
}

html[data-bs-theme="dark"] .btn-close:hover {
  opacity: 1;
  filter: invert(1) grayscale(100%) brightness(200%) drop-shadow(0 0 5px var(--accent-glow));
}

/* ===== TOAST/ALERTS ===== */
html[data-bs-theme="dark"] .toast {
  background: linear-gradient(145deg, #151932 0%, #1a1f3a 100%) !important;
  border: 1px solid rgba(77, 163, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

html[data-bs-theme="dark"] .alert {
  border: 1px solid rgba(77, 163, 255, 0.2);
  background: rgba(30, 36, 66, 0.6);
}

/* ===== TABLES ===== */
html[data-bs-theme="dark"] .table {
  color: var(--text-primary) !important;
}

html[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(30, 36, 66, 0.4) !important;
}

html[data-bs-theme="dark"] table thead th {
  background: linear-gradient(135deg, #1e2442 0%, #1a1f3a 100%) !important;
  border-bottom: 2px solid rgba(77, 163, 255, 0.3) !important;
}

/* ===== ANIMAÇÃO DE PULSE SUTIL ===== */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px var(--accent-glow);
  }
  50% {
    box-shadow: 0 0 15px var(--accent-glow);
  }
}

html[data-bs-theme="dark"] .action-card:hover i {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ===== COMPATIBILIDADE MODO CLARO ===== */
html[data-bs-theme="light"] .card,
html[data-bs-theme="light"] .folder-card,
html[data-bs-theme="light"] .action-card {
  background-color: var(--card-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--text-primary) !important;
}

html[data-bs-theme="light"] .folder-card__header,
html[data-bs-theme="light"] .card-header {
  background-color: var(--bg-secondary) !important;
  border-color: var(--card-border) !important;
}

html[data-bs-theme="light"] .list-group-item {
  background-color: var(--card-bg) !important;
  border-color: var(--border-color) !important;
}

html[data-bs-theme="light"] .form-control {
  background-color: var(--input-bg) !important;
  border-color: var(--input-border) !important;
}

/* ===== FORÇA TEXTO BRANCO NO MODO ESCURO ===== */
html[data-bs-theme="dark"] h1,
html[data-bs-theme="dark"] h2,
html[data-bs-theme="dark"] h3,
html[data-bs-theme="dark"] h4,
html[data-bs-theme="dark"] h5,
html[data-bs-theme="dark"] h6,
html[data-bs-theme="dark"] p,
html[data-bs-theme="dark"] span:not(.list-group-item span),
html[data-bs-theme="dark"] div,
html[data-bs-theme="dark"] label,
html[data-bs-theme="dark"] strong,
html[data-bs-theme="dark"] b {
  color: #ffffff !important;
}

/* Exceções - CORES ESPECÍFICAS */

/* Pastas - AZUL HIPERLINK */
html[data-bs-theme="dark"] .list-group-item a:not(.btn):not([data-bs-toggle]) {
  color: #5eb0ff !important;
}

/* Ícones de pasta - AMARELO DOURADO */
html[data-bs-theme="dark"] .bi-folder,
html[data-bs-theme="dark"] .bi-folder-fill,
html[data-bs-theme="dark"] .fa-folder,
html[data-bs-theme="dark"] .fa-folder-open {
  color: #ffd700 !important;
}

/* Botões de ação - VERDE NEON */
html[data-bs-theme="dark"] .list-group-item .bi-plus-circle,
html[data-bs-theme="dark"] .list-group-item .bi-plus-lg,
html[data-bs-theme="dark"] .list-group-item .bi-plus,
html[data-bs-theme="dark"] .list-group-item .bi-gear,
html[data-bs-theme="dark"] .list-group-item .bi-gear-fill,
html[data-bs-theme="dark"] .list-group-item .bi-list-ul,
html[data-bs-theme="dark"] .list-group-item .fa-plus,
html[data-bs-theme="dark"] .list-group-item .fa-cog,
html[data-bs-theme="dark"] .list-group-item .fa-gear {
  color: #00ff88 !important;
}

html[data-bs-theme="dark"] .text-muted {
  color: #b0b3c1 !important;
}

/* Botões de ação nos cards */
html[data-bs-theme="dark"] .btn,
html[data-bs-theme="dark"] button {
  color: #ffffff !important;
}

html[data-bs-theme="dark"] .btn-primary {
  color: #ffffff !important;
}

/* Números e contadores */
html[data-bs-theme="dark"] .badge,
html[data-bs-theme="dark"] .count,
html[data-bs-theme="dark"] .number {
  color: #ffffff !important;
}