/* --- VARIÁVEIS DE CORES (DARK MODE) --- */
:root {
  --bg-body: #121214;        
  --bg-card: #202024;        
  --bg-hover: #29292e;       
  --text-main: #e1e1e6;      
  --text-muted: #a8a8b3;     
  --accent-color: #8257e5;   
  --focus-color: #ffcd1e;    
  --border-color: #323238;   
  --close-btn-bg: #323238; /* Cor de fundo do botão fechar */
}

/* --- GERAL --- */
body {
  background-color: var(--bg-body) !important;
  color: var(--text-main) !important;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Classe utilitária para leitores de tela */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* --- LAYOUT --- */
.video-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 40px;
  color: var(--text-main);
  text-align: center;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 15px;
  display: inline-block;
  width: 100%;
}

/* --- LISTA DE VÍDEOS (GRID) --- */
.video-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.video-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.video-card-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.video-card-btn:hover .video-card {
  transform: translateY(-5px);
  background-color: var(--bg-hover);
  border-color: var(--accent-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.video-card-btn:focus {
  outline: none;
}

.video-card-btn:focus .video-card {
  outline: 4px solid var(--focus-color);
  outline-offset: 4px;
  border-color: var(--focus-color);
}

/* Thumbnail */
.video-thumbnail-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; 
  background-color: #000;
  overflow: hidden;
}

.video-thumbnail-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-card-btn:hover img {
  transform: scale(1.05);
}

.play-icon-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--text-main);
  opacity: 0.8;
  transition: opacity 0.2s;
}

.video-card-btn:hover .play-icon-overlay {
  opacity: 1;
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.video-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.video-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-main);
  line-height: 1.4;
}

.video-info p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* --- MODAL ESTILO "CARD" REFINADO --- */

.modal-content {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 12px; 
  box-shadow: 0 20px 50px rgba(0,0,0,0.9); /* Sombra mais forte para destacar */
}

/* Tamanho compacto da modal */
.modal-compact {
  max-width: 500px !important;
  margin-left: auto;
  margin-right: auto;
}

/* --- CABEÇALHO DA MODAL (HEADER) --- */
.modal-header {
  border-bottom: none; /* Remove a linha divisória */
  padding: 16px 20px; /* Padding reduzido para economizar espaço */
  display: flex;
  align-items: center; /* Centraliza verticalmente o título e o X */
  justify-content: space-between;
}

/* Estilo do Título da Modal */
.custom-modal-title {
  font-size: 1.15rem; /* Tamanho controlado */
  font-weight: 700;   /* Negrito */
  margin: 0;
  line-height: 1.3;
  color: #fff;
  flex: 1; /* Ocupa o espaço disponível */
  padding-right: 15px; /* Espaço para não bater no botão X */
}

/* Botão Fechar Customizado (Estilo "X" quadrado) */
.custom-close-btn {
  background-color: var(--close-btn-bg);
  color: #fff;
  border: none;
  border-radius: 6px; /* Cantos levemente arredondados */
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  flex-shrink: 0; /* Impede que o botão encolha */
}

.custom-close-btn:hover {
  background-color: #45454d;
}

.custom-close-btn:focus {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

/* --- CORPO DA MODAL --- */
.modal-body {
  padding: 0 20px 20px 20px; /* Remove padding do topo para colar no header */
}

.video-transcript {
  text-align: left; 
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  justify-content: center;
  padding: 12px;
}

kbd {
  background-color: #323238;
  color: var(--focus-color);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'Consolas', monospace;
  font-size: 0.9em;
}

/* Responsividade */
@media (max-width: 768px) {
  .modal-compact {
    max-width: 92% !important; 
  }
}
