/* ==============================================
   ESTILOS DA PÁGINA DE PERFIL DE CONTA
   ============================================== */

/* --- Cabeçalho da Conta --- */
.personalInfo-page {
  width: 100%;
}

.account-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background-color: #ffffff;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  margin-bottom: 25px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.03);
  flex-wrap: nowrap;
  min-height: 120px;
}

.profile-avatar {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid #e1e5e9;
  background-color: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease;
}

.profile-avatar:hover {
  border-color: #0d6efd;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 2rem;
}

.profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: #343a40;
  margin: 0;
  line-height: 1.4;
}

.profile-role {
  font-size: 1rem;
  color: #6c757d;
  margin: 0;
  line-height: 1.4;
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 4px;
}

.profile-meta > div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #495057;
}

.profile-meta i {
  color: #6c757d;
  font-size: 0.85rem;
}

/* Responsividade do cabeçalho */
@media (max-width: 768px) {
  .account-header {
    flex-wrap: wrap;
    padding: 20px;
  }

  .profile-avatar {
    width: 70px;
    height: 70px;
  }

  .profile-name {
    font-size: 1.3rem;
  }

  .profile-role {
    font-size: 0.95rem;
  }
}

/* --- Títulos de Seção --- */
.personalInfo-page .section-title {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.3rem;
  font-weight: 600;
  color: #343a40;
  padding-bottom: 15px;
  border-bottom: 1px solid #f1f3f5;
}

/* --- Botões de Ação do Formulário --- */
.personalInfo-page .form-actions,
.personalInfo-page .btn-container.form-actions {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #f1f3f5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* --- Histórico de Sessões --- */
.session-list-container {
  background-color: #ffffff;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  padding: 24px;
  margin-top: 40px;
  margin-bottom: 25px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.03);
}

#session-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background-color: #f8f9fa;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.session-item:hover {
  background-color: #ffffff;
  border-color: #ced4da;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.session-item.active {
  background-color: #e7f3ff;
  border-color: #0d6efd;
}

.session-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.session-device {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #343a40;
  font-size: 0.95rem;
}

.session-device i {
  color: #6c757d;
  font-size: 0.9rem;
  width: 18px;
  text-align: center;
}

.session-details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: #6c757d;
}

.session-detail-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-detail-item i {
  font-size: 0.8rem;
  color: #adb5bd;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.session-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.session-status.active {
  background-color: #d4edda;
  color: #155724;
}

.session-status.inactive {
  background-color: #f8d7da;
  color: #721c24;
}

.btn-session-action {
  padding: 6px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background-color: #ffffff;
  color: #495057;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-session-action:hover {
  background-color: #f8f9fa;
  border-color: #adb5bd;
}

.btn-session-action.danger {
  color: #dc3545;
  border-color: #dc3545;
}

.btn-session-action.danger:hover {
  background-color: #dc3545;
  color: #ffffff;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: #6c757d;
  font-size: 0.95rem;
}

.loading-state i {
  font-size: 1.2rem;
  color: #0d6efd;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.empty-state i {
  font-size: 2.5rem;
  color: #adb5bd;
  margin-bottom: 12px;
  display: block;
}

.empty-state p {
  margin: 0;
  font-size: 0.95rem;
}

/* Responsividade do histórico de sessões */
@media (max-width: 768px) {
  .session-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .session-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .session-details {
    flex-direction: column;
    gap: 8px;
  }
}

/* ==============================================
   ESTILOS DARK MODE
   ============================================== */

/* --- Cabeçalho da Conta (Dark Mode) --- */
html.dark-theme .account-header {
  background-color: #2c2c2c;
  border-color: #555555;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

html.dark-theme .profile-avatar {
  border-color: #555555;
  background-color: #3a3a3a;
}

html.dark-theme .profile-avatar:hover {
  border-color: #0d6efd;
}

html.dark-theme .avatar-placeholder {
  color: #b0b0b0;
}

html.dark-theme .profile-name {
  color: #f0f0f0;
}

html.dark-theme .profile-role {
  color: #b0b0b0;
}

html.dark-theme .profile-meta > div {
  color: #b0b0b0;
}

html.dark-theme .profile-meta i {
  color: #b0b0b0;
}

/* --- Títulos de Seção (Dark Mode) --- */
html.dark-theme .personalInfo-page .section-title {
  color: #f0f0f0;
  border-bottom-color: #555555;
}

/* --- Botões de Ação (Dark Mode) --- */
html.dark-theme .personalInfo-page .form-actions,
html.dark-theme .personalInfo-page .btn-container.form-actions {
  border-top-color: #555555;
}

/* --- Campos de Formulário (Dark Mode) --- */
html.dark-theme .personalInfo-page .form-input,
html.dark-theme .personalInfo-page .form-select,
html.dark-theme .personalInfo-page .form-textarea {
  background-color: #3a3a3a;
  border-color: #555555;
  color: #f0f0f0;
}

html.dark-theme .personalInfo-page .form-input:focus,
html.dark-theme .personalInfo-page .form-select:focus,
html.dark-theme .personalInfo-page .form-textarea:focus {
  border-color: #0d6efd;
  background-color: #3a3a3a;
}

html.dark-theme .personalInfo-page .form-input[readonly],
html.dark-theme .personalInfo-page .form-input[readonly]:focus {
  background-color: #3a3a3a !important;
  border-color: #555555;
  color: #b0b0b0;
}

html.dark-theme .personalInfo-page .form-label {
  color: #b0b0b0;
}

/* --- Histórico de Sessões (Dark Mode) --- */
html.dark-theme .session-list-container {
  background-color: #2c2c2c;
  border-color: #555555;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

html.dark-theme .session-item {
  background-color: #3a3a3a;
  border-color: #555555;
}

html.dark-theme .session-item:hover {
  background-color: #444444;
  border-color: #666666;
}

html.dark-theme .session-item.active {
  background-color: #1a3a5a;
  border-color: #0d6efd;
}

html.dark-theme .session-device {
  color: #f0f0f0;
}

html.dark-theme .session-device i {
  color: #b0b0b0;
}

html.dark-theme .session-details {
  color: #b0b0b0;
}

html.dark-theme .session-detail-item i {
  color: #888888;
}

html.dark-theme .btn-session-action {
  background-color: #3a3a3a;
  border-color: #555555;
  color: #f0f0f0;
}

html.dark-theme .btn-session-action:hover {
  background-color: #444444;
  border-color: #666666;
}

html.dark-theme .btn-session-action.danger {
  color: #ff6b6b;
  border-color: #ff6b6b;
}

html.dark-theme .btn-session-action.danger:hover {
  background-color: #ff6b6b;
  color: #ffffff;
}

html.dark-theme .loading-state {
  color: #b0b0b0;
}

html.dark-theme .loading-state i {
  color: #0d6efd;
}

html.dark-theme .empty-state {
  color: #b0b0b0;
}

html.dark-theme .empty-state i {
  color: #666666;
}

html.dark-theme .empty-state p {
  color: #b0b0b0;
}

/* ==============================================
   ESTILOS DA PÁGINA DE NOTIFICAÇÕES
   ============================================== */

/* --- Layout dos Cards de Seção --- */
.notificationSettings-page .form-section {
  background-color: #ffffff;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 25px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.03);
}

.notificationSettings-page .form-section h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #343a40;
  padding-bottom: 15px;
  border-bottom: 1px solid #f1f3f5;
}

/* --- ESTILO DO TOGGLE (BOTÃO LIGA/DESLIGA) --- */

.notificationSettings-page .form-group-toggle {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 15px;
}

.notificationSettings-page .form-group-toggle:last-child {
  margin-bottom: 0;
}

/* O container do 'botão' */
.notificationSettings-page .toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

/* Esconde o checkbox real */
.notificationSettings-page .toggle-switch input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
}

