/* -----------------------------------------
   VARIÁVEIS E ESTILOS GERAIS
----------------------------------------- */


:root {
  --bg-primary: #121214;
  --bg-sidebar: #1a1a1e;
  --text-color: #e1e1e6;
  --accent-color: #04d361;
  --sidebar-width: 280px;
  /* NOVA VARIÁVEL: Tamanho base ideal para leitura confortável */
  --editor-font-size: 1rem; 
}




* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-color);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* -----------------------------------------
 BOTÃO HAMBÚRGUER (O MENU)
----------------------------------------- */
.menu-hamburger {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.menu-hamburger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.line {
  width: 100%;
  height: 3px;
  background-color: var(--text-color);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-hamburger.active .line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  background-color: var(--accent-color);
}

.menu-hamburger.active .line:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.menu-hamburger.active .line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  background-color: var(--accent-color);
}

/* -----------------------------------------
 BARRA LATERAL (SIDEBAR)
----------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: calc(-1 * var(--sidebar-width));
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--bg-sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 80px 20px 20px 20px;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  left: 0;
}

.sidebar h2 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--accent-color);
  letter-spacing: 1px;
}

.note-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 15px;
}

/* Item da lista com suporte à lixeira alinhada */
.note-list-item {
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.note-list-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.note-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.note-list-item:hover .note-title-text {
  color: var(--accent-color);
}

/* Botão de lixeira individual */
.btn-delete-note {
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-delete-note:hover {
  color: #f75a68;
  background: rgba(247, 90, 104, 0.1);
}

.sidebar-actions {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 15px;
}

.btn-action {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.btn-action:hover {
  background: rgba(4, 211, 97, 0.1);
}

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

.btn-action.danger:hover {
  background: rgba(247, 90, 104, 0.1);
}

/* -----------------------------------------
 CONTEÚDO PRINCIPAL (ULTRA RESPONSIVO)
----------------------------------------- */
.main-content {
  flex: 1;
  padding: 20px;
  padding-top: 80px;
  width: 100%;
  max-width: 1200px; /* Excelente aproveitamento em telas grandes */
  margin: 0 auto;
  transition: margin-left 0.3s ease;
}

@media(min-width: 768px) {
  .main-content { 
      padding: 40px; 
      padding-top: 80px; 
      width: 85%; 
  }
  body.sidebar-open .main-content { 
      margin-left: calc(var(--sidebar-width) / 2); 
  }
}

@media(min-width: 1400px) {
  .main-content {
      width: 80%; 
  }
}

textarea {
  width: 100%;
  height: 72vh; /* Altura ideal sem quebrar barras fixas */
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-color);
  padding: 20px; 
  font-family: 'Courier New', Courier, monospace;
   /* CALIBRAÇÃO: Lê o valor vivo da variável do chassi */
   font-size: var(--editor-font-size); 
  font-size: 1rem;
  resize: none;
  outline: none;
  line-height: 1.6;
}






textarea:focus {
  border-color: var(--accent-color);
}

/* --- ESTILIZAÇÃO DO SCROLLBAR UNIVERSAL --- */

/* 1. Ajuste Geral anti-fundo-branco para Firefox */
textarea, .note-list {
  color-scheme: dark; 
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) rgba(20, 20, 22, 0.5);
}

/* 2. Regras de suporte para Chrome, Edge e Safari */
textarea::-webkit-scrollbar, .note-list::-webkit-scrollbar {
  width: 8px;
}

textarea::-webkit-scrollbar-track, .note-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 8px 8px 0;
}

textarea::-webkit-scrollbar-thumb, .note-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover, .note-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}



/* Input de Título - Restaurado ao Estilo Neon/Monospace */
#titulo-nota {
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  color: var(--accent-color); /* Retorna para o Verde Neon original */
  font-family: 'Courier New', Courier, monospace; /* Fonte Monospace idêntica ao editor */
  font-size: 1.6rem; /* Letras grandes e imponentes */
  font-weight: bold;
  padding: 5px 0;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}

#titulo-nota:focus {
  border-color: var(--accent-color);
}



/* -----------------------------------------
   BARRA DE STATUS (RODAPÉ DO EDITOR)
----------------------------------------- */
.status-bar {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  padding: 10px 15px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none; /* Emenda perfeitamente com a borda do textarea */
  border-radius: 0 0 8px 8px; /* Arredonda apenas os cantos de baixo */
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: #666;
}

/* Ajuste no textarea para encaixar na barra de status */
textarea {
  margin-bottom: 0; /* Remove margens para colar na barra */
  border-radius: 8px 8px 0 0; /* Arredonda apenas os cantos de cima */
}






/* AJUSTE AUTOMÁTICO DE ZOOM ÓPTICO PARA MOBILE (BLINDADO) */
@media (max-width: 767px) {
  textarea {
    font-size: 1.25rem !important; /* Força o aumento real da letra do editor */
  }
  
  #titulo-nota {
    font-size: 1.4rem !important; /* Força o ajuste do título */
  }
}
