/* =========================
   ESTILOS PARA PAGINAÇÃO DE ESTATÍSTICAS
   ========================= */

/* Container da paginação */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Estilização da paginação */
.pagination {
    margin-bottom: 0;
    gap: 0.25rem;
}

.pagination .page-item {
    margin: 0 0.1rem;
}

.pagination .page-link {
    color: #007bb8;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pagination .page-link:hover {
    color: #0056b3;
    background-color: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination .page-item.active .page-link {
    background-color: #007bb8;
    border-color: #007bb8;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 123, 184, 0.3);
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
    font-weight: 600;
}

/* Estados de carregamento */
.pagination-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.pagination-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bb8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsividade */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .pagination-info {
        order: 1;
        margin-bottom: 0.5rem;
    }
    
    .pagination-wrapper {
        order: 2;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .pagination .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
        min-width: 35px;
        text-align: center;
    }
    
    /* Simplificar paginação no mobile */
    .pagination .page-item:not(.page-item:first-child):not(.page-item:last-child):not(.active) {
        display: none;
    }
    
    /* Mostrar apenas alguns links próximos à página atual */
    .pagination .page-item.active ~ .page-item:nth-child(-n+2),
    .pagination .page-item.active ~ .page-item:nth-last-child(-n+2) {
        display: block;
    }
}

@media (max-width: 576px) {
    .pagination-info {
        font-size: 0.8rem;
    }
    
    .pagination .page-link {
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
        min-width: 30px;
    }
    
    /* Mobile: mostrar apenas anterior, atual e próximo */
    .pagination .page-item:not(.page-item:first-child):not(.page-item:last-child):not(.active):not(.active + .page-item):not(.page-item + .active) {
        display: none;
    }
}

/* Melhorias visuais para tabela */
.meugr-estatisticas-table {
    border-collapse: separate;
    border-spacing: 0;
}

.meugr-estatisticas-table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

.meugr-estatisticas-table tbody tr {
    transition: all 0.2s ease;
}

.meugr-estatisticas-table tbody tr:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.meugr-estatisticas-table tbody tr.table-active {
    background-color: rgba(0, 123, 184, 0.1);
    border-left: 3px solid #007bb8;
}

.meugr-estatisticas-table tbody tr.table-active:hover {
    background-color: rgba(0, 123, 184, 0.15);
}

/* Estados de feedback para ações */
.btn-outline-primary.dropdown-toggle.has-selected {
    background-color: #007bb8;
    color: white;
    border-color: #007bb8;
}

.btn-outline-primary.dropdown-toggle.has-selected:after {
    content: ' (' attr(data-count) ')';
    font-weight: bold;
}

/* Animações suaves */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading overlay para ações */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-size: 1.1rem;
    font-weight: 500;
    color: #007bb8;
}

.loading-overlay i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Melhorias para botões de ação */
.meugr-btn-acao {
    transition: all 0.2s ease;
    margin: 0.1rem;
}

.meugr-btn-acao:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Badges melhorados */
.badge {
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Responsividade para colunas da tabela */
@media (max-width: 992px) {
    .meugr-col-content {
        font-size: 0.875rem;
    }
    
    .meugr-btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .table-responsive {
        border: none;
        margin: 0 -15px;
    }
    
    .meugr-col-nome {
        min-width: 180px;
    }
    
    .meugr-col-content {
        min-width: 120px;
        font-size: 0.8rem;
    }
    
    .meugr-col-acoes {
        min-width: 140px;
    }
    
    .meugr-col-checkbox {
        width: 40px;
    }
}

/* Print styles */
@media print {
    .pagination-container,
    .pagination-wrapper,
    .meugr-col-acoes,
    .meugr-col-checkbox,
    .btn-toolbar,
    .dropdown {
        display: none !important;
    }
    
    .meugr-estatisticas-table {
        font-size: 0.8rem;
    }
    
    .card {
        border: none;
        box-shadow: none;
    }
}