/* editor.css - Complete Version */

/* Container Principal */
.editor-container {
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Toolbar e Controles */
.toolbar {
    padding: 10px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ccc;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.toolbar select,
.toolbar button,
.toolbar input {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: white;
    font-size: 14px;
    height: 32px;
}

.toolbar button {
    cursor: pointer;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toolbar button:hover {
    background-color: #f0f0f0;
    border-color: #bbb;
}

.toolbar button.active {
    background-color: #e2e2e2;
    border-color: #aaa;
}

/* Seletores Especiais */
.font-size-selector,
.style-selector {
    min-width: 100px;
}

.template-selector {
    min-width: 150px;
}

/* Pickers de Cor */
.color-picker,
.highlight-picker {
    width: 32px;
    height: 32px;
    padding: 2px;
    border: none;
    cursor: pointer;
    border-radius: 3px;
}

.color-picker::-webkit-color-swatch,
.highlight-picker::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* Separador */
.separator {
    width: 1px;
    height: 24px;
    background-color: #ddd;
    margin: 0 8px;
}

/* Área de Edição */
.editor-content {
    min-height: 300px;
    padding: 20px;
    background: white;
    outline: none;
    font-size: 14px;
    line-height: 1.6;
}

/* Contadores */
.editor-footer {
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-top: 1px solid #ccc;
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #666;
}

/* Emoji Picker */
.emoji-popup {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.emoji-popup span {
    cursor: pointer;
    padding: 4px;
    text-align: center;
    border-radius: 3px;
    transition: background-color 0.2s;
    user-select: none;
}

.emoji-popup span:hover {
    background-color: #f0f0f0;
}

/* Sistema de Tags */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    min-height: 36px;
    border-top: 1px solid #ccc;
    background: #fafafa;
}

.tag {
    background-color: #e1f5fe;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.2s;
}

.tag:hover {
    background-color: #b3e5fc;
}

.remove-tag {
    cursor: pointer;
    color: #666;
    font-weight: bold;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.remove-tag:hover {
    background-color: rgba(0,0,0,0.1);
}

.tag-input {
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 16px;
    font-size: 12px;
    outline: none;
    width: 120px;
    transition: all 0.2s;
}

.tag-input:focus {
    border-color: #2196f3;
    width: 160px;
}

/* Estilos para Conteúdo Editável */
.editor-content h1 {
    font-size: 24px;
    margin: 20px 0 10px;
}

.editor-content h2 {
    font-size: 20px;
    margin: 18px 0 9px;
}

.editor-content h3 {
    font-size: 16px;
    margin: 16px 0 8px;
}

.editor-content blockquote {
    border-left: 3px solid #2196f3;
    margin: 10px 0;
    padding: 10px 20px;
    background: #f5f5f5;
    font-style: italic;
}

.editor-content p {
    margin: 10px 0;
}

/* Estilos para Listas */
.editor-content ul,
.editor-content ol {
    margin: 10px 0;
    padding-left: 30px;
}

/* Estilo para Links */
.editor-content a {
    color: #2196f3;
    text-decoration: none;
}

.editor-content a:hover {
    text-decoration: underline;
}

/* Estilos para Tabelas */
.editor-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}

.editor-content table td,
.editor-content table th {
    border: 1px solid #ddd;
    padding: 8px;
}

.editor-content table th {
    background-color: #f5f5f5;
}

/* Gerenciador de Imagens */
.image-manager {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 16px;
    background: white;
    margin-top: 20px;
}

.image-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 4px;
    min-height: 200px;
}

/* Modos de Visualização de Imagens */
.image-grid.timeline {
    grid-template-columns: 1fr;
    gap: 24px;
}

.image-grid.comparison {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.image-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: white;
    transition: transform 0.2s;
}

.image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.image-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-item:hover .image-controls {
    opacity: 1;
}

.image-controls button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
}

.image-controls button:hover {
    background: white;
    color: #333;
    transform: scale(1.1);
}

/* Containers de Arquivos */
.file-container,
.spreadsheet-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 4px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.file-container:hover,
.spreadsheet-container:hover {
    background: #e5e5e5;
}

.file-size {
    color: #666;
    font-size: 12px;
}

/* Botões de Upload */
.btn-upload,
.btn-create-gif {
    padding: 8px 16px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.btn-upload:hover,
.btn-create-gif:hover {
    background: #1976d2;
}

/* Seletor de Modo de Visualização */
.view-mode {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

/* Responsividade */
@media (max-width: 768px) {
    .toolbar {
        flex-wrap: wrap;
    }
    
    .font-size-selector,
    .style-selector,
    .template-selector {
        width: 100%;
    }
    
    .image-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    .image-grid.comparison {
        grid-template-columns: 1fr;
    }
}


/* Ícones Modernos */
.tool-button svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.editor-spreadsheet {
    border-collapse: collapse;
    margin: 10px 0;
}

.editor-spreadsheet td {
    border: 1px solid #ccc;
    padding: 5px;
    min-width: 80px;
    height: 25px;
}

.editor-spreadsheet td:focus {
    outline: 2px solid #0066cc;
}



.shape-container {
    display: inline-block;
    position: relative;
    vertical-align: middle;
    margin: 2px;
}

.shape-wrapper {
    display: inline-block;
    vertical-align: middle;
}

.drawing-layer {
    z-index: 1000;
    pointer-events: none;
}

/* Estilo para quando as formas estão sendo arrastadas */
.shape-wrapper:hover {
    cursor: move;
}