* {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    box-sizing: border-box;
}

.note {
    border: 2px solid #ccc;
    padding: 10px;
    margin-top: 10px;
    min-height: 100px;
    background-color: #f9f9f9;
}

/* Estilos CSS para el formateo de texto */
.bold {
    font-weight: bold;
}

.italic {
    font-style: italic;
}

ul,
ol {
    margin-left: 20px;
}

.titulo {
    margin-bottom: 10px;
    margin-top: 20px;

    & input {
        width: 300px !important;
        height: 30px !important;
        border: 1px solid #ccc !important;
        border-radius: 10px !important;
        padding: 5px !important;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.1) !important;
        background-color: transparent !important;
        box-sizing: border-box !important;
    }

    & input:focus {
        outline: none;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    }
}

#font-family-div {
    width: 300px !important;
    border-radius: 10px;
}

select#font-family {
    /* Resetear los estilos predeterminados del select */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: transparent !important;
    width: 300px !important;
    height: 30px !important;
    padding: 5px !important;
    border: 1px solid #ccc !important;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1) !important;
    cursor: pointer;
    border-radius: 10px !important;
    box-sizing: border-box !important;

    & option {
        color: #939393;
    }

    &:focus {
        outline: none;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    }
}

#note-content-div {
    border: 2px solid #ccc;
    padding: 10px;
    min-height: 100px;
}

button {
    background-color: transparent;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px;
    cursor: pointer;
    gap: 5px;

    &:hover {
        background-color: #e5e5e5;
        transform: scale(0.95);
        transition: all 0.2s ease-in-out;
    }
}

.dropdown {
    & button {
        background-color: transparent;
        border: 1px solid #ccc;
        border-radius: 5px;
        padding: 5px;
        cursor: pointer;
        gap: 5px;
    }

    & button:hover {
        background-color: #e5e5e5;
        transform: scale(0.95);
        transition: all 0.2s ease-in-out;
    }
}

button.crear {
    border: 1px solid #ccc;
}

.Todos-botones {
    display: flex;
    justify-content: center;
    align-items: center;
}

.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.Todos-botones button,
.button-container button {
    margin-right: 5px;
}

img {
    position: relative;
}

/* Estilo de las manijas de redimensionamiento */
.resizable {
    position: relative;
    cursor: move;
}

.resizable::before,
.resizable::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: blue;
}

.resizable::before {
    top: -4px;
    left: -4px;
    cursor: nwse-resize;
    /* Manija superior izquierda */
}

.resizable::after {
    bottom: -4px;
    right: -4px;
    cursor: nwse-resize;
    /* Manija inferior derecha */
}

/* Estilos para los puntos de manipulación */
.resize-handles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
}

.resize-handle {
    width: 10px;
    height: 10px;
    background-color: #007bff;
    position: absolute;
    cursor: pointer;
    pointer-events: auto;
}

/* Estilos para pantallas grandes (por ejemplo, escritorios) */

@media (max-width: 768px) {
    /* Estos estilos se aplicarán solo en pantallas con un ancho máximo de 768px (pantallas móviles) */
    /* Reglas específicas para redimensionamiento de imágenes en móvil */

    .resizable-container {
        position: relative;
    }

    .resizable-image {
        width: 100%;
        height: auto;
        cursor: move;
    }

    .resize-handle {
        position: absolute;
        width: 15px;
        height: 15px;
        background-color: rgba(0, 0, 0, 0.5);
    }

    .resize-handle-nw {
        top: 0;
        left: 0;
        cursor: nwse-resize;
    }

    .resize-handle-ne {
        top: 0;
        right: 0;
        cursor: nesw-resize;
    }

    .resize-handle-sw {
        bottom: 0;
        left: 0;
        cursor: nesw-resize;
    }

    .resize-handle-se {
        bottom: 0;
        right: 0;
        cursor: nwse-resize;
    }
}

/* Estilos para la tabla */
table {
    border-collapse: collapse;
    width: 100%;
}

table,
th,
td {
    border: 1px solid #000;
}

th,
td {
    padding: 8px;
    text-align: left;
}

