/**
 * Licitações Plugin CSS - Versão Sem Modal
 * Autor: Douglas Santos (Reimplementado por Manus AI)
 * Versão: 3.0
 * 
 * Esta versão remove completamente o modal e utiliza seções na mesma página
 * para exibir os detalhes das licitações.
 */

/* Container principal */
.licitacoes-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    position: relative;
    z-index: 1;
}

/* Seções principais */
.licitacoes-section {
    width: 100%;
    min-height: 400px;
}

/* Cards de licitações */
.licitacao-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.licitacao-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.licitacao-card:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.licitacao-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.licitacao-card:hover::before {
    transform: scaleX(1);
}

.licitacao-card .card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.licitacao-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    margin-bottom: 1rem;
    min-height: 2.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
}

/* Filtros */
.card .card-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

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

.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Botões */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    transform: translateY(-1px);
}

/* Botão voltar específico */
#back-to-list-btn {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

#back-to-list-btn:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

/* Loading spinner */
#loading-spinner,
#details-loading-spinner {
    padding: 3rem 0;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Error message */
#error-message,
#details-error-message {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15);
}

/* Results info */
.results-info {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

/* Paginação */
.pagination {
    margin-top: 2rem;
}

.page-link {
    color: #007bff;
    border-color: #dee2e6;
    border-radius: 6px;
    margin: 0 2px;
    transition: all 0.2s ease;
}

.page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

.page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
}

/* Seção de detalhes */
#licitacao-details-view {
    background-color: #f8f9fa;
    min-height: 100vh;
    padding-bottom: 2rem;
}

#licitacao-details-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

#licitacao-details-content .card-body {
    padding: 2rem;
}

/* Cabeçalho da seção de detalhes */
#details-title {
    color: #2c3e50;
    font-weight: 600;
}

/* Tabelas nos detalhes */
.table-borderless td {
    border: none;
    padding: 0.5rem 0;
}

.table-borderless td:first-child {
    width: 30%;
    color: #6c757d;
    font-weight: 500;
}

/* Lista de documentos */
.list-group-item {
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin-bottom: 0.5rem;
}

.list-group-item:last-child {
    margin-bottom: 0;
}

/* Seções de conteúdo nos detalhes */
.border.p-3.bg-light {
    background-color: #f8f9fa !important;
    border-radius: 6px;
    border: 1px solid #e9ecef !important;
    word-wrap: break-word;
    line-height: 1.6;
}

/* Responsividade */
@media (max-width: 768px) {
    .licitacao-card .card-body {
        padding: 1rem;
    }
    
    .licitacao-card-title {
        font-size: 1rem;
        min-height: 2.4rem;
    }
    
    #licitacao-details-content .card-body {
        padding: 1.5rem;
    }
    
    .table-borderless td:first-child {
        width: 40%;
    }
    
    #back-to-list-btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    #details-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-item {
        margin: 2px;
    }
    
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    #licitacao-details-content .card-body {
        padding: 1rem;
    }
    
    #back-to-list-btn {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    #details-title {
        font-size: 1.25rem;
        text-align: center;
    }
    
    .d-flex.align-items-center {
        flex-direction: column !important;
        align-items: stretch !important;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.licitacao-card {
    animation: fadeIn 0.3s ease-out;
}

/* Transições suaves entre seções */
.licitacoes-section {
    transition: opacity 0.3s ease-in-out;
}

/* Estados de foco para acessibilidade */
.licitacao-card:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.btn:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}

/* Melhorias de contraste */
.text-muted {
    color: #6c757d !important;
}

.alert-heading {
    color: inherit;
    font-weight: 600;
}

/* Ícones */
.fas {
    margin-right: 0.25rem;
}

/* Scrollbar customizada para seções com scroll */
.licitacoes-section::-webkit-scrollbar {
    width: 6px;
}

.licitacoes-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.licitacoes-section::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.licitacoes-section::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Estilo para quando uma seção está oculta */
.licitacoes-section[style*="display: none"] {
    display: none !important;
}

/* Garantir que as seções ocupem toda a largura disponível */
#licitacoes-list-view,
#licitacao-details-view {
    width: 100%;
}

/* Estilo especial para o cabeçalho dos detalhes */
.d-flex.align-items-center {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

/* Hover effect para links de download */
.list-group-item a.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

