/* Google Font Import - Poppins */
/* @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"); */
@import url("https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,400;0,700;1,400;1,700&amp;display=swap");
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* font-family: "Poppins", sans-serif; */
  font-family: "Fira Sans", sans-serif;
}

:root {
  /* ===== Colors ===== */
  --body-color: #e4e9f7;
  --sidebar-color: #fff;
  --primary-color: #695cfe;
  --primary-color-light: #f6f5ff;
  --toggle-color: #ddd;
  --text-color: #707070;
  --text-color-alert: #fb4804b0;

  /* ====== Transition ====== */
  --tran-03: all 0.2s ease;
  --tran-03: all 0.3s ease;
  --tran-04: all 0.3s ease;
  --tran-05: all 0.3s ease;
}

body {
  min-height: 100vh;
  background-color: var(--body-color);
  transition: var(--tran-05);
}

::selection {
  background-color: var(--primary-color);
  color: #fff;
}

body.dark {
  --body-color: #18191a;
  --sidebar-color: #242526;
  --primary-color: #3a3b3c;
  --primary-color-light: #3a3b3c;
  --toggle-color: #fff;
  --text-color: #ccc;
}

/* ===== Login ===== */
.login {
  top: 0;
  width: 100%;
  height: 100%;
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--body-color);
  transition: var(--tran-05);
  z-index: 100;
}

.login .container {
  background: var(--sidebar-color);
  max-width: 400px;
  width: 100%;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  text-align: center;
  overflow: auto;
}

.login .container h2 {
  color: var(--text-color);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 10px;
}

.login .form-group {
  margin-bottom: 20px;
  text-align: left;
}

.login .form-group label {
  display: block;
  color: var(--text-color);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 3px;
}

.login .form-group input {
  width: 100%;
  padding: 5px 10px;
  border: 2px solid var(--primary-color-light);
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-color);
  background: var(--sidebar-color);
  transition: var(--tran-03);
  box-sizing: border-box;
}

.login .form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(105, 92, 254, 0.1);
}

.login .form-group input::placeholder {
  color: var(--text-color);
  opacity: 0.6;
}

.login .btn {
  width: 100%;
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--tran-03);
  position: relative;
  margin-bottom: 20px;
}

.login .btn:hover {
  background: #5a4fd8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(105, 92, 254, 0.3);
}

.login .btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login .btn .loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.login .btn.loading .btn-text {
  visibility: hidden;
}

.login .btn.loading .loading {
  display: flex;
}

.login .divider {
  position: relative;
  text-align: center;
  margin: 24px 0;
  color: var(--text-color);
  font-size: 14px;
}

.login .divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--primary-color-light);
}

.login .divider span {
  background: var(--sidebar-color);
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

.login .google-login {
  margin-bottom: 20px;
}

.login .google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 20px;
  background: white;
  color: #333;
  border: 2px solid #ddd;
  border-radius: 8px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: var(--tran-03);
}

.login .google-btn:hover {
  background: #f8f9fa;
  border-color: #ccc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.login .register-link {
  margin-top: 20px;
  color: var(--text-color);
  font-size: 14px;
}

.login .register-link a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.login .register-link a:hover {
  text-decoration: underline;
}

.login .alert {
  display: none;
  padding: 5px 10px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

.login .alert-error {
  background: #fee;
  color: #c53030;
  border: 1px solid #fed7d7;
}

.login .alert-success {
  background: #f0fff4;
  color: #2f855a;
  border: 1px solid #c6f6d5;
}

.login .alert-info {
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #bee3f8;
}

/* ===== Register ===== */
.register {
  top: 0;
  width: 100%;
  height: 100%;
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--body-color);
  transition: var(--tran-05);
  z-index: 100;
}

.register .container {
  background: var(--sidebar-color);
  max-width: 450px;
  width: 100%;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  text-align: center;
  overflow: auto;
}

.register .container h2 {
  color: var(--text-color);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 10px;
}

.register .form-group {
  margin-bottom: 20px;
  text-align: left;
}

