/* --- TEMA WOOJU SPACE (AZUL ESCURO) --- */
:root {
    --bg-color: #0B0C10; /* Fundo Profundo */
    --primary: #1F2833;  /* Sidebar */
    --accent: #66FCF1;   /* Ciano Neon */
    --text-light: #C5C6C7; /* Texto Claro */
    --text-white: #ffffff;
    --btn-bg: #45A29E;   /* Botão */
    --font-main: 'Poppins', sans-serif;
}

body { background-color: var(--bg-color); color: var(--text-light); font-family: var(--font-main); margin: 0; overflow: hidden; height: 100vh; display: flex; flex-direction: column;}
.screen { width: 100%; height: 100%; flex-grow: 1; position: relative;}
.flex-center { display: flex; align-items: center; justify-content: center; flex-direction: column; }

/* Rodapé */
#app-footer{
  background: var(--primary);
  color: var(--accent);
  text-align: center;
  padding: 10px;
  font-size: 0.8rem;
  width: 100%;
  border-top: 1px solid var(--btn-bg);
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
}

/* Welcome */
.welcome-box { background: var(--primary); padding: 40px; border-radius: 10px; text-align: center; border: 1px solid var(--accent); box-shadow: 0 0 20px rgba(102, 252, 241, 0.1); }
.welcome-box h1 { color: var(--accent); margin-bottom: 20px; font-weight: 600; font-size: 2rem; }
.btn-group button { background: transparent; color: var(--text-light); border: 1px solid var(--btn-bg); padding: 10px 20px; margin: 5px; border-radius: 5px; cursor: pointer; font-family: var(--font-main); transition: 0.3s; }
.btn-group button:hover { background: var(--btn-bg); color: var(--bg-color); box-shadow: 0 0 10px var(--accent); }

