/* main.css - Estilos base da aplicação */

:root {
  /* =========================================
     Color Palette (Base Definitions)
     ========================================= */
  /* Brand Colors */
  --primary-color: #47ADB2;
  --primary-dark: rgb(54, 143, 148);
  --primary-color-transparent: rgba(71, 173, 178, 0.5);

  /* Status Colors */
  --secondary-color: #2ecc71;
  --secondary-dark: #27ae60;
  --error-color: #e74c3c;
  --warning-color: #f39c12;
  --success-color: #2ecc71;
  --info-color: #23AECD;

  /* =========================================
     Semantic Theme Variables (Light Mode Default)
     ========================================= */
  /* Surfaces */
  --background-color: #47adb273;
  /* Manter compatibilidade com background translúcido atual */
  --surface-base: #f8f9fa;
  --card-background: #ffffff;
  --header-background: #ffffff;

  /* Typography */
  --text-color: #333333;
  --text-color-dark: #333333;
  /* Alias legacy */
  --text-light: #666666;
  --text-muted: #888888;

  /* Borders & Shadows */
  --border-color: #dddddd;
  --border-radius: 4px;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 2px 4px rgba(0, 0, 0, 0.1);
  /* No light mode, é uma sombra normal */

  /* Effects */
  --transition: all 0.3s ease;
}

/* =========================================
   Dark Mode Override (Futuristic/Neon)
   ========================================= */
[data-theme="dark"] {
  /* Surfaces - Tons de Navy/Slate */
  --background-color: #0f172a;
  /* Slate 900 - Fundo sólido e escuro */
  --surface-base: #1e293b;
  /* Slate 800 */
  --card-background: #1e293b;
  /* Slate 800 */
  --header-background: #1e293b;

  /* Typography - Invertido para legibilidade */
  --text-color: #f1f5f9;
  /* Slate 100 */
  --text-color-dark: #f1f5f9;
  --text-light: #cbd5e1;
  /* Slate 300 */
  --text-muted: #94a3b8;
  /* Slate 400 */

  /* Borders & Glows */
  --border-color: #334155;
  /* Slate 700 */

  /* Estratégia de Glow: 
     Transforma sombras em brilhos sutis da cor primária 
  */
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 10px rgba(71, 173, 178, 0.4);
  /* Glow Neon */

  /* Ajustes finos em cores de status para dark background se necessário */
  /* --primary-color-transparent: rgba(71, 173, 178, 0.2); */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  /* Tente adicionar isso para o html também */
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.6;
}

/* Header e navegação */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 2rem;
  background-color: var(--card-background);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

.app-header.hidden {
  transform: translateY(-100%);
}

.logo h1 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin: 0;
}

.main-nav ul {
  display: flex;
  list-style: none;
}

.main-nav li {
  margin: 0 1rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: var(--transition);
}

.main-nav a:hover {
  color: var(--primary-color);
}

.main-nav a.active {
  color: var(--primary-color);
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 0.9rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: var(--secondary-dark);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.btn-outline:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.btn-icon {
  padding: 0.5rem;
  border-radius: 50%;
}

.btn-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.btn.hidden {
  display: none;
}

/* Formulários */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-color, #333);
  /* Ensure text inside form elements is visible */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Ensure text in select options is visible */
select option {
  color: #000000;
  /* Black text for options, should contrast with typical light dropdown background */
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

.form-group.full-width {
  width: 100%;
}

/* Autocomplete */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  background-color: white;
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  z-index: 10;
  display: none;
}

.autocomplete-item {
  padding: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.autocomplete-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Modais */
.modal {
  /* display: none;  REMOVIDO para permitir transição */
  display: flex;
  /* Flex para centralizar, mas escondido visualmente */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  /* Não bloquear cliques quando invisível */

  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 3000;
  justify-content: center;
  align-items: center;

  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.modal-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  /* display: flex !important; REMOVIDO pois já é flex */
}

.modal-content {
  background-color: white;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);

  /* ... (existing modal styles) ... */
  opacity: 1;
}

/* Animations for <dialog> elements */
dialog {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  padding: 0;
  max-width: 600px;
  width: 90%;
}

dialog[open] {
  animation: dialog-fade-in 0.3s ease forwards;
}

dialog.dialog-closing {
  animation: dialog-fade-out 0.3s ease forwards;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
}

dialog[open]::backdrop {
  animation: backdrop-fade-in 0.3s ease forwards;
}

dialog.dialog-closing::backdrop {
  animation: backdrop-fade-out 0.3s ease forwards;
}

@keyframes dialog-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes dialog-fade-out {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  to {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
}

@keyframes backdrop-fade-in {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }

  to {
    opacity: 1;
    backdrop-filter: blur(5px);
  }
}

@keyframes backdrop-fade-out {
  from {
    opacity: 1;
    backdrop-filter: blur(5px);
  }

  to {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
}


.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--primary-color);
  color: #ffffff;
}