.register .form-group label {
  display: block;
  color: var(--text-color);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.register .form-group input {
  width: 100%;
  padding: 5px 10px;
  border: 2px solid var(--primary-color-light);
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-color);
  background: var(--sidebar-color);
  transition: var(--tran-03);
  box-sizing: border-box;
}

.register .form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(105, 92, 254, 0.1);
}

.register .form-group input::placeholder,
.register .form-group textarea::placeholder {
  color: var(--text-color);
  opacity: 0.6;
}

.register .form-group textarea {
  width: 100%;
  padding: 5px 10px;
  border: 2px solid var(--primary-color-light);
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-color);
  background: var(--sidebar-color);
  transition: var(--tran-03);
  box-sizing: border-box;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.register .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(105, 92, 254, 0.1);
}

.register .form-help {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-color);
  opacity: 0.7;
}

.register .btn {
  width: 100% !important;
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--tran-03);
  position: relative;
  margin-bottom: 20px;
}

.register .btn:hover {
  background: #5a4fd8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(105, 92, 254, 0.3);
}

.register .btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.register .btn .loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.register .btn.loading .btn-text {
  visibility: hidden;
}

.register .btn.loading .loading {
  display: flex;
}

.register .register-link {
  margin-top: 20px;
  color: var(--text-color);
  font-size: 14px;
}

.register .register-link a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.register .register-link a:hover {
  text-decoration: underline;
}

.register .alert {
  display: none;
  padding: 5px 10px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

.register .alert-error {
  background: #fee;
  color: #c53030;
  border: 1px solid #fed7d7;
}

.register .alert-success {
  background: #f0fff4;
  color: #2f855a;
  border: 1px solid #c6f6d5;
}

.register .alert-info {
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #bee3f8;
}
/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 250px;
  padding: 10px 14px;
  background: var(--sidebar-color);
  transition: var(--tran-05);
  z-index: 100;
}
.sidebar.close {
  width: 88px;
}

/* ===== Reusable code - Here ===== */
.sidebar li {
  height: 30px; /*50px;*/
  list-style: none;
  display: flex;
  align-items: center;
  margin-top: 5px; /*10px;*/
}

.sidebar header .image,
.sidebar .icon {
  min-width: 60px;
  border-radius: 6px;
}