/* Estilos para las celdas editables dentro de la tabla */
table div[contenteditable="true"] {
    outline: none;
    min-height: 20px;
    /* Ajusta el tamaño mínimo de las celdas */
}

/* Estilos adicionales para el contenido div */
#note-content-div {
    min-height: 100px;
    /* Establece un mínimo para el área de contenido */
}

/* Estilos adicionales para la tabla */

.editable-table {
    border-collapse: collapse;
}

.editable-cell {
    min-width: 50px;
    /* Ajusta según sea necesario */
    min-height: 20px;
    /* Ajusta según sea necesario */
}

/* Agrega estilos para resaltar la sintaxis del código */
pre {
    background-color: #f4f4f4;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

/* Establece el estilo del texto dentro del elemento pre */
pre code {
    font-family: "Courier New", Courier, monospace;
}

.math-equation,
.special-character {
    font-style: italic;
    font-size: 1.2em;
}

.special-character {
    color: black;
}

/* Estilos para superíndices y subíndices */
sup,
sub {
    font-size: 0.8em;
    line-height: 1;
    vertical-align: baseline;
    position: relative;
}

sup {
    top: -0.5em;
}

sub {
    bottom: -0.25em;
}

/* Estilo del botón del menú */
.dropdown-btn {

    padding: 1px;
    font-size: 14px;
    cursor: pointer;
}

/* Contenedor del menú desplegable */
.dropdown {
    display: inline-block;
    position: relative;
}

/* Estilo de los botones dentro del menú desplegable */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
    padding: 10px;
    border-radius: 5px;
}

/* Estilo de los botones dentro del menú desplegable */
.dropdown-content button {
    width: 25%;
    background-color: transparent;
    padding: 10px;
    text-align: center;
    border: none;
    cursor: pointer;
    margin: 5px;
}

/* Mostrar el menú desplegable al pasar el ratón sobre él */
.dropdown:hover .dropdown-content {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}

/* Agrega estilos para checkboxes de lista de tareas */
.task-checkbox {
    margin-right: 5px;
}

/* Estilos para tareas completadas */
.task-done {
    text-decoration: line-through;
    color: #555;
    opacity: 0.7;
    /* Opacidad para indicar tarea completada */
}


/*Corregir el error de la nota creada*/

/* Agrega estilos para subrayar las palabras incorrectas */
.note .spell-error {
    border-bottom: 2px solid red;
    position: relative;
    display: inline-block;
}

/* Estilos para el desplegable de sugerencias */
#sugerenciasDiv {
    display: none;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 5px;
    position: absolute;
    z-index: 1000;
}


#note-content-div[contenteditable="true"] {
    font-family: 'Arial';
    font-size: 12px;
    line-height: 1;
}

.crear {
    border-radius: 5px;
    border: black 1px solid;
}

/* Add styles for the dark mode toggle */
#dark-mode-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 1000;
}

/* Add styles for the dark mode icon */
#dark-mode-toggle i {
    font-size: 27px;
}

/* Add styles for dark mode */
body.dark-mode {
    background-color: #222;
    color: #fff;
}

body.dark-mode .note {
    background-color: #222;
    color: #fff;
}

/* Estilos específicos para modo oscuro */
.dark-mode button {
    background-color: #fff;
    border: 1px solid #ccc;
    color: #000;

    &:hover {
        background-color: #eee;
    }
}

.dark-mode #clipboard-container {
    background-color: #222;
    color: #fff;
    border: 1px solid #444;
}

.dark-mode .editable-table tr td {
    border: 1px solid #fff;
    background-color: #222;
    color: #fff;
}

/* Input del título en modo oscuro - fondo claro para legibilidad */
body.dark-mode .titulo input {
    background-color: #fff !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
}

body.dark-mode .titulo input:focus {
    background-color: #fff !important;
    color: #000 !important;
    outline: none;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* Selector de fuente en modo oscuro - fondo claro para legibilidad */
body.dark-mode select#font-family {
    background-color: #fff !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
}

body.dark-mode select#font-family:focus {
    background-color: #fff !important;
    color: #000 !important;
    outline: none;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* Opciones del select en modo oscuro */