/* Role Buttons */
.role-btn { background: var(--bg-color); border: 1px solid var(--accent); color: var(--text-white); padding: 20px 40px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 20px; transition: all 0.2s; width: 300px; text-align: left; }
.role-btn:hover { background: var(--btn-bg); transform: translateX(5px); }
.icon-circle { width: 50px; height: 50px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--accent); }
.btn-back { background: transparent; color: #666; border: 1px solid #444; padding: 8px 20px; border-radius: 20px; cursor: pointer; margin-top: 15px; }
.btn-back:hover { color: var(--accent); border-color: var(--accent); }

/* Sidebar */
.layout-space { display: flex; height: calc(100vh - 40px); }
.space-sidebar { width: 280px; background: var(--primary); padding: 20px; display: flex; flex-direction: column; gap: 15px; border-right: 1px solid var(--btn-bg); overflow-y: auto;}

.profile-box { text-align: center; border-bottom: 1px solid #333; padding-bottom: 15px; }
.avatar-space { font-size: 3rem; color: var(--accent); animation: float 3s ease-in-out infinite; }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }
.space-title { color: var(--text-white); font-weight: 700; margin: 10px 0 0 0; }

.folders-section { border-bottom: 1px solid #333; padding-bottom: 10px; }
.folder-list { list-style: none; padding: 0; margin: 10px 0; max-height: 120px; overflow-y: auto; }
.folder-list li { padding: 8px; cursor: pointer; color: var(--text-light); font-size: 0.9rem; border-radius: 5px; display: flex; gap: 10px; align-items: center; transition: 0.2s;}
.folder-list li:hover, .folder-list li.active-folder { background: var(--bg-color); color: var(--accent); border-left: 3px solid var(--accent); }
.btn-new-folder { background: none; border: 1px dashed #555; color: #888; width: 100%; padding: 5px; cursor: pointer; border-radius: 5px; font-size: 0.8rem; }
.btn-new-folder:hover { color: var(--accent); border-color: var(--accent); }

.tools-container { overflow-y: auto; padding-right: 5px; flex-grow: 1; }
.menu-label { font-size: 0.75rem; color: var(--btn-bg); text-transform: uppercase; margin: 15px 0 5px 0; font-weight: bold; letter-spacing: 1px; }

/* SELETOR EM CAIXAS */
.paper-grid-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.paper-card { 
    height: 60px; border: 1px solid #444; border-radius: 5px; cursor: pointer; 
    display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: #888; transition: 0.2s;
}
.paper-card:hover { border-color: var(--accent); color: var(--accent); }
.p-white { background: #fff; color: #333; }
.p-lined { background: #fff; background-image: repeating-linear-gradient(transparent, transparent 9px, #ccc 10px); color: #333; }
.p-dark { background: #121212; color: #eee; }
.p-dark-lined { background: #121212; background-image: repeating-linear-gradient(transparent, transparent 9px, #333 10px); color: #eee; }

.brush-controls { display: flex; gap: 5px; align-items: center; margin-bottom: 5px; }
.brush-controls button { width: 40px; height: 40px; border-radius: 5px; border: 1px solid #444; background: var(--bg-color); cursor: pointer; color: var(--text-light); font-size: 1.1rem; transition: 0.2s;}
.brush-controls button:hover { border-color: var(--accent); }
.brush-controls button.active-tool { background: var(--btn-bg); color: var(--bg-color); border-color: var(--accent); }

input[type="color"] { border: none; width: 30px; height: 30px; cursor: pointer; background: none; padding: 0;}
.slide-container { display: flex; align-items: center; gap: 5px; font-size: 0.8rem; color: #888; margin-top: 5px;}
.slide-container input { flex-grow: 1; accent-color: var(--accent); }

.btn-upload { display: block; width: 100%; text-align: center; padding: 10px; border: 1px dashed #555; border-radius: 5px; color: #888; cursor: pointer; margin-top: 10px; font-size: 0.9rem;}
.btn-upload:hover { border-color: var(--accent); color: var(--accent); background: rgba(100, 255, 218, 0.05); }
.btn-destaque { width: 100%; background: var(--accent); color: var(--bg-color); border: none; padding: 12px; border-radius: 5px; font-weight: bold; cursor: pointer; margin-top: 15px; transition: 0.2s;}
.btn-destaque:hover { box-shadow: 0 0 15px var(--accent); }
.btn-refresh { width: 100%; background: var(--btn-bg); color: white; border: none; padding: 10px; border-radius: 5px; cursor: pointer; font-weight: bold; }
.btn-sair { background: none; border: 1px solid #444; padding: 8px; border-radius: 5px; width: 100%; cursor: pointer; color: #888; margin-top: 10px;}

/* Main Area */
#scroll-area { flex-grow: 1; overflow: auto; position: relative; background-color: #050608; background-image: radial-gradient(#1f2833 1px, transparent 1px); background-size: 30px 30px; display: flex; flex-direction: column; align-items: center; padding: 40px 40px 80px 40px; }
#zoom-wrapper { transform-origin: top center; transition: transform 0.1s ease-out; margin-bottom: 20px; }

#folha-carta {
    width: 650px; min-height: 850px; padding: 50px; 
    box-shadow: 0 0 30px rgba(0,0,0,0.5); position: relative; 
    background: white; display: flex; flex-direction: column; border-radius: 2px;
}

/* Modos de Papel CSS FIX */
.papel-white-plain { background: #fff !important; color: #333 !important; }
.papel-white-lined { background: #fff; background-image: repeating-linear-gradient(transparent, transparent 29px, #e0e0e0 30px); line-height: 30px; color: #333 !important; }
.papel-black-plain { background: #121212 !important; color: #e0e0e0 !important; }
.papel-black-lined { background: #121212 !important; background-image: repeating-linear-gradient(transparent, transparent 29px, #333 30px); line-height: 30px; color: #e0e0e0 !important; }

/* Ajustes de cor no modo dark */
.papel-black-plain input, .papel-black-lined input, .papel-black-plain .editable-body, .papel-black-lined .editable-body { color: #e0e0e0 !important; }
.papel-black-plain .to-line, .papel-black-lined .to-line { color: #888; }

.letter-meta { margin-bottom: 10px; border-bottom: 1px solid #ccc; padding-bottom: 10px; }
.to-line { font-weight: 600; font-size: 1rem; color: #555; margin-bottom: 5px; }
.input-title { width: 100%; border: none; font-size: 1.5rem; outline: none; font-family: inherit; font-weight: 600; background: transparent;}

.editor-toolbar {
    display: flex; gap: 5px; background: #fff; padding: 8px; border: 1px solid #eee; border-radius: 5px; margin-bottom: 10px; flex-wrap: wrap; align-items: center; position: relative; z-index: 20;
}
.editor-toolbar button { background: white; border: 1px solid transparent; width: 30px; height: 30px; cursor: pointer; color: #555; border-radius: 3px; display: flex; justify-content: center; align-items: center;}
.editor-toolbar button:hover { background: #f0f0f0; }
.separator { width: 1px; height: 20px; background: #ddd; margin: 0 5px; }

.editable-body { flex-grow: 1; min-height: 500px; outline: none; line-height: 30px; font-size: 1.1rem; position: relative; z-index: 15; }
#camada-desenho { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 18; }
#cursor-dot { position: fixed; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; pointer-events: none; display: none; z-index: 9999; box-shadow: 0 0 5px var(--accent);}

.daum-notice { width: 650px; margin-top: 10px; padding: 15px; background: #1F2833; border: 1px solid #333; font-size: 0.8rem; color: #888; text-align: left; margin-bottom: 50px; border-radius: 5px; }

/* Lista Leitura */
.overlay-lista { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-color); z-index: 10000; padding: 40px; overflow-y: auto; color: var(--text-light); }
.list-header { display: flex; padding: 10px; background: var(--primary); font-weight: bold; color: var(--accent); border-radius: 5px; width: 90%; margin: 0 auto; align-items: center;}
.daum-list { width: 90%; margin: 0 auto; }
.list-row { display: flex; padding: 15px 10px; border-bottom: 1px solid #333; cursor: pointer; transition: 0.2s; align-items: center; }
.list-row:hover { background: var(--primary); }
.star-btn { cursor: pointer; color: #444; width: 30px; text-align: center; transition: 0.2s; }
.star-btn.active-star { color: var(--accent); text-shadow: 0 0 5px var(--accent); }

/* Modais */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 999; display: flex; justify-content: center; align-items: center;}
.modal-box { background: var(--primary); padding: 30px; border-radius: 10px; text-align: center; width: 350px; border: 1px solid var(--accent); color: var(--text-white);}
.btn-new-folder-modal { width: 100%; padding: 10px; background: #333; color: #ccc; border: none; border-radius: 5px; margin-bottom: 10px; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 10px; }
.btn-new-folder-modal:hover { color: var(--accent); }
.list-mover-container button { width: 100%; padding: 8px; margin-bottom: 5px; border: 1px solid #444; background: var(--bg-color); color: #ccc; cursor: pointer; text-align: left; border-radius: 5px; }
.list-mover-container button:hover { border-color: var(--accent); color: var(--accent); }

.modal-leitor { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 500; display: flex; justify-content: center; align-items: center; }
.leitor-papel { width: 650px; height: 85vh; background: white; padding: 50px; overflow-y: auto; border-radius: 5px; position: relative; color: #333;}

/* --------------------
   Responsividade
   -------------------- */

@media (max-width: 900px) {
  body { overflow: auto; height: auto; min-height: 100vh; }

  /* Telas iniciais */
  .welcome-box { width: min(92vw, 460px); padding: 22px; margin: 16px 0 84px 0; }
  .welcome-box h1 { font-size: 1.6rem; }
  .btn-group { width: 100%; }
  .btn-group button { width: 100%; padding: 14px 16px; font-size: 1rem; }
  .btn-group-vertical { width: 100%; }
  .role-btn { width: min(92vw, 460px); padding: 16px 18px; }
  .btn-back { margin-bottom: 84px; }

  /* Layout principal */
  .layout-space { flex-direction: column; height: auto; padding-bottom: 84px; }
  .space-sidebar {
    width: 100%;
    padding: 14px;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--btn-bg);
    gap: 12px;
  }

  .folders-section { width: 100%; }
  .folder-list { max-height: 140px; }

  #scroll-area { padding: 16px 12px 100px 12px; width: 100%; }
  #zoom-wrapper { width: 100%; }

  #folha-carta {
    width: min(92vw, 650px);
    min-height: 70vh;
    padding: 22px;
  }

  .input-title { font-size: 1.2rem; }
  .editable-body { min-height: 44vh; font-size: 1.05rem; }

  .daum-notice { width: min(92vw, 650px); margin-bottom: 84px; }

  /* Lista de leitura */
  .overlay-lista { padding: 16px 12px 96px 12px; }
  .list-header, .daum-list { width: 100%; }
}

@media (max-width: 900px) {
  #screen-lang { padding-bottom: 90px; }
  body { overflow: auto; height: auto; min-height: 100vh; }
}

#screen-lang{ position: relative; z-index: 3; padding-bottom: 90px; }

@media (max-width: 900px){
  body{ overflow: auto; height: auto; min-height: 100vh; }
  #app-footer{ position: static; pointer-events: auto; }
}