.sidebar .icon {
  min-width: 60px;
  border-radius: 6px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sidebar .text,
.sidebar .icon {
  color: var(--text-color);
  transition: var(--tran-03);
}

.sidebar .text {
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 1;
}
.sidebar.close .text {
  opacity: 0;
}
/* =========================== */

.sidebar header {
  position: relative;
}

.sidebar header .image-text {
  display: flex;
  align-items: center;
}
.sidebar header .logo-text {
  display: flex;
  flex-direction: column;
}
header .image-text .name {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 600;
}

header .image-text .profession {
  font-size: 16px;
  margin-top: -2px;
  display: block;
  text-wrap: auto;
}

.sidebar header .image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar header .image img {
  width: 40px;
  border-radius: 6px;
}

.sidebar header .toggle {
  position: absolute;
  top: 50%;
  right: -25px;
  transform: translateY(-50%) rotate(180deg);
  height: 25px;
  width: 25px;
  background-color: var(--primary-color);
  color: var(--sidebar-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: var(--tran-05);
}

body.dark .sidebar header .toggle {
  color: var(--text-color);
}

.sidebar.close .toggle {
  transform: translateY(-50%) rotate(0deg);
}

.sidebar .menu {
  margin-top: 40px;
}

.sidebar li.search-box {
  border-radius: 6px;
  background-color: var(--primary-color-light);
  cursor: pointer;
  transition: var(--tran-05);
}

.sidebar li.search-box input {
  height: 100%;
  width: 100%;
  outline: none;
  border: none;
  background-color: var(--primary-color-light);
  color: var(--text-color);
  border-radius: 6px;
  font-size: 17px;
  font-weight: 500;
  transition: var(--tran-05);
}
.sidebar li a {
  list-style: none;
  height: 100%;
  background-color: transparent;
  display: flex;
  align-items: center;
  height: 100%;
  width: 100%;
  border-radius: 6px;
  text-decoration: none;
  transition: var(--tran-03);
}

.sidebar li a:hover {
  background-color: var(--primary-color);
}
.sidebar li a:hover .icon,
.sidebar li a:hover .text {
  color: var(--sidebar-color);
}
body.dark .sidebar li a:hover .icon,
body.dark .sidebar li a:hover .text {
  color: var(--text-color);
}

.sidebar .menu-bar {
  height: calc(100% - 55px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Não colocar scroll aqui: apenas na lista de pastas */
}

/* Container do menu (pesquisa + lista de pastas) em coluna e ocupando o espaço disponível */
.sidebar .menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0; /* permite que o filho com overflow funcione corretamente */
}

/* Lista de pastas com scroll próprio (apenas as pastas rolam) */
.sidebar .menu-links {
  margin-top: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden; /* evita scroll horizontal */
  padding-right: 2px; /* evita cortar scrollbar */
  background-color: var(--primary-color-light);
}

/* Garante que os itens ocupem a largura e não forcem scroll horizontal */
.sidebar .menu-links .nav-link a {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .menu-links::-webkit-scrollbar {
  width: 4px;
}
.sidebar .menu-links::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.sidebar .menu-bar .mode {
  border-radius: 6px;
  background-color: var(--primary-color-light);
  position: relative;
  transition: var(--tran-05);
}

.menu-bar .mode .sun-moon {
  height: 30px;
  width: 60px;
}

.mode .sun-moon i {
  position: absolute;
}
.mode .sun-moon i.sun {
  opacity: 0;
}
body.dark .mode .sun-moon i.sun {
  opacity: 1;
}
body.dark .mode .sun-moon i.moon {
  opacity: 0;
}

.menu-bar .bottom-content .toggle-switch {
  position: absolute;
  right: 0;
  height: 100%;
  min-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
}
.toggle-switch .switch {
  position: relative;
  height: 22px;
  width: 40px;
  border-radius: 25px;
  background-color: var(--toggle-color);
  transition: var(--tran-05);
}

.switch::before {
  content: "";
  position: absolute;
  height: 15px;
  width: 15px;
  border-radius: 50%;
  top: 50%;
  left: 5px;
  transform: translateY(-50%);
  background-color: var(--sidebar-color);
  transition: var(--tran-04);
}

body.dark .switch::before {
  left: 20px;
}

.home {
  position: absolute;
  top: 0;
  top: 0;
  left: 250px;
  height: 100vh;
  width: calc(100% - 250px);
  background-color: var(--body-color);
  transition: var(--tran-05);
}
.home .text {
  font-size: 30px;
  font-weight: 500;
  color: var(--text-color);
  padding: 12px 60px;
}

.sidebar.close ~ .home {
  left: 78px;
  height: 100vh;
  width: calc(100% - 78px);
}
body.dark .home .text {
  color: var(--text-color);
}

.tabela {
  color: var(--text-color);
  border-collapse: collapse;
  border: 1px solid silver;
  margin: 1px;
  width: 100%;
}

.linha {
  border: 1px solid silver;
}
.linha:nth-child(even) {
  background-color: var(--sidebar-color);
}
.coluna {
  padding: 1px;
  border-left: 1px solid silver;
}
.coluna .data {
  width: 140px;
}
.cabecalho {
  background-color: var(--sidebar-color);
  cursor: pointer;
}
.acao {
  width: 62px;
  text-align: center;
}
.btn {
  cursor: pointer;
}
.btn-acao {
  cursor: pointer;
  width: 25px;
  height: 25px;
}
.centro {
  text-align: center;
}
.direita {
  text-align: right;
}
.esquerda {
  text-align: left;
}
.oculto {
  display: none;
}
.loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-color);
}

.loading.show {
  display: flex;
}

.spinner {
  border: 2px solid rgba(0, 123, 255, 0.2);
  border-top: 2px solid #007bff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

.spinner.large {
  width: 24px;
  height: 24px;
  border-width: 3px;
}

.spinner.small {
  width: 12px;
  height: 12px;
  border-width: 1px;
}

/* Overlay de loading para toda a página */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.show {
  display: flex;
}

.loading-overlay .spinner {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

.loading-overlay .loading-text {
  color: white;
  margin-top: 16px;
  font-size: 16px;
  font-weight: 500;
}

/* Loading para botões */
.btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn.loading .btn-text {
  visibility: hidden;
}

.btn.loading .loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
}

/* Loading para tabelas */
.table-loading {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-color);
}

.table-loading.show {
  display: flex;
}

.table-loading .spinner {
  margin-right: 12px;
}

/* Animação de spin */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Loading com pulso */
.loading-pulse {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #007bff;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
}

/* Loading com pontos */
.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #007bff;
  animation: dots 1.4s ease-in-out infinite both;
}

