/**
 * CSS para Sistema de Paginação Otimizada
 * Design responsivo e performance otimizada
 */

.pagination-container {
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-info {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    user-select: none;
}

.pagination-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
    transform: translateY(-1px);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8fafc;
}

.pagination-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.pagination-numbers {
    display: flex;
    gap: 0.25rem;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-size select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #475569;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-size select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: #3b82f6;
    font-weight: 500;
}

.loading-spinner i {
    font-size: 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Data Container */
.data-container {
    position: relative;
    min-height: 200px;
}

.data-item {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.data-item:hover {
    background: #f8fafc;
}

.data-item:last-child {
    border-bottom: none;
}

/* Error Message */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: #dc2626;
    gap: 1rem;
}

.error-message i {
    font-size: 2rem;
    opacity: 0.7;
}

.error-message span {
    font-size: 1.125rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pagination-wrapper {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .pagination-info {
        order: 3;
        text-align: center;
    }
    
    .pagination-controls {
        order: 1;
        justify-content: center;
    }
    
    .pagination-size {
        order: 2;
        justify-content: center;
    }
    
    .pagination-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .pagination-numbers {
        gap: 0.125rem;
    }
    
    .pagination-size select {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .pagination-wrapper {
        padding: 0.75rem;
    }
    
    .pagination-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .pagination-info {
        font-size: 0.8rem;
    }
    
    .data-item {
        padding: 0.75rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .pagination-container {
        background: #1e293b;
        border-color: #334155;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .pagination-btn {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }
    
    .pagination-btn:hover:not(:disabled) {
        background: #475569;
        border-color: #64748b;
        color: #e2e8f0;
    }
    
    .pagination-btn:disabled {
        background: #1e293b;
        color: #64748b;
    }
    
    .pagination-size select {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }
    
    .pagination-info {
        color: #94a3b8;
    }
    
    .data-item {
        border-color: #334155;
    }
    
    .data-item:hover {
        background: #334155;
    }
    
    .loading-overlay {
        background: rgba(30, 41, 59, 0.9);
    }
}

/* Animações suaves */
.pagination-container {
    animation: fadeIn 0.3s ease;
}

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

/* Otimizações de performance */
.pagination-btn,
.data-item {
    will-change: transform;
}

.pagination-btn:hover,
.data-item:hover {
    transform: translateZ(0); /* Force hardware acceleration */
}

/* Acessibilidade */
.pagination-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.pagination-size select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Estados de carregamento */
.data-container.loading {
    pointer-events: none;
    opacity: 0.7;
}

.pagination-controls.loading .pagination-btn {
    pointer-events: none;
    opacity: 0.5;
}