@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800&display=swap");

:root {
  --primary-color: #4d2d7b;
  --secondary-color: #25b34b;
  --light-color: #f2edf7;
  --white-color: #ffffff;
  --text-color: #333;
  --highlight-color: #25b34b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background-color: var(--light-color);
  color: var(--text-color);
  overflow: hidden;
}

.grid-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "header header" "main sidebar" "footer footer";
  height: 100vh;
  width: 100vw;
}

.header,
.tv-area,
.sidebar,
.footer {
  transition: filter 0.5s ease;
}

.header {
  grid-area: header;
  background-color: var(--white-color);
  padding: 8px 20px;
  display: flex;
  justify-content: space-between; /* Alinha o logo e o usuário */
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  z-index: 10;
}
.logo {
  height: 40px;
  width: auto;
}

/* Header User Info */
.header-user {
  display: flex;
  align-items: center;
  gap: 15px;
}

#user-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-color);
  display: flex;
  align-items: center;
  line-height: 1; /* Adicionado para um alinhamento mais preciso */
}

.btn-logout {
  background-color: var(--secondary-color);
  color: var(--white-color);
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-family: "Nunito", sans-serif;
  transition: background-color 0.3s ease;
}

.btn-logout:hover {
  background-color: #1e8e3a;
}

/* Hamburger Menu */
.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  z-index: 1001;
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

.hamburger-btn .close-icon {
  display: none;
}

.side-menu {
  position: fixed;
  top: 0;
  right: -280px; /* Start off-screen */
  width: 250px;
  height: 100%;
  background-color: var(--white-color);
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
  padding: 20px;
  transition: right 0.3s ease-in-out;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.side-menu.open {
  right: 0; /* Slide in */
}

.side-menu .btn-logout {
  width: 100%;
}

/* Configuração de Logo no Menu */
.menu-section {
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 15px;
}

.menu-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.logo-selector {
  width: 100%;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background-color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logo-selector:hover {
  border-color: var(--primary-color);
}

.logo-selector:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  z-index: 999;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.tv-area {
  grid-area: main;
  padding: 20px;
  display: flex;
  overflow: hidden; /* Evita que o vídeo quebre o layout */
}

.video-placeholder {
  width: 100%;
  height: 100%;
  max-height: 100%; /* Limita altura ao container */
  background-color: transparent;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  overflow: hidden; /* Evita overflow do vídeo */
}

#tv-player {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* Mantém proporção do vídeo sem cortar */
  border-radius: 12px;
  display: block;
  margin: auto; /* Centraliza o vídeo */
}

.sidebar {
  grid-area: sidebar;
  background-color: var(--white-color);
  padding: 10px 20px 20px;
  border-left: 1px solid #eee;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#password-list {
  list-style: none;
  padding: 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 15px;
}

#password-list li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  border-radius: 12px;
  background-color: var(--light-color);
  font-weight: 800;
  transition: all 0.3s ease;
  flex-grow: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.history-senha {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  width: 100%;
  text-align: center;
}
.history-local {
  font-size: clamp(1.2rem, 4.5vw, 2.2rem);
  opacity: 0.8;
}

#password-list li.latest {
  background-color: var(--highlight-color);
  color: var(--white-color);
  flex-grow: 1.5;
  box-shadow: 0 8px 20px rgba(37, 179, 75, 0.3);
  gap: 10px;
}

.latest .latest-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.latest .latest-label {
  font-size: clamp(0.8rem, 2vw, 1.2rem);
  font-weight: 700;
  opacity: 0.9;
}
.latest .latest-value {
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}
.latest .latest-value.password {
  font-size: clamp(3rem, 9vw, 5rem);
}
.latest .latest-value.patient {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
}
.latest .latest-value.location {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
}


.footer {
  grid-area: footer;
  background-color: var(--primary-color);
  padding: 10px 20px; /* Aumentando um pouco o padding para a quebra de linha */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px 30px;
  flex-wrap: wrap; /* Permite que os itens quebrem para a próxima linha */
}