.loading-dots .dot:nth-child(1) {
  animation-delay: -0.32s;
}
.loading-dots .dot:nth-child(2) {
  animation-delay: -0.16s;
}
.loading-dots .dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes dots {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/*
=== COMO USAR AS CLASSES DE LOADING ===

1. Loading básico:
   <div class="loading">
     <div class="spinner"></div>
     <span>Carregando...</span>
   </div>

2. Loading com overlay (tela inteira):
   <div class="loading-overlay">
     <div class="spinner large"></div>
     <div class="loading-text">Carregando...</div>
   </div>

3. Loading para botões:
   <button class="btn loading">
     <span class="btn-text">Salvar</span>
     <div class="loading">
       <div class="spinner small"></div>
       <span>Salvando...</span>
     </div>
   </button>

4. Loading para tabelas:
   <div class="table-loading">
     <div class="spinner"></div>
     <span>Carregando dados...</span>
   </div>

5. Loading com pulso:
   <div class="loading-pulse"></div>

6. Loading com pontos:
   <div class="loading-dots">
     <div class="dot"></div>
     <div class="dot"></div>
     <div class="dot"></div>
   </div>

Para mostrar/esconder:
- Adicionar classe 'show': element.classList.add('show')
- Remover classe 'show': element.classList.remove('show')
*/

/* ===== Admin ===== */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: var(--body-color);
  min-height: 100vh;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--primary-color-light);
}

.admin-header h1 {
  color: var(--text-color);
  font-size: 28px;
  font-weight: 600;
  margin: 0;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: var(--tran-03);
}

.btn-back:hover {
  background: #5a4fd8;
  transform: translateY(-1px);
}

.admin-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.users-section,
.folders-section {
  background: var(--sidebar-color);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.users-section h2,
.folders-section h2 {
  color: var(--text-color);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.users-list,
.folders-list {
  max-height: 500px;
  overflow-y: auto;
}

.user-card {
  background: var(--body-color);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--primary-color-light);
}

.user-info h3 {
  color: var(--text-color);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.user-is-admin {
  color: var(--text-color-alert) !important;
}
.user-email {
  color: var(--text-color);
  font-size: 14px;
  margin: 0 0 4px 0;
  opacity: 0.8;
}

.user-date {
  color: var(--text-color);
  font-size: 12px;
  margin: 0 0 12px 0;
  opacity: 0.6;
}

.user-folders {
  color: var(--text-color);
  font-size: 14px;
  font-weight: 600;
  /* margin: 0 0 8px 0; */
}

.user-folders ul {
  /* list-style: none; */
  list-style-type: decimal-leading-zero;
  padding-left: 10px;
  margin-left: 10px;
}

.user-folders li {
  color: var(--text-color);
  font-size: 13px;
  /* padding: 2px 0; */
  opacity: 0.8;
}

.no-folders {
  color: var(--text-color);
  font-size: 13px;
  font-style: italic;
  opacity: 0.6;
  margin: 0;
}

.no-data,
.info {
  color: var(--text-color);
  text-align: center;
  font-style: italic;
  opacity: 0.7;
}

@media (max-width: 768px) {
  .admin-content {
    grid-template-columns: 1fr;
  }

  .admin-header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}
.btn-add-user {
  color: var(--text-color);
  float: right;
  /* border: 1px solid silver; */
  border-radius: 5px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  width: 25px;
  height: 25px;
}
svg {
  color: var(--text-color);
}