.modal-header h3 {
  margin: 0;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

/* Continuação do main.css */

.modal-body {
  padding: 1rem;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 3500;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-message {
  font-size: 1rem;
  color: var(--text-color);
}

/* Notificações */
.notification-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notification {
  padding: 1rem;
  border-radius: var(--border-radius);
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  max-width: 300px;
  transform: translateX(120%);
  transition: transform 0.3s ease;
}

.notification.show {
  transform: translateX(0);
}

.notification-success {
  border-left: 4px solid var(--success-color);
}

.notification-error {
  border-left: 4px solid var(--error-color);
}

.notification-warning {
  border-left: 4px solid var(--warning-color);
}

.notification-info {
  border-left: 4px solid var(--info-color);
}

/* Mensagens vazias */
.empty-message {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
  font-style: italic;
}

/* Mensagem de autenticação */
.auth-message {
  text-align: center;
  padding: 3rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin: 2rem auto;
  max-width: 600px;
}

/* Checkbox e Radio */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
  width: auto;
}

.rating-group {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.rating-item {
  text-align: center;
}

.star-rating {
  display: flex;
  gap: 0.25rem;
}

.star-rating input[type="radio"] {
  display: none;
}

.star-rating label {
  cursor: pointer;
  font-size: 1.5rem;
  color: #ccc;
  transition: var(--transition);
}

.star-rating input[type="radio"]:checked~label {
  color: #ffc107;
}

.star-rating label:hover,
.star-rating label:hover~label {
  color: #ffc107;
}

/* Responsividade */
@media (max-width: 768px) {
  .app-header {
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
  }

  .main-nav {
    /* order: 0; */
    width: 100%;
    margin-top: 0.5rem;
    margin-right: 0;
  }

  .main-nav ul {
    justify-content: space-around;
  }

  .main-nav li {
    margin: 0;
  }

  .form-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .checkbox-group {
    grid-template-columns: 1fr;
  }

  .rating-group {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Adicionar ao main.css ou dashboard.css */

/* Ajustar o layout do modal de adicionar aluno */
#modal-add-aluno .modal-content {
  max-width: 600px;
}

#modal-add-aluno .form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

#modal-add-aluno .form-row .form-group {
  flex: 1;
}

#modal-add-aluno .form-group {
  margin-bottom: 1rem;
}

/* Estilo para campos de contato */
#whatsapp,
#instagram {
  padding-left: 30px;
  background-repeat: no-repeat;
  background-position: 8px center;
  background-size: 16px;
}

#whatsapp {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="%2325D366" d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"/></svg>');
}

#instagram {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="%23E4405F" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"/></svg>');
}

/* Estilos para o logotipo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-image {
  height: 64px;
  /* Ajuste conforme necessário */
  width: auto;
}

/* Responsividade para o logotipo */
@media (max-width: 768px) {
  .logo-image {
    height: 50px;
    /* Tamanho menor em dispositivos móveis */
  }

  .logo h1 {
    font-size: 1.2rem;
    /* Texto menor em dispositivos móveis */
  }
}

