/* ═══════════════════════════════════════════════════════════════════════════════
   5. MODALES
   Ventanas emergentes para configuración, envío masivo, etc.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   5.1 Modal Base
   Estilos base para todos los modales
   ───────────────────────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #202c33;
    border-radius: 8px;
    z-index: 1001;
    display: none;
    min-width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
}

.modal.show {
    display: block;
}

.modal-overlay.show {
    display: block;
}

.modal-large {
    min-width: 800px;
}

.modal-header {
    background: #2a3942;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #313d45;
}

.modal-header h3 {
    color: #e9edef;
    font-size: 18px;
    font-weight: 500;
}

.close-btn {
    background: none;
    border: none;
    color: #aebac1;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    background: #2a3942;
    padding: 16px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #313d45;
}

/* ─────────────────────────────────────────────────────────────────────────────
   5.2 Modal de Configuración con Tabs
   Modal grande para configuraciones avanzadas
   ───────────────────────────────────────────────────────────────────────────── */

.modal-config {
    min-width: 900px;
    max-width: 1100px;
}

.config-tabs {
    display: flex;
    border-bottom: 2px solid #313d45;
    margin-bottom: 24px;
    gap: 4px;
}

.config-tab-btn {
    background: none;
    border: none;
    color: #8696a0;
    padding: 14px 20px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px 8px 0 0;
}

.config-tab-btn:hover {
    color: #e9edef;
    background: rgba(0, 168, 132, 0.1);
}

.config-tab-btn.active {
    color: #00a884;
    border-bottom-color: #00a884;
    background: rgba(0, 168, 132, 0.15);
}

.config-tab-btn i {
    font-size: 16px;
}

.config-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.config-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.config-section {
    background: #1f2c34;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #313d45;
}

.config-section h4 {
    color: #00a884;
    margin: 0 0 16px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #313d45;
}

.config-section h4 i {
    font-size: 18px;
}

.config-section-title {
    color: #00a884;
    margin: 0 0 16px 0;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #313d45;
    font-weight: 600;
}

.config-section-title i {
    font-size: 16px;
    opacity: 0.8;
}

.config-section-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group-checkbox {
    background: #1a262e;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 0;
}

.checkbox-text {
    color: #e9edef;
    font-weight: 500;
}

/* Password Input */
.password-input-wrapper {
    display: flex;
    gap: 8px;
}

.password-input-wrapper input {
    flex: 1;
}

.toggle-password {
    background: #2a3942;
    border: 1px solid #313d45;
    border-radius: 8px;
    padding: 10px 14px;
    color: #8696a0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-password:hover {
    background: #313d45;
    color: #e9edef;
}

/* JSON Editor */
.json-editor {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    background: #0d1418;
}

/* Prompt Editor */
.form-group-prompt {
    background: #1a262e;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #313d45;
}

.prompt-editor-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-prompt-action {
    background: #2a3942;
    border: 1px solid #313d45;
    border-radius: 8px;
    padding: 8px 14px;
    color: #8696a0;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-prompt-action:hover {
    background: #00a884;
    color: white;
    border-color: #00a884;
}

.btn-prompt-action i {
    font-size: 14px;
}

.prompt-char-count {
    margin-left: auto;
    color: #8696a0;
    font-size: 12px;
}

.prompt-editor {
    min-height: 250px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    background: #0d1418;
    border: 1px solid #313d45;
    border-radius: 8px;
    padding: 16px;
    resize: vertical;
    white-space: pre-wrap;
}

.prompt-editor::placeholder {
    color: #4a5a66;
    opacity: 1;
}

.prompt-editor:focus {
    border-color: #00a884;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.2);
}

/* ─────────────────────────────────────────────────────────────────────────────
   5.3 Modal de Configuración de Plugin
   Modal específico para configurar plugins individuales
   ───────────────────────────────────────────────────────────────────────────── */

#pluginConfigModal {
    min-width: 800px;
    max-width: 1000px;
    width: 90vw;
}

#pluginConfigModal .modal-body {
    max-height: 75vh;
    padding: 24px;
    overflow-y: auto;
}

#pluginConfigModal .modal-header {
    background: linear-gradient(135deg, #2a3942, #1f2c34);
    padding: 18px 24px;
}

#pluginConfigModal .modal-header h3 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

#pluginConfigModal .modal-header h3 i {
    color: #00a884;
}

#pluginConfigModal .modal-footer {
    padding: 18px 24px;
}

/* Form del plugin más espaciado */
.plugin-config-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.plugin-config-form .config-section {
    margin-bottom: 0;
}

/* Textarea más grandes en el modal de config */
#pluginConfigModal textarea {
    min-height: 100px;
}

#pluginConfigModal .prompt-editor {
    min-height: 300px;
}

/* Scrollbar personalizado para el modal */
#pluginConfigModal .modal-body::-webkit-scrollbar {
    width: 8px;
}

#pluginConfigModal .modal-body::-webkit-scrollbar-track {
    background: #1f2c34;
    border-radius: 4px;
}

#pluginConfigModal .modal-body::-webkit-scrollbar-thumb {
    background: #3a4a54;
    border-radius: 4px;
}

#pluginConfigModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #4a5a64;
}

/* Responsive para móviles */
@media (max-width: 900px) {
    #pluginConfigModal {
        min-width: unset;
        width: 95vw;
        max-width: 95vw;
    }
    
    #pluginConfigModal .modal-body {
        max-height: 70vh;
        padding: 16px;
    }
}

/* No Config Message */
.no-config {
    color: #8696a0;
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
}

.section-description {
    color: #8696a0;
    font-size: 13px;
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #e9edef;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #00a884;
}

