/* ===== Writer Box Tools - Frontend Styles ===== */

.wbt-tool-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-width: 100%;
    margin: 32px auto 40px auto;
    box-shadow: 0 2px 16px 0 rgba(0,0,0,0.05);
    padding: 32px 28px 24px 28px;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
}

.wbt-tool-title {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 0.2em;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.wbt-tool-icon {
    font-size: 1.4em;
    vertical-align: middle;
}

.wbt-tool-description {
    color: #4b5563;
    font-size: 1.08em;
    margin-bottom: 1.2em;
}

.wbt-tool-form {
    margin-top: 1.5em;
}

.wbt-editor {
    width: 100%;
    min-height: 120px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 12px;
    font-size: 1.08em;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1.1em;
    background: #f9fafb;
    transition: border 0.2s;
}
.wbt-editor:focus {
    border-color: #2563eb;
    background: #fff;
    outline: none;
}

.wbt-tool-vars {
    margin-bottom: 1em;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.wbt-tool-vars label {
    font-weight: 500;
    margin-right: 0.5em;
}
.wbt-var-input {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    min-width: 120px;
    font-size: 1em;
    background: #f3f4f6;
}

.wbt-token-counter {
    font-size: 1em;
    margin-bottom: 1em;
    color: #2563eb;
    font-weight: 500;
}
.wbt-tokens-estimate {
    font-weight: 700;
    color: #1e293b;
    margin: 0 4px;
}
.wbt-tokens-label {
    color: #64748b;
    font-size: 0.95em;
}

.wbt-process-btn {
    background-color: #FFDF00 !important;
    color: #000 !important;
    border: none;
    padding: 14px 32px;
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    text-align: center;
    display: inline-block;
    border: none !important;
    background-color: #ffd900 !important;
    color: #000 !important;	
}
.wbt-process-btn:hover,
.wbt-process-btn:focus {
    background-color: #f2c800 !important;
    outline: none;
}

.wbt-processing {
    color: #64748b;
    font-size: 1.05em;
    margin-bottom: 1em;
    font-style: italic;
    display: block;
}

/* ======================= */
/* SECCIÓN CRÍTICA ACTUALIZADA */
/* ======================= */
.wbt-tool-result {
    background: #f8fafc;
    padding: 18px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-top: 10px;
    font-size: 1.08em;
    color: #22223b;
    word-break: break-word;
    min-height: auto !important;
    overflow: visible !important;
    max-height: none !important;
}

.wbt-result-output {
    white-space: pre-wrap;
    line-height: 1.6;
    margin: 15px 0;
    width: 100%;
    max-width: 100%;
}

.wbt-result-success {
    color: #1e293b;
}
.wbt-result-success .wbt-result-tokens {
    margin-top: 1em;
    color: #2563eb;
    font-size: 0.98em;
}
.wbt-result-error {
    color: #dc2626;
    font-weight: 600;
    background: #fef2f2;
    padding: 10px 12px;
    border-radius: 5px;
    margin-top: 8px;
    margin-bottom: 0;
}

.wbt-error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 5px;
    padding: 10px 14px;
    margin-bottom: 1em;
    font-weight: 500;
}

/* TinyMCE content overrides */
.mce-content-body {
    font-family: inherit !important;
    font-size: 1.07em !important;
    color: #1e293b !important;
    background: #fff !important;
}

/* Panel general de la herramienta */
.wbt-flex-panel {
    display: flex;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    width: 100%;
    min-height: 500px;
    box-shadow: 0 2px 12px 0 rgba(37,99,235,0.06);
    margin: 0;
}
.wbt-panel-left, .wbt-panel-right {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0;
}
.wbt-panel-left {
    border-right: 1px solid #e2e8f0;
    background: #f9fafb;
    padding: 24px 18px 24px 24px;
}
.wbt-panel-right {
    background: #fff;
    padding: 24px 24px 24px 18px;
}
.wbt-panel-header {
    background: #e0e7ef;
    padding: 12px 18px;
    font-size: 1.1em;
    border-bottom: 1px solid #e2e8f0;
}

/* Responsive */
@media (max-width: 900px) {
    .wbt-flex-panel {
        flex-direction: column;
        min-height: 0;
    }
    .wbt-panel-left, .wbt-panel-right {
        padding: 20px 12px;
        border: none;
    }
    .wbt-panel-left {
        border-bottom: 1px solid #e2e8f0;
    }
}
@media (max-width: 600px) {
    .wbt-tool-container {
        padding: 16px 4vw 16px 4vw;
        max-width: 98vw;
    }
    .wbt-tool-title {
        font-size: 1.18em;
    }
    .wbt-editor {
        font-size: 1em;
        min-height: 90px;
    }
    .wbt-process-btn {
        width: 100%;
        padding: 12px 0;
    }
    .wbt-tool-result {
        padding: 10px 6px;
        font-size: 1em;
    }
}

/* NUEVAS CLASES INCORPORADAS PARA ORDEN VISUAL */

.wbt-vars-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 1.5em;
}
.wbt-vars-row > div {
    flex: 1 1 180px;
    display: flex;
    flex-direction: column;
}

.wbt-vars-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1.5em;
}

.wbt-checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