/* Estilos para cabeçalhos fixos em todos os modais */
.modal-header {
  position: sticky;
  top: 0;
  /* background-color: var(--primary-color);  Corrigido para usar a variável corretamente */
  background-color: var(--primary-color);
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* Modal de Relogin - Z-Index Máximo para garantir que apareça sobre o overlay de loading */
#modal-relogin {
  z-index: 9999 !important;
}

/* Estilo para o botão de tela cheia global */
.btn-fullscreen {
  position: fixed;
  bottom: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color, #2196F3);
  color: white;
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  opacity: 0.7;
  transition: opacity 0.3s, transform 0.2s;
}

.btn-fullscreen:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Estilo para o botão de logout discreto */
.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background-color: transparent;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}

.btn-logout:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.logout-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 16px;
}

.btn-logout:hover .logout-icon {
  color: var(--primary-color);
}

/* Estilo padrão - mostra texto e ícones */
.main-nav i {
  margin-right: 5px;
}

@media screen and (max-width: 767px) {
  .app-header {
    padding: 5px 0;
  }

  .app-header a {
    padding: 8px 12px;
  }

  /* Adicionar um pequeno efeito de hover/active para feedback tátil */
  .app-header a:hover,
  .app-header a:active,
  .app-header a.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
  }
}

.main-nav i {
  margin-right: 5px;
}

/* Estilos para dispositivos móveis (modo retrato) */
@media screen and (max-width: 767px) {

  /* Estrutura do cabeçalho */
  .app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    position: relative;
    /* Adicionado para o posicionamento absoluto do logo */
  }

  /* Logo centralizado - FLEXBOX FIX */
  .logo {
    /* REMOVED ABSOLUTE POSITIONING */
    position: relative;
    flex-shrink: 0;
    margin-right: 15px;
    z-index: 10;
  }

  /* Navegação principal */
  .main-nav {
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-left: 0;
    /* REMOVED FIXED MARGIN */
    margin-right: 0;
    min-width: 0;
    /* Crucial for flexbox scrolling */
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }



  .main-nav ul {
    display: flex;
    flex-wrap: nowrap;
    /* Impede quebra de linha */
    padding: 0;
    margin: 0;
    list-style: none;
    padding-right: 15px;
    /* Espaço no final da rolagem */
    width: max-content;
    /* Garante que a UL cresça o necessário */
  }

  .main-nav li {
    margin: 0 5px;
    /* Espaçamento reduzido entre os ícones */
    flex-shrink: 0;
    /* Impede que os itens encolham */
  }

  /* Ocultar texto dos links, mostrar apenas ícones */
  .main-nav .menu-text {
    display: none;
  }

  .main-nav i {
    margin-right: 0;
    font-size: 1.2rem;
  }

  .main-nav a {
    padding: 8px 12px;
    /* Aumentar área de toque */
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
  }


  /* Ações do usuário */
  .user-actions {
    display: flex;
    align-items: center;
  }

  .user-actions .btn {
    padding: 5px 8px;
    font-size: 0.8rem;
  }

}

/* Para telas muito pequenas, reduzir ainda mais o espaçamento */
@media screen and (max-width: 360px) {
  .main-nav li {
    margin: 0 5px;
  }

  .main-nav a {
    padding: 6px;
  }

  .main-nav i {
    font-size: 1rem;
  }
}

/* Ajuste para alinhamento dos botões na barra superior do monitor/aplicativo */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Espaçamento entre os botões */
}

/* Estilos melhorados para os botões de ação no header (se aplicável ao monitor.html) */
.btn-icon-header {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  /* Adicionado para centralizar o ícone */
  align-items: center;
  justify-content: center;
  /* margin-right: 0.75rem; Removido, usar gap no .header-actions */
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  background-color: transparent;
  /* Fundo transparente por padrão */
  color: var(--text-light);
  /* Cor do ícone */
}

.btn-icon-header:hover {
  background-color: rgba(0, 0, 0, 0.05);
  /* Leve destaque ao passar o mouse */
  /* transform: translateY(-2px); Opcional */
}

.btn-icon-header i {
  /* Se estiver usando Font Awesome ou similar */
  font-size: 18px;
}