/* css/notebook.css */

.notebook-overlay {
    position: fixed;
    top: 60px; /* Debajo de la cabecera */
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    background: var(--bg-container);
    display: none; /* Se activa por JS */
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    border-top: 1px solid var(--border);
}

.notebook-overlay.active {
    display: flex;
}

/* Estado Minimizado: Pestaña lateral derecha */
.notebook-overlay.minimized {
    top: 50%;
    right: 0;
    left: auto;
    bottom: auto;
    width: 60px;
    height: 180px;
    transform: translateY(-50%);
    border-radius: 20px 0 0 20px;
    padding: 10px;
    cursor: pointer;
    background: var(--accent);
    color: white;
    box-shadow: -4px 0 15px rgba(0,0,0,0.2);
    overflow: hidden;
    z-index: 9001;
}

.notebook-overlay.minimized:hover {
    width: 70px;
}

.notebook-overlay.minimized .note-editor-container {
    display: none;
}

.notebook-minimized-trigger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 10px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.notebook-overlay.minimized .notebook-minimized-trigger {
    display: flex;
}

/* Contenedor del Editor en Overlay */
.note-editor-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.note-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.editor-controls {
    display: flex;
    gap: 8px;
}

.btn-editor-control {
    background: var(--bg-filters);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    transition: all 0.2s;
}

.btn-editor-control:hover {
    background: var(--accent);
    color: white;
}

/* Ajustes al toolbar */
.note-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: var(--bg-filters);
    border-radius: 12px;
    border: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-container);
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s;
}

.toolbar-btn:hover {
    border-color: var(--accent);
    background: var(--card-hover);
}

.toolbar-btn.active {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

.note-content-editable {
    flex: 1;
    min-height: 300px;
    background: var(--bg-container);
    border: 1px solid var(--border);
    padding: 20px;
    font-size: 1.05rem;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
    outline: none; /* Eliminar borde azul al enfocar */
}

/* Notebook Container (Lista en el panel de usuario) */
.notebook-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notebook-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-new-note {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

/* Listado de notas */
.note-item {
    background: var(--bg-filters);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.note-item:hover {
    border-color: var(--accent);
    background: var(--bg-container);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Desktop Mode Refinement */
#notebookDesktopContent {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#notebookDesktopContent .note-editor-container {
    padding: 15px;
    height: 100%;
    max-width: none;
    margin: 0;
}

.note-title-input.desktop-title {
    font-size: 1.4rem;
    padding: 10px 0;
    margin-bottom: 5px;
    border-bottom: 2px solid var(--accent);
    border-radius: 0;
    background: transparent;
}

#notebookDesktopContent .note-content-editable {
    border: none;
    box-shadow: none;
    padding: 10px 5px; /* Pequeño margen lateral para visibilidad del cursor */
    outline: none;
}

#notebookDesktopContent .note-editor-toolbar {
    position: static;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .notebook-overlay {
        top: 50px;
        padding: 15px;
    }
    .toolbar-btn {
        width: 32px;
        height: 32px;
    }
}
