/* Estilos para o editor de texto completo do capítulo */

/* Container principal */
.wri-editor-container {
    /* max-width: 1200px; */
    margin: 0 40px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* Cabeçalho do editor */
.wri-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    /* padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0; */
}

.wri-editor-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.wri-editor-subtitle {
    font-size: 14px;
    color: #777;
    font-weight: normal;
    margin-left: 10px;
}

.wri-editor-actions {
    display: flex;
    gap: 10px;
}

.wri-button#wri-save-button {
    background-color: #5CCFBF;
    color: white;
    opacity: 1;
    cursor: pointer;
}

.wri-button#wri-save-button:hover {
    background-color: #4AB0A1;
}

/* Painel de geração */
.wri-generation-panel {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.wri-generation-panel h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    color: #333;
}

.wri-generation-panel p {
    margin-top: 0;
    margin-bottom: 20px;
    color: #666;
}

.wri-button-danger {
    background-color: #dc3545;
    color: white;
}

.wri-button-danger:hover {
    background-color: #bd2130;
}

/* Formulário de geração */
.wri-form-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

.wri-form-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

.wri-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.wri-form-column {
    flex: 1;
}

.wri-form-column label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
}

.wri-form-column select,
.wri-form-column input[type="text"],
#wri-specific-instructions {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
}

#wri-specific-instructions {
    height: 100px;
    resize: vertical;
}

.wri-word-counter {
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 14px;
    text-align: right;
}
    
#wri-word-count {
    font-weight: bold;
}
    
.wri-target-count {
    color: #888;
    margin-left: 5px;
}
    
.wri-word-count-close {
    color: #4CAF50;
}
    
.wri-word-count-far {
    color: #FF5722;
}

.wri-form-footer {
    text-align: center;
    margin-top: 20px;
}

.wri-word-counter {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 14px;
    text-align: right;
    border-radius: 0 0 4px 4px;
}

#wri-word-count {
    font-weight: bold;
}

.wri-target-count {
    color: #888;
    margin-left: 5px;
}

.wri-word-count-below {
    color: #FF9800; /* Laranja para abaixo da meta */
}

.wri-word-count-close {
    color: #4CAF50; /* Verde para perto da meta */
}

.wri-word-count-above {
    color: #F44336; /* Vermelho para acima da meta */
}

/* Barra de progresso */
.wri-word-progress {
    width: 100%;
    height: 4px;
    background-color: #e0e0e0;
    margin-top: 5px;
    overflow: hidden;
    border-radius: 2px;
}

.wri-word-progress-bar {
    height: 100%;
    background-color: #5CCFBF;
    width: 0%;
    transition: width 0.3s ease;
}

/* Painel do editor */
.wri-editor-panel {
    /** border: 1px solid #e0e0e0;
    border-radius: 6px; **/
    overflow: hidden;
}

/* Barra de ferramentas */
#wri-editor-toolbar {
    display: none !important;
    background-color: #f5f5f5;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

#wri-editor-toolbar button {
    background-color: #5CCFBF;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    min-width: 30px;
    text-align: center;
    margin-top: -5px;
}

#wri-editor-toolbar button {
    background-color: #5CCFBF;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    min-width: 30px;
    text-align: center;
}

#wri-editor-toolbar button:hover {
    background-color: #f0f0f0;
}

#wri-editor-toolbar button:active,
#wri-editor-toolbar button.active {
    background-color: #e6e6e6;
    border-color: #ccc;
}

.wri-toolbar-separator {
    margin: 0 5px;
    color: #ddd;
}

/* Área de conteúdo do editor */
#wri-editor-content {
    min-height: 500px;
    /* max-height: 70vh; */
    overflow-y: auto;
    padding: 20px;
    margin-bottom: 200px;
    background-color: #fff;
    border: none;
    outline: none;
    font-size: 20px;
    line-height: 1.6;
    color: #333;
}

#wri-editor-content p {
    margin-bottom: 1em;
}

#wri-editor-content h2, 
#wri-editor-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #222;
}

#wri-editor-content ul, 
#wri-editor-content ol {
    margin-left: 20px;
    margin-bottom: 1em;
}

/* Menu de contexto flutuante */
#wri-context-menu {
    position: absolute;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 5px;
    z-index: 1000;
    display: flex;
    flex-wrap: wrap;
}

#wri-context-menu button {
    background-color: #5CCFBF;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    margin: 2px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

#wri-context-menu button:hover {
    background-color: #f5f5f5;
}

#wri-context-menu button .dashicons {
    margin-right: 5px;
    font-size: 16px;
}

/* Modal de opções de contexto */
#wri-context-options-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wri-context-options-content {
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.wri-context-options-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wri-context-options-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.wri-context-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #777;
}

.wri-context-options-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.wri-context-field {
    margin-bottom: 15px;
}

.wri-context-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
}

.wri-context-field select,
.wri-context-field input,
.wri-context-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.wri-context-field textarea {
    height: 100px;
    resize: vertical;
}

.wri-context-options-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Botões gerais */
.wri-button {
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    border: none;
    transition: background-color 0.2s;
}

.wri-button .dashicons {
    margin-right: 5px;
}

.wri-button-primary {
    background-color: #5CCFBF;
    color: white;
}

.wri-button-primary:hover {
    background-color: #4AB0A1;
}

.wri-button-secondary {
    color: #333;
    margin-top: 20px;
}

.wri-button-secondary:hover {
    background-color: #fff;
}

.wri-button-highlight {
    animation: pulse 2s infinite;
}

/* Modal de versões */
.wri-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wri-modal-content {
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.wri-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wri-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.wri-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #777;
}

.wri-modal-body {
    padding: 20px;
}

/* Lista de versões */
.wri-versions-list-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wri-versions-list-items li {
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
}

.wri-versions-list-items li:last-child {
    border-bottom: none;
}

.wri-version-list-item {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wri-version-list-item:hover {
    background-color: #f5f5f5;
}

.wri-version-list-title {
    font-weight: 500;
    color: #333;
}

.wri-version-list-date {
    color: #777;
    font-size: 13px;
}

/* Detalhes da versão */
.wri-version-details {
    background-color: #fff;
}

.wri-version-info {
    margin-bottom: 20px;
}

.wri-version-title {
    font-size: 18px;
    color: #333;
    margin: 0 0 10px 0;
}

.wri-version-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #666;
    font-size: 14px;
}

.wri-version-params-list {
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    font-size: 13px;
}

.wri-version-param {
    margin-bottom: 5px;
}

.wri-version-param-key {
    font-weight: 500;
    text-transform: capitalize;
}

.wri-version-content {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
    margin-bottom: 20px;
    max-height: 50vh;
    overflow-y: auto;
}

.wri-version-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Notificações */
.wri-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    z-index: 3000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.wri-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.wri-notification.success {
    background-color: #4CAF50;
}

.wri-notification.error {
    background-color: #F44336;
}

.wri-notification.info {
    background-color: #2196F3;
}

/* Carregamento */
.wri-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #666;
}

.wri-loading:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #5CCFBF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.wri-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(92, 207, 191, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(92, 207, 191, 0); }
    100% { box-shadow: 0 0 0 0 rgba(92, 207, 191, 0); }
}

/* Responsividade */
@media (max-width: 768px) {
    .wri-form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .wri-editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .wri-editor-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    #wri-editor-toolbar {
        gap: 3px;
    }
    
    #wri-editor-toolbar button {
        padding: 5px 8px;
        font-size: 13px;
    }
    
    .wri-context-options-content,
    .wri-modal-content {
        width: 95%;
    }
}