.footer-label {
  color: var(--white-color);
  font-size: 1.6em;
  font-weight: 700;
  white-space: nowrap;
}
.footer-boxes-container {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-box {
  background-color: var(--white-color);
  color: var(--primary-color);
  border-radius: 8px;
  padding: 8px 35px;
  font-weight: 800;
  text-align: center;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.footer-box .senha {
  font-size: 2.2em;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.footer-box .guiche {
  font-size: 1.8em; /* Aumentado */
  opacity: 0.8;
}

body.panel-lowhd .header {
  padding: 5px 12px;
}

body.panel-lowhd .logo {
  height: 30px;
}

body.panel-lowhd .tv-area {
  padding: 10px;
}

body.panel-lowhd .sidebar {
  padding: 7px 10px 10px;
}

body.panel-lowhd #password-list {
  gap: 10px;
}

body.panel-lowhd #password-list li {
  padding: 0.7rem;
}

body.panel-lowhd .history-senha {
  font-size: clamp(1.2rem, 3.3vmin, 1.9rem);
}

body.panel-lowhd .history-local {
  font-size: clamp(1.05rem, 2.8vmin, 1.55rem);
}

body.panel-lowhd .latest .latest-label {
  font-size: clamp(0.95rem, 2.2vmin, 1.25rem);
}

body.panel-lowhd .latest .latest-value.password {
  font-size: clamp(2.15rem, 5.3vmin, 3.15rem);
}

body.panel-lowhd .latest .latest-value.patient,
body.panel-lowhd .latest .latest-value.location {
  font-size: clamp(1.65rem, 4.3vmin, 2.65rem);
}

body.panel-lowhd .footer {
  padding: 10px 12px;
  gap: 10px 12px;
}

body.panel-lowhd .footer-label {
  font-size: 1.2em;
}

body.panel-lowhd .footer-boxes-container {
  width: 100%;
  gap: 10px;
}

body.panel-lowhd .footer-box {
  flex: 1 1 calc((100% - 20px) / 3);
  min-width: 0;
  padding: 8px 10px;
}

body.panel-lowhd .footer-box .senha {
  font-size: 1.3em;
  line-height: 1.2;
}

body.panel-lowhd .footer-box .guiche {
  font-size: 1.1em;
  line-height: 1.15;
}

/* HD-768 com viewport apertado (ex.: notebook com barras/UI do navegador) */
body.panel-hd768-tight .header {
  padding: 6px 14px;
}

body.panel-hd768-tight .tv-area {
  padding: 14px;
}

body.panel-hd768-tight .sidebar {
  padding: 8px 12px 12px;
}

body.panel-hd768-tight #password-list {
  gap: 10px;
}

body.panel-hd768-tight #password-list li {
  padding: 0.7rem;
}

body.panel-hd768-tight .history-senha {
  font-size: clamp(1.2rem, 3.1vmin, 2rem);
}

body.panel-hd768-tight .history-local {
  font-size: clamp(1rem, 2.6vmin, 1.6rem);
}

body.panel-hd768-tight .latest .latest-value.password {
  font-size: clamp(2.45rem, 6.6vmin, 3.7rem);
}

body.panel-hd768-tight .latest .latest-value.patient,
body.panel-hd768-tight .latest .latest-value.location {
  font-size: clamp(1.95rem, 5.2vmin, 3.1rem);
}

body.panel-hd768-tight .footer {
  padding: 8px 12px;
  gap: 8px 12px;
}

body.panel-hd768-tight .footer-label {
  font-size: 1.2em;
}

body.panel-hd768-tight .footer-box {
  padding: 6px 20px;
}

body.panel-hd768-tight .footer-box .senha {
  font-size: 1.5em;
}

body.panel-hd768-tight .footer-box .guiche {
  font-size: 1.25em;
}

/* Perfil XGA (1024x768): prioriza equilíbrio e legibilidade */
body.panel-xga .grid-container {
  grid-template-columns: 3fr 2fr;
}

body.panel-xga .header {
  padding: 6px 10px;
}

body.panel-xga .logo {
  height: 30px;
}

body.panel-xga .tv-area {
  padding: 10px 8px;
  align-items: flex-start;
}

body.panel-xga .video-placeholder {
  justify-content: flex-start;
  align-items: flex-start;
}

