/* Custom styles for Process Map */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

html {
    height: 100%;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 56px; /* Compensar altura da navbar fixa */
    padding-bottom: 150px; /* Compensar altura do footer fixo */
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1040; /* Garantir que fique acima de outros elementos */
}

/* Dropdowns - garantir que fiquem acima de alertas e outros elementos */
.dropdown-menu {
    z-index: 1050 !important; /* Acima da navbar e alertas */
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

main {
    flex: 1 0 auto;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    border-top: 1px solid #ddd;
}

/* Cards */
.card {
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: 1px solid #e0e0e0;
}

/* Badges */
.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1010; /* Abaixo dos dropdowns */
}

/* Tabs */
.nav-tabs .nav-link {
    color: #495057;
    border: none;
    border-bottom: 2px solid transparent;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom-color: var(--primary-color);
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* List groups */
.list-group-item {
    border: 1px solid #e0e0e0;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
}

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    color: #495057;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Forms */
.form-control,
.form-select {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    transition: border-color 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.5rem;
}

/* Pagination */
.pagination {
    margin-top: 2rem;
}

.page-link {
    color: var(--primary-color);
}

.page-link:hover {
    color: darken(var(--primary-color), 10%);
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding-left: 0;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* Utility classes */
.text-muted {
    color: #6c757d !important;
}

.bg-light {
    background-color: #f8f9fa !important;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .table {
        font-size: 0.875rem;
    }

    main {
        min-height: auto;
    }
}

/* Border left utility classes */
.border-left-danger {
    border-left: 4px solid var(--danger-color) !important;
}

.border-left-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.border-left-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-left-info {
    border-left: 4px solid var(--info-color) !important;
}
/* Dynamic Table Styles */
.dynamic-table {
    width: 100%;
    margin-bottom: 1rem;
    table-layout: fixed !important;
}

.dynamic-table thead {
    background-color: #f8f9fa;
}

.dynamic-table thead th {
    white-space: nowrap;
}

.dynamic-table tbody tr {
    border-bottom: 1px solid #ddd;
}

.dynamic-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Garantir que as colunas nas tabelas de eventos tenham larguras fixas */
/* Coluna 1: Evento - 25% da largura total */
#input-events-table th:nth-child(1),
#input-events-table td:nth-child(1),
#output-events-table th:nth-child(1),
#output-events-table td:nth-child(1) {
    width: 25% !important;
}

/* Coluna 2: Informações Recebidas/Enviadas - ocupa o resto do espaço disponível */
#input-events-table th:nth-child(2),
#input-events-table td:nth-child(2),
#output-events-table th:nth-child(2),
#output-events-table td:nth-child(2) {
    width: auto !important;
}

/* Coluna 3: Ações - largura fixa */
#input-events-table th:nth-child(3),
#input-events-table td:nth-child(3),
#output-events-table th:nth-child(3),
#output-events-table td:nth-child(3) {
    width: 120px !important;
}

/* Tabelas de eventos na visualização do processo */
.process-events-table {
    table-layout: fixed !important;
}

.process-events-table th:nth-child(1),
.process-events-table td:nth-child(1) {
    width: 25% !important;
}

.process-events-table th:nth-child(2),
.process-events-table td:nth-child(2) {
    width: auto !important;
}

.dynamic-table input,
.dynamic-table textarea,
.dynamic-table select {
    font-size: 0.95rem;
}

.btn-row-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.table-inputs-row td {
    padding: 0.5rem;
    vertical-align: middle;
}

.table-inputs-row input,
.table-inputs-row textarea,
.table-inputs-row select {
    min-width: 100%;
}

.table-actions {
    white-space: nowrap;
}

.btn-row-action {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Fixed Action Bar for Forms */
.form-fixed-action-bar {
    position: fixed;
    top: 56px; /* Ficar abaixo da navbar fixa */
    left: 0;
    right: 0;
    z-index: 1020;
    background-color: #ffffff;
    border-bottom: 2px solid #e0e0e0;
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-fixed-action-bar .d-flex {
    max-width: 1140px; /* Container width */
    margin: 0 auto;
    padding: 0 15px;
}

.form-fixed-action-bar .btn {
    min-width: 100px;
}

/* Garantir que mensagens de validação apareçam acima da barra fixa */
.invalid-feedback {
    position: relative;
    z-index: 1030 !important; /* Maior que a barra de ação (1020) */
}

/* Adicionar espaço para a barra fixa nos formulários */
form .form-fixed-action-bar + .card {
    margin-top: 90px; /* Altura aproximada da barra de ação + margem */
}

/* Para o formulário com BPMN que tem a barra fora do form */
.form-fixed-action-bar + .card,
.card.mb-3:first-of-type {
    margin-top: 90px; /* Altura aproximada da barra de ação + margem */
}

@media (max-width: 768px) {
    body {
        padding-top: 56px; /* Manter o mesmo padding em mobile */
    }

    .form-fixed-action-bar {
        padding: 0.75rem 0;
        top: 56px; /* Manter abaixo da navbar em mobile */
    }

    .form-fixed-action-bar .btn {
        min-width: 80px;
        font-size: 0.875rem;
    }

    .form-fixed-action-bar .d-flex {
        padding: 0 12px;
    }
}

/* Risk Movement Modal Styles */
#riskMovementModal .destination-type-btn {
    transition: all 0.3s ease;
    height: 120px;
    border-width: 2px;
}

#riskMovementModal .destination-type-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

#riskMovementModal .destination-type-btn i {
    color: var(--primary-color);
}

#riskMovementModal .destination-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

#riskMovementModal .destination-item:hover:not(.disabled) {
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
}

#riskMovementModal .destination-item.disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.6;
}

#riskMovementModal #destinationSearch {
    border-width: 2px;
}

#riskMovementModal #destinationSearch:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#riskMovementModal .movement-step {
    min-height: 300px;
}

/* Toast notification styles */
.toast-container .toast {
    min-width: 300px;
}

.toast-container .bg-success {
    background-color: var(--success-color) !important;
}