﻿/* 1. Layout Principal e Helpers */

.b-config-container-main {
    min-height: 600px;
}

.b-config-container {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(207 47 47 / 22%), 0 8px 25px rgba(203 74 74 / 45%);
}

.text-center {
    text-align: center;
    justify-content: center;
}

/* 2. Grid Principal (Cabeçalho e Linhas) */
.b-config-list-header, .b-config-card-main {
    display: grid;
    grid-template-columns: 40px 1.5fr 1fr 1fr 100px 120px;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
}

.b-config-list-header {
    font-size: 1.5rem;
    font-weight: 600;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.b-config-card {
    border-bottom: 1px solid #eea1a1;
}

    .b-config-card:last-child {
        border-bottom: none;
    }

.b-config-card-main {
    font-size: 1.2rem;
    transition: background-color 0.2s ease;
}

    .b-config-card-main:hover {
        background-color: #ff00005c;
    }

/* 3. Células e Status Badge */
.b-config-status-cell {
    display: flex;
}

.b-config-status-badge {
    padding: 0.3em 0.8em;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 1rem;
}

    .b-config-status-badge.status-active {
        color: #155724;
        background-color: #d4edda;
    }

    .b-config-status-badge.status-inactive {
        background-color: #f8d7da;
        color: #721c24;
    }

/* 4. Ícone de Expansão */
.b-config-expand-cell {
    padding: 0;
    justify-content: center;
}

.b-config-expand-button {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.b-config-expand-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.b-config-expand-button:hover {
    background-color: #e9ecef;
    background-color: var(--primary-color, #E40E18);
}

.b-config-expand-button.expanded {
    background-color: var(--primary-color, #E40E18);
}

    .b-config-expand-button.expanded .b-config-expand-icon {
        transform: rotate(180deg);
        filter: brightness(0) invert(1);
    }

/* 5. Painel de Detalhes (Onde a mágica acontece) */
.b-config-details-wrapper {
    background-color: #f0f2f5;
    padding: 1rem;
}

.b-config-details-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.b-config-details-header {
    padding: 0.75rem 1.25rem;
    background-color: #f1f3f5;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
    font-size: 1.5rem;
}

/* ESTA É A CLASSE PRINCIPAL DA SUA SOLICITAÇÃO */
.b-config-detail-grid {
    background-color: #e2e4e7;
    display: flex;
    flex-wrap: wrap; /* Permite que os itens quebrem para a próxima linha */
    gap: 1.5rem; /* Espaçamento entre os itens */
    padding: 1.25rem;
}

.b-config-detail-item {
    /* Define que cada item tenta ocupar 50% do espaço (menos o gap) */
    flex: 0 1 calc(25% - 1.5rem);
    display: flex;
    flex-direction: column; /* Empilha o rótulo sobre o valor */
    gap: 0.25rem;
    min-width: 200px; /* Garante que não fiquem muito espremidos */
}
.b-config-detail-value > :last-child {
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.b-config-detail-label {
    font-size: 1.2rem;
    font-weight: 500;
}

.b-config-detail-value {
    font-size: 1.3rem;
    font-weight: 500;
    word-break: break-word;
    border: solid 2px #00000026;
    border-radius: 7px;
    padding: 0.5rem 0.4rem;
}

.b-config-detail-grid .b-config-detail-item:last-child .b-config-detail-value {
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background-color: transparent !important;
}


/* 6. Estilos Específicos para Detalhes (Opções Booleanas) */
.b-config-boolean-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.b-config-boolean-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.3rem;
}

.b-config-bool-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    padding: 2px;
}

    .b-config-bool-icon.true {
        background-color: #d4edda;
        color: #155724;
    }

    .b-config-bool-icon.false {
        background-color: #f8d7da;
        color: #721c24;
    }

/* 7. Paginação */
.b-config-pagination-footer {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background-color: #f8f9fa;
}

.b-config-pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.b-config-pagination-button {
    padding: 0.5rem 1rem;
    border: 1px solid #ced4da;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .b-config-pagination-button:hover:not(:disabled) {
        background-color: #e9ecef;
    }

    .b-config-pagination-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

@media (max-width: 992px) {

    /* Oculta o cabeçalho de desktop */
    .b-config-list-header {
        display: none;
    }

    /* 1. Container principal dos cards no mobile */
    .b-config-card-main {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between; /* Alinha itens nas linhas de 2 colunas */
        padding: 1rem;
        gap: 0.75rem 1.5rem;
        margin-bottom: 0.5rem;
        background-color: rgb(255, 255, 255);
        padding: 1rem 1.5rem;
        border-width: 3px;
        border-style: solid;
        border-color: rgba(0, 0, 0, 0.682);
        border-image: initial;
        border-radius: 8px;
    }

    /* 2. Estilo base para todas as células de dados */
    .b-config-cell {
        display: flex;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f1f3f5;
        flex-basis: 100%; 
        gap: 15px;
    }

        .b-config-cell::before {
            content: attr(data-label);
            font-weight: 600;
            min-width: 50px;
            color: #495057;
        }

        /* 3. LINHA DE CABEÇALHO: Botão à esquerda, Nome ao centro */

        /* Agrupa o botão e o nome na primeira ordem visual */
        .b-config-expand-cell,
        .b-config-cell[data-label="Nome"] {
            order: 1;
            flex-basis: auto; /* Deixa o tamanho ser definido pelo flex-grow/shrink */
            border-bottom: none;
            padding-bottom: 0.75rem;
            margin-bottom: 0.5rem;
            min-width: 100px;
        }

    /* Botão fica na esquerda e não estica */
    .b-config-expand-cell {
        flex-grow: 0;
        margin-left: -50px;
    }

    /* Nome ocupa o espaço restante e centraliza seu texto */
    .b-config-cell[data-label="Nome"] {
        flex-grow: 1;
        justify-content: center;
        font-size: 1.3rem;
        font-weight: 600;
    }

        /* Esconde o label "Nome:" do pseudo-elemento */
        .b-config-cell[data-label="Nome"]::before {
            display: none;
        }

    /* 4. LINHAS DE CONTEÚDO: Duas colunas */

    /* Primeira linha de conteúdo */
    .b-config-cell[data-label="Status"],
    .b-config-cell[data-label="Produto"] {
        order: 1; /* Segunda ordem visual */
        flex-basis: calc(50% - 0.75rem); /* Metade da largura - metade do gap */
    }

    /* Segunda linha de conteúdo */
    .b-config-cell[data-label="Pista"],
    .b-config-cell[data-label="Vagas"] {
        order: 2; /* Terceira ordem visual */
        flex-basis: calc(50% - 0.75rem); /* Metade da largura - metade do gap */
        border-bottom: none; /* Remove a borda da última linha */
    }

    /* Estilos restantes que já estavam corretos */
    .b-config-expand-button {
        background-color: #f1f3f5;
        border: 1px solid #ccc;
        border-radius: 50%;
        padding: 8px;
        width: 36px;
        height: 36px;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: background-color 0.2s ease;
        flex-shrink: 0;
    }

        .b-config-expand-button:hover {
            background-color: #e0e0e0;
        }

        .b-config-expand-button.expanded {
            background-color: var(--primary-color, #E40E18);
        }

            .b-config-expand-button.expanded .b-config-expand-icon {
                transform: rotate(180deg);
                filter: brightness(0) invert(1);
            }

    .b-config-expand-icon {
        width: 18px;
        height: 18px;
        transition: transform 0.3s ease;
    }

    .b-config-detail-item {
        flex-basis: 100%;
    }

    .b-config-card-main:hover {
        background-color: #fff;
    }

    .b-config-card {
        border-bottom: 1px solid #fff;
    }
}