body.panel-xga .sidebar {
  padding: 8px 10px 10px;
}

body.panel-xga #password-list {
  gap: 8px;
  justify-content: space-between;
}

body.panel-xga #password-list li {
  padding: 0.65rem;
  flex-grow: 1;
  min-height: 0;
}

body.panel-xga #password-list li.latest {
  flex-grow: 1.3;
}

body.panel-xga .latest .latest-label {
  font-size: clamp(0.9rem, 1.8vmin, 1.1rem);
}

body.panel-xga .latest .latest-value.password {
  font-size: clamp(2rem, 4.6vmin, 2.8rem);
}

body.panel-xga .latest .latest-value.patient,
body.panel-xga .latest .latest-value.location {
  font-size: 2.4em;
}

body.panel-xga .history-senha {
  font-size: 1.45em;
}

body.panel-xga .history-local {
  font-size: clamp(1rem, 2.3vmin, 1.3rem);
}

body.panel-xga .footer {
  padding: 12px 8px;
  gap: 8px 10px;
}

body.panel-xga .footer-label {
  font-size: 1.18em;
}

body.panel-xga .footer-boxes-container {
  width: 100%;
  gap: 8px;
}

body.panel-xga .footer-box {
  flex: 1 1 calc((100% - 8px) / 2);
  min-width: 0;
  padding: 9px 10px;
  min-height: 98px;
}

body.panel-xga .footer-box .senha {
  font-size: 1.45em;
  line-height: 1.15;
  word-break: break-word;
}

body.panel-xga .footer-box .guiche {
  font-size: 1.18em;
  line-height: 1.12;
}

/* Full-HD com escala 125% (1536x864 em CSS px) */
body.panel-fhd-125 .sidebar {
  padding: 9px 14px 14px;
}

body.panel-fhd-125 #password-list {
  gap: 10px;
}

body.panel-fhd-125 #password-list li {
  padding: 0.75rem;
}

body.panel-fhd-125 .latest .latest-label {
  font-size: clamp(0.95rem, 1.6vmin, 1.15rem);
}

body.panel-fhd-125 .latest .latest-value.password {
  font-size: clamp(2.6rem, 5.8vmin, 4rem);
}

body.panel-fhd-125 .latest .latest-value.patient,
body.panel-fhd-125 .latest .latest-value.location {
  font-size: 2.8em;
  line-height: 1.12;
}

body.panel-fhd-125 .history-senha {
  font-size: 1.85em;
}

body.panel-fhd-125 .history-local {
  font-size: 1.65em;
}

body.panel-fhd-125 .footer {
  padding: 14px 14px;
  gap: 10px 12px;
}

body.panel-fhd-125 .footer-label {
  font-size: 1.22em;
}

body.panel-fhd-125 .footer-boxes-container {
  width: 100%;
  gap: 10px;
  flex-wrap: nowrap;
}

body.panel-fhd-125 .footer-box {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 12px;
  min-height: 104px;
}

body.panel-fhd-125 .footer-box .senha {
  font-size: 1.85em;
  line-height: 1.15;
}

body.panel-fhd-125 .footer-box .guiche {
  font-size: 1.6em;
  line-height: 1.1;
}

.flash-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(77, 45, 123, 0.95);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: var(--white-color);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  padding: 1rem;
}
.flash-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.flash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1vh;
}
.flash-content .flash-label {
  font-size: clamp(1.5rem, 4vh, 3rem);
  opacity: 0.8;
}
.flash-content .flash-value {
  font-weight: 800;
  line-height: 1.1;
}
.flash-content .flash-value.password {
  font-size: clamp(5rem, 22vh, 18rem);
  color: var(--highlight-color);
}
.flash-content .flash-value.patient {
  font-size: clamp(5rem, 15vh, 12rem);
  color: var(--highlight-color);
}
.flash-content .flash-value.location {
  font-size: clamp(4rem, 10vh, 9rem);
}