/* O 'trilho' cinza do switch */
.notificationSettings-page .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 34px;
  transition: 0.4s;
}

/* O 'círculo' branco do switch */
.notificationSettings-page .slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

/* O estado 'LIGADO' (checked) */
.notificationSettings-page .toggle-switch input:checked + .slider {
  background-color: #0d6efd;
}

/* Animação do círculo para 'LIGADO' */
.notificationSettings-page .toggle-switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* --- Texto ao lado do Toggle --- */
.notificationSettings-page .toggle-label {
  flex-grow: 1;
}

.notificationSettings-page .toggle-label strong {
  display: block;
  font-weight: 600;
  color: #343a40;
  font-size: 0.95rem;
  line-height: 24px;
}

.notificationSettings-page .toggle-label p {
  font-size: 0.85rem;
  color: #6c757d;
  margin: 2px 0 0 0;
}

/* --- Seção de Configurações de E-mail (Selects) --- */
.notificationSettings-page .form-section .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.notificationSettings-page .form-group .form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.notificationSettings-page .form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background-color: #ffffff;
  font-size: 0.9rem;
}

/* --- Botão de Salvar --- */
.notificationSettings-page .form-actions {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #f1f3f5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* =======================================================
   CSS DO MODAL GLOBAL DE AVATAR
   (Adicione isso ao final do seu CSS)
   ======================================================= */

/* O Fundo escuro (Overlay) - Começa invisível */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* Fundo preto transparente */
  z-index: 9999; /* Fica acima de tudo */
  display: none; /* ESCONDIDO POR PADRÃO */
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Classe que torna o modal visível (adicionada pelo JS) */
.modal-overlay.show {
  display: flex;
  opacity: 1;
}

/* A caixa branca do modal */
.modal-container {
  background-color: #ffffff;
  width: 90%;
  max-width: 450px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.modal-overlay.show .modal-container {
  transform: translateY(0);
}

/* Cabeçalho do Modal */
.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid #e1e5e9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #343a40;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6c757d;
}

/* Corpo do Modal */
.modal-body {
  padding: 20px;
}

.avatar-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

/* Área de Preview Redonda */
.avatar-preview-container {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 4px solid #f8f9fa;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
  background-color: #f1f3f5;
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-placeholder {
  font-size: 4rem;
  color: #adb5bd;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Inputs e Botões Internos */
.file-input-wrapper label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: #e9ecef;
  color: #495057;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s;
}

.file-input-wrapper label:hover {
  background-color: #dee2e6;
}

.upload-hint {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 5px;
}

.file-size-info {
  font-size: 0.85rem;
  margin-top: 5px;
  text-align: center;
}

.file-size-info.error {
  color: #dc3545;
}
.file-size-info.success {
  color: #198754;
}

/* Rodapé do Modal */
.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #e1e5e9;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background-color: #f8f9fa;
}

/* --- Dark Mode para o Modal --- */
html.dark-theme .modal-container {
  background-color: #2c2c2c;
  color: #f0f0f0;
}

html.dark-theme .modal-header,
html.dark-theme .modal-footer {
  border-color: #444;
  background-color: #333;
}

html.dark-theme .modal-header h3 {
  color: #f0f0f0;
}

html.dark-theme .avatar-preview-container {
  border-color: #444;
  background-color: #3a3a3a;
}

html.dark-theme .file-input-wrapper label {
  background-color: #444;
  color: #f0f0f0;
}

html.dark-theme .file-input-wrapper label:hover {
  background-color: #555;
}
