/* ============================================================
   VECTOREXEC - BOTS (UNIFICADO)
   ============================================================ */

/* ============================================================
   HEADER
   ============================================================ */

.app-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #0D47A1;
}

.main-nav {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #0D47A1;
}

.nav-link.active {
    color: #0D47A1;
    border-bottom-color: #0D47A1;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.username {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

.btn-logout {
    padding: 6px 14px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-logout:hover {
    background: #c53030;
}

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
}

.page-header .subtitle {
    font-size: 14px;
    color: #718096;
}

.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #0D47A1 0%, #1565C0 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3);
}

.btn-secondary {
    padding: 8px 16px;
    background: #e2e8f0;
    color: #2d3748;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-danger {
    padding: 8px 16px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.btn-danger:hover {
    background: #c53030;
}

/* ============================================================
   TABLA
   ============================================================ */

.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f4f8;
    color: #2d3748;
}

tbody tr:hover {
    background: #f7fafc;
}

.text-center {
    text-align: center;
}

/* ============================================================
   ESTADOS
   ============================================================ */

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-running {
    background: #c6f6d5;
    color: #276749;
}

.status-stopped {
    background: #fed7d7;
    color: #9b2c2c;
}

.status-paused {
    background: #feebc8;
    color: #9c4221;
}

.status-error {
    background: #fed7d7;
    color: #9b2c2c;
}

.status-disabled {
    background: #e2e8f0;
    color: #4a5568;
}

/* ============================================================
   ACCIONES
   ============================================================ */

.actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-icon {
    padding: 4px 8px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s ease;
}

.btn-icon:hover {
    background: #edf2f7;
}

.btn-icon.delete:hover {
    background: #fed7d7;
}

.btn-icon.start:hover {
    background: #c6f6d5;
}

.btn-icon.stop:hover {
    background: #fed7d7;
}

/* ============================================================
   MODAL (UNIFICADO)
   ============================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 620px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #1a202c;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #a0aec0;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #e53e3e;
}

.delete-modal p {
    margin: 12px 0;
    font-size: 15px;
    color: #2d3748;
}

.text-danger {
    color: #e53e3e;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ============================================================
   FORMULARIO (UNIFICADO)
   ============================================================ */

#botForm .form-group {
    margin-bottom: 16px;
}

#botForm label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

#botForm input,
#botForm select,
#botForm textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

#botForm input:focus,
#botForm select:focus,
#botForm textarea:focus {
    border-color: #0D47A1;
    outline: none;
}

#botForm select[multiple] {
    min-height: 80px;
}

#botForm textarea {
    resize: vertical;
    min-height: 60px;
}

#botForm small {
    display: block;
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ============================================================
   SECCIONES DEL FORMULARIO
   ============================================================ */

.form-section {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.form-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 12px;
}

.section-description {
    font-size: 13px;
    color: #718096;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ============================================================
   LISTA DE ESTRATEGIAS
   ============================================================ */

.strategies-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.strategy-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s ease;
}

.strategy-item:hover {
    border-color: #0D47A1;
}

.strategy-priority {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 40px;
}

.strategy-priority .priority-label {
    font-size: 11px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
}

.strategy-priority .priority-number {
    font-size: 18px;
    font-weight: 700;
    color: #0D47A1;
}

.strategy-select {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
}

.strategy-select:focus {
    border-color: #0D47A1;
    outline: none;
}

.strategy-actions {
    display: flex;
    gap: 4px;
}

.strategy-actions .btn-icon {
    padding: 6px 10px;
    font-size: 14px;
}

.strategy-actions .btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================================
   BOTÓN AGREGAR ESTRATEGIA
   ============================================================ */

.btn-add-strategy {
    width: 100%;
    padding: 12px;
    background: white;
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-add-strategy:hover {
    border-color: #0D47A1;
    color: #0D47A1;
    background: #ebf8ff;
}

.btn-add-strategy:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   INFORMACIÓN DEL LÍMITE
   ============================================================ */

.strategy-limit-info {
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    color: #718096;
}

/* ============================================================
   ESTRATEGIAS EN LA TABLA
   ============================================================ */

.strategies-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.strategy-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: #ebf8ff;
    color: #2b6cb0;
    border: 1px solid #90cdf4;
}

.strategy-badge.priority-1 {
    background: #c6f6d5;
    color: #276749;
    border-color: #9ae6b4;
}

.strategy-badge.priority-2 {
    background: #fefcbf;
    color: #975a16;
    border-color: #f6e05e;
}

.strategy-badge.priority-3 {
    background: #fed7d7;
    color: #9b2c2c;
    border-color: #feb2b2;
}

/* ============================================================
   MENSAJES
   ============================================================ */

.message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    margin-bottom: 16px;
}

.message.show {
    display: block;
}

.message.error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.message.success {
    background: #f0fff4;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.message.info {
    background: #ebf8ff;
    color: #2b6cb0;
    border: 1px solid #90cdf4;
}

/* ============================================================
   ANIMACIONES
   ============================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
        gap: 8px;
    }

    .main-nav {
        flex-wrap: wrap;
        gap: 12px;
    }

    .user-menu {
        margin-left: auto;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 8px 10px;
    }

    .modal-content {
        padding: 20px;
        margin: 10px;
    }

    .modal-large {
        max-width: 95%;
    }

    .actions {
        flex-direction: column;
        gap: 4px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .strategy-item {
        flex-direction: column;
        align-items: stretch;
    }

    .strategy-priority {
        flex-direction: row;
        justify-content: space-between;
    }

    .strategy-actions {
        justify-content: flex-end;
    }
}