/* Estilos da Tela de Login */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: var(--light-color);
  padding: 20px;
  overflow: auto; /* Garante que o conteúdo seja rolável se a tela for pequena */
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header .logo-image {
  max-width: 150px;
  margin-bottom: 1rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.login-header h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.login-header p {
  font-size: 1.1rem;
  color: var(--text-color);
}

#loginForm {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  background-color: var(--white-color);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: var(--text-color);
}

.form-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  font-family: "Nunito", sans-serif;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(77, 45, 123, 0.2);
}

.btn-login {
  width: 100%;
  padding: 1rem;
  background-color: var(--secondary-color);
  color: var(--white-color);
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px; /* Altura mínima para o botão */
}

.btn-login:hover {
  background-color: #1e8e3a; /* Tom de verde mais escuro para o hover */
}

.btn-login:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.error-message {
  background-color: #ffdddd;
  color: #d8000c;
  padding: 0.8rem;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 1rem;
  display: none; /* Oculto por padrão */
}

/* Estilo do Loader */
.loader {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--white-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Estilos da Página de Admin --- */

body.admin-body {
  overflow-y: auto; /* Permite rolagem vertical na página de admin */
  background:
    radial-gradient(1200px 500px at 50% -120px, rgba(77, 45, 123, 0.12), transparent 60%),
    var(--light-color);
}

.admin-container {
  width: 95%;
  max-width: 1400px;
  padding: 1.25rem 0;
  margin: 1.25rem auto;
  display: flex;
  gap: 1.25rem;
  align-items: stretch;
  min-height: calc(100vh - 110px);
}

.upload-card {
  flex: 1;
  min-width: 320px;
}

.manage-card {
  flex: 2.3;
}

.admin-card {
  background: linear-gradient(180deg, #ffffff 0%, #faf9fc 100%);
  border: 1px solid rgba(77, 45, 123, 0.14);
  border-radius: 14px;
  padding: 1.35rem;
  box-shadow: 0 10px 30px rgba(28, 21, 45, 0.08);
  height: 100%;
}

.admin-card h2 {
  font-size: 1.65rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--light-color);
  padding-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.header-title {
  flex-grow: 1;
  text-align: center;
  color: var(--primary-color);
}

.btn-nav {
  background-color: #f8f4fd;
  color: var(--primary-color);
  border: 2px solid rgba(77, 45, 123, 0.5);
  padding: 8px 15px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  text-decoration: none;
  transition: all 0.25s ease;
  display: block; /* Para fazer o width: 100% funcionar */
  width: 100%;
  text-align: center;
}

.btn-nav:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white-color);
}

.admin-body .btn-login,
.admin-body .btn-logout,
.admin-body .btn-preview,
.admin-body .btn-delete {
  border-radius: 10px;
}

.admin-body .btn-login {
  min-height: 44px;
  font-size: 0.98rem;
  box-shadow: 0 6px 16px rgba(37, 179, 75, 0.24);
}

.admin-body .btn-login:hover {
  transform: translateY(-1px);
}

.admin-body .form-group label {
  font-size: 1rem;
}

.logo-selector,
.form-control-file,
.form-control,
.expires-at-input {
  border: 1px solid #d7d1e3;
  border-radius: 10px;
  background-color: #fff;
}

.form-control {
  width: 100%;
  padding: 0.68rem 0.85rem;
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(77, 45, 123, 0.12);
}

.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--light-color);
  padding-bottom: 0.55rem;
  margin-bottom: 0.95rem;
  gap: 1rem;
}

.admin-section-title {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 1.6rem;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: #f7f4fb;
  border: 1px solid #e0d8ee;
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
}

.filter-label {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: #4c4660;
  white-space: nowrap;
}

.filter-selector {
  width: auto;
  min-width: 160px;
  padding: 0.55rem 1.8rem 0.55rem 0.65rem;
  font-size: 0.94rem;
}

.video-list-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  min-height: 150px;
}

.video-grid-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid #d6d0e2;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(36, 27, 55, 0.06);
}

.video-grid-info {
  flex: 1;
  min-width: 220px;
  color: #2f2a3f;
}

.video-grid-info span {
  display: block;
}

