

.editor-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: #343a40;
    color: white;
    padding: 20px;
    border-bottom: 1px solid #495057;
}

.title-input {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    padding: 10px 0;
    outline: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
}

.title-input::placeholder {
    color: #adb5bd;
}

.title-input:focus {
    border-bottom-color: #007bff;
}

.title-label {
    display: block;
    font-size: 12px;
    color: #adb5bd;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.toolbar button {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.toolbar button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.toolbar button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.toolbar button.save-btn {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.toolbar button.load-btn {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.toolbar button.view-btn {
    background: #6f42c1;
    color: white;
    border-color: #6f42c1;
}

.toolbar button.save-btn:hover {
    background: #218838;
}

.toolbar button.load-btn:hover {
    background: #138496;
}

.toolbar button.view-btn:hover {
    background: #5a2d91;
}

.toolbar-buttons {
    margin-left: auto;
    display: flex;
    gap: 5px;
}

.image-toolbar {
    background: #e9ecef;
    border-bottom: 1px solid #ddd;
    padding: 8px;
    display: none;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.image-toolbar select, .image-toolbar input {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.image-toolbar button {
    padding: 6px 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.image-toolbar button:hover {
    background: #c82333;
}

.editor {
    min-height: 500px;
    padding: 20px;
    outline: none;
    line-height: 1.6;
    position: relative;
}

.editor:focus {
    border-color: #007bff;
}

.editor img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: inline-block;
}

.editor img.selected {
    outline: 2px solid #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

/* MODO DE VISUALIZAÇÃO */
.view-mode {
    display: none;
    background: white;
    min-height: 500px;
    padding: 40px;
}

.view-mode .document-title {
    font-size: 2.5em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
    text-align: center;
    line-height: 1.3;
}

.view-mode .document-content {
    font-size: 1.1em;
    color: #34495e;
    max-width: 800px;
    margin: 0 auto;
}

.view-mode .document-content h1,
.view-mode .document-content h2,
.view-mode .document-content h3 {
    color: #2c3e50;
    margin: 30px 0 15px 0;
    line-height: 1.3;
}

.view-mode .document-content h1 {
    font-size: 2em;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.view-mode .document-content h2 {
    font-size: 1.6em;
}

.view-mode .document-content h3 {
    font-size: 1.3em;
}

.view-mode .document-content p {
    margin-bottom: 20px;
    text-align: justify;
}

.view-mode .document-content ul,
.view-mode .document-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.view-mode .document-content li {
    margin-bottom: 8px;
}

.view-mode .document-content strong {
    color: #2c3e50;
    font-weight: 600;
}

.view-mode .document-content em {
    color: #7f8c8d;
    font-style: italic;
}

.view-mode .document-content u {
    text-decoration: underline;
    color: #2980b9;
}

.view-mode .document-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px auto;
    display: block;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.view-mode .document-content .image-container {
    text-align: center;
    margin:0;
}

.view-mode .document-content .image-container img {
    max-width: 90%;
}

.view-actions {
    background: #f8f9fa;
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    display: none;
    justify-content: center;
    gap: 10px;
}

.view-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.view-actions .back-btn {
    background: #6c757d;
    color: white;
}

.view-actions .back-btn:hover {
    background: #5a6268;
}

.view-actions .print-btn {
    background: #17a2b8;
    color: white;
}

.view-actions .print-btn:hover {
    background: #138496;
}

.resize-handle {
    position: absolute;
    border: 2px solid white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    cursor: nwse-resize;
    z-index: 10;
    pointer-events: all;
}

.resize-handle.bottom-right {
    bottom: -6px;
    right: -6px;
}

.resize-handle.bottom-left {
    bottom: -6px;
    left: -6px;
}

.resize-handle.top-right {
    top: -6px;
    right: -6px;
}

.resize-handle.top-left {
    top: -6px;
    left: -6px;
}

.status-bar {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 8px 20px;
    font-size: 12px;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-container {
    display: inline-block;
    position: relative;
    margin: 0;
}

.save-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
}

.load-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #17a2b8;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
}

.storage-demo {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
}

.storage-demo h3 {
    margin-bottom: 10px;
    color: #333;
}

.storage-demo button {
    background: #6f42c1;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.storage-demo button:hover {
    background: #5a2d91;
}

/* Responsividade para Modo de Visualização */
@media (max-width: 768px) {
    .view-mode {
        padding: 20px;
    }

    .view-mode .document-title {
        font-size: 2em;
        margin-bottom: 20px;
    }

    .view-mode .document-content {
        font-size: 1em;
    }

    .view-mode .document-content h1 {
        font-size: 1.6em;
    }

    .view-mode .document-content h2 {
        font-size: 1.3em;
    }

    .view-mode .document-content h3 {
        font-size: 1.1em;
    }

    .view-mode .document-content img {
        margin: 15px auto;
    }
}

@media (max-width: 480px) {
    .view-mode {
        padding: 15px;
    }

    .view-mode .document-title {
        font-size: 1.6em;
    }

    .view-mode .document-content {
        font-size: 0.95em;
    }

    .view-mode .document-content h1 {
        font-size: 1.4em;
    }

    .view-mode .document-content ul,
    .view-mode .document-content ol {
        padding-left: 20px;
    }
}

@media (max-width: 600px) {
    .toolbar {
        justify-content: center;
    }

    .toolbar button {
        padding: 6px 10px;
        font-size: 12px;
    }

    .toolbar-buttons {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }

    .title-input {
        font-size: 20px;
    }
}

/* Estilos para impressão */
@media print {
    .toolbar, .view-actions, .storage-demo, .status-bar {
        display: none !important;
    }

    .view-mode {
        display: block !important;
        padding: 0;
        box-shadow: none;
    }

    .view-mode .document-title {
        color: black;
        border-bottom-color: black;
    }

    .view-mode .document-content {
        color: black;
    }

    body {
        background: white;
        padding: 0;
    }
}