body.dark-mode select#font-family option {
    background-color: #fff !important;
    color: #000 !important;
}

/* Reglas mínimas para responsividad móvil */
@media (max-width: 768px) {
    /* Solo prevenir overflow horizontal */
    body, html {
        overflow-x: hidden;
    }
    
    /* Hacer título y selector responsivos solo en móvil con el MISMO tamaño */
    .titulo input,
    select#font-family {
        width: 90% !important;
        max-width: 280px !important;
        min-width: 280px !important;
        height: 30px !important;
        box-sizing: border-box !important;
        padding: 5px !important;
        border: 1px solid #ccc !important;
        border-radius: 10px !important;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Solo ajustar el ancho del contenedor del select */
    #font-family-div {
        width: 90% !important;
        max-width: 280px !important;
        min-width: 280px !important;
    }
}

/* Estilos para los botones de gestión de notas */
.note-management-section {
    margin: 15px 0;
    padding: 0;
}

.note-management-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 auto;
}

.note-management-buttons button,
.note-management-buttons label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 12px;
    font-weight: normal;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: auto;
    box-sizing: border-box;
    background-color: transparent;
    color: inherit;
}

/* Estilos específicos para cada tipo de botón - más sutiles */
.btn-primary {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-success {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.note-management-buttons button:hover,
.note-management-buttons label:hover {
    transform: scale(0.95);
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover { 
    background-color: #0056b3; 
    border-color: #0056b3;
}
.btn-danger:hover { 
    background-color: #c82333; 
    border-color: #c82333;
}
.btn-success:hover { 
    background-color: #218838; 
    border-color: #218838;
}
.btn-info:hover { 
    background-color: #138496; 
    border-color: #138496;
}

/* Responsividad para móviles */
@media (max-width: 768px) {
    .note-management-section {
        padding: 10px 5px;
        margin: 10px 0;
    }
    
    .note-management-buttons {
        gap: 6px;
    }
    
    .note-management-buttons button,
    .note-management-buttons label {
        padding: 6px 10px;
        font-size: 11px;
        gap: 4px;
    }
    
    .note-management-buttons i {
        font-size: 12px;
    }
}

/* Para pantallas muy pequeñas - apilar en dos filas */
@media (max-width: 480px) {
    .note-management-buttons {
        gap: 5px;
        max-width: 95%;
    }
    
    .note-management-buttons button,
    .note-management-buttons label {
        padding: 5px 8px;
        font-size: 10px;
        flex: 1;
        min-width: calc(50% - 3px);
        max-width: calc(50% - 3px);
    }
    
    .note-management-buttons i {
        font-size: 11px;
    }
}

/* Estilos específicos para modo oscuro en botones de gestión */
body.dark-mode .note-management-buttons button {
    background-color: #fff;
    border: 1px solid #ccc;
    color: #000;
}

body.dark-mode .note-management-buttons button:hover {
    background-color: #eee;
}

/* Mantener colores específicos para botones de acción en modo oscuro */
body.dark-mode .btn-primary {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

body.dark-mode .btn-danger {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

body.dark-mode .btn-success {
    background-color: #198754;
    color: white;
    border-color: #198754;
}

body.dark-mode .btn-info {
    background-color: #0dcaf0;
    color: #000;
    border-color: #0dcaf0;
}

/* Estilos para el contador de notas */
.notes-counter {
    text-align: center;
    margin: 20px 0;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 300px;
    margin: 20px auto;
    border: 1px solid #e9ecef;
}

.notes-counter i {
    color: #007bff;
    font-size: 16px;
}

/* Modo oscuro para el contador */
body.dark-mode .notes-counter {
    background-color: #343a40;
    color: #adb5bd;
    border-color: #495057;
}

body.dark-mode .notes-counter i {
    color: #0d6efd;
}

/* Responsividad para el contador en móvil */
@media (max-width: 768px) {
    .notes-counter {
        margin: 10px auto;
        padding: 8px 12px;
        font-size: 13px;
        max-width: 220px;
    }
    
    .notes-counter i {
        font-size: 14px;
    }
}