.video-grid-info > span:first-child {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.video-grid-info .region {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #7f7595;
  font-weight: 700;
}

.video-grid-date {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 155px;
}

.video-grid-date label {
  font-weight: 700;
  color: #595170;
  font-size: 0.92rem;
}

.video-grid-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.admin-actions-bar {
  text-align: right;
  padding-top: 0.75rem;
}
.form-control-file {
  width: 100%;
  padding: 0.68rem 0.85rem;
  border: 1px solid #d7d1e3;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  transition: border-color 0.3s ease;
}

.form-control-file:focus {
  outline: none;
  border-color: var(--primary-color);
}

#video-list-container {
  max-height: 390px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative; /* Adicionado para posicionamento correto do overlay */
  padding-right: 0.4rem;
}

.btn-delete {
  background-color: #d8000c;
  color: var(--white-color);
  border: none;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  font-family: 'Nunito', sans-serif;
  transition: background-color 0.3s ease;
}

.btn-delete:hover {
  background-color: #a00009;
}

@media (max-width: 900px) {
  .admin-container {
    width: 94%;
    flex-direction: column;
    padding-top: 1rem;
    min-height: auto;
  }

  .upload-card,
  .manage-card {
    width: 100%;
    min-width: 0;
  }

  .admin-section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .filter-selector {
    width: 100%;
  }

  .video-grid-item {
    flex-direction: column;
    align-items: stretch;
  }

  .video-grid-actions {
    justify-content: flex-end;
  }

  .header-title h1 {
    font-size: 1.5rem;
  }
}

/* --- Estilos do Rodapé do Menu Lateral --- */

.menu-footer {
  margin-top: auto; /* Empurra o rodapé para o final do menu */
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
  text-align: center;
}

#version-display {
  font-size: 0.8rem;
  color: #888;
  font-weight: 600;
}

/* --- Estilos do Modal de Pré-visualização e Notificação/Confirmação --- */
.modal {
    display: flex; /* Usa flex para centralização por padrão */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7); /* Fundo um pouco menos escuro */
    align-items: center;
    justify-content: center;
    
    /* Animação */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.modal.modal-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: var(--white-color);
    margin: auto;
    padding: 2rem;
    border-radius: 12px;
    position: relative;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    
    /* Animação */
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.modal-visible .modal-content {
    transform: scale(1);
}

/* Conteúdo específico para o modal de vídeo */
.modal-content video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    display: block;
    border-radius: 8px;
}

/* Estilos para os novos modais de notificação e confirmação */
#notification-modal-title, #confirmation-modal-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

#notification-modal-message, #confirmation-modal-message {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Reutilizando classes de botões existentes para consistência */
#notification-modal-close-btn {
    min-width: 80px;
}

#confirmation-modal-confirm-btn {
    background-color: #d8000c; /* Vermelho para ações destrutivas */
}
#confirmation-modal-confirm-btn:hover {
    background-color: #a00009;
}


.close-button {
    color: var(--white-color); /* Change color for better visibility against dark overlay */
    position: absolute;
    top: 15px; 
    right: 25px; 
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1002;
    text-shadow: 0 0 5px rgba(0,0,0,0.7);
}

.close-button:hover,
.close-button:focus {
    color: #eee; /* Lighter on hover */
    text-decoration: none;
    cursor: pointer;
}

.btn-preview {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    transition: background-color 0.3s ease;
    white-space: nowrap; /* Evita que o texto do botão quebre */
    font-size: 0.88rem;
}

.btn-preview:hover {
    background-color: #3b225e; /* Um tom mais escuro */
}

.spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(236, 232, 244, 0.86);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    z-index: 10;
}

.spinner {
    border: 4px solid rgba(77, 45, 123, 0.2);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.admin-modal-card {
  max-width: 450px;
}

.admin-modal-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* --- Estilos para Toast Notifications --- */
#top-toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000; /* Acima de tudo */
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.toast {
    background-color: #333;
    color: var(--white-color);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    min-width: 280px;
    max-width: 400px;
    font-size: 1rem;
    text-align: center;
}

.toast.from-top {
    transform: translateY(-150%);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background-color: var(--secondary-color);
}

.toast-error {
    background-color: #d8000c;
}

.toast-info {
    background-color: var(--primary-color);
}
