/* Global Pagination Styles */

/* Pagination Container */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--history-bg-white);
    border-radius: 12px;
    border: 1px solid var(--history-border);
    flex-wrap: wrap;
    gap: 16px;
}

/* Pagination Info */
.pagination-info {
    font-size: 0.9375rem;
    color: var(--history-text-secondary);
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    align-items: center;
    height: 36px;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Pagination Button Base */
.pagination-btn {
    padding: 8px 12px;
    min-width: 36px;
    height: 36px;
    background: #667eea;
    border: 1px solid #667eea;
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.pagination-btn:hover:not(:disabled) {
    background: #5a67d8;
    border-color: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Active Page Button */
.pagination-btn.active {
    background: #4c51bf;
    color: white;
    border-color: #4c51bf;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.pagination-btn.active:hover {
    background: #434190;
    border-color: #434190;
    color: white;
}

/* Previous/Next Buttons */
.pagination-prev,
.pagination-next {
    font-size: 1.125rem;
    padding: 8px 14px;
}

/* Page Numbers Container */
.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Ellipsis */
.pagination-ellipsis {
    padding: 0 8px;
    color: var(--history-text-secondary);
    font-weight: 500;
}

/* Page Size Selector */
.pagination-size {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9375rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    white-space: nowrap;
    height: 36px;
}

.pagination-size label {
    color: var(--history-text-secondary);
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    white-space: nowrap;
    line-height: 1;
    margin: 0;
}

.pagination-size select {
    padding: 6px 28px 6px 8px;
    border: 1px solid var(--history-border);
    border-radius: 6px;
    background: white;
    color: var(--history-text-primary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%234A5568' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-width: 50px;
    height: 32px;
    display: flex;
    align-items: center;
}

.pagination-size select:hover {
    border-color: var(--history-accent);
}

.pagination-size select:focus {
    outline: none;
    border-color: var(--history-accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Theme support */
body.theme .pagination-container {
    background: var(--history-bg-white);
}

body.theme .pagination-btn {
    background: #374151;
    border-color: #4a5568;
    color: white;
}

body.theme .pagination-btn:hover:not(:disabled) {
    background: #4b5563;
    border-color: var(--history-accent);
    color: white;
}

body.theme .pagination-btn.active {
    background: var(--history-accent);
    color: white;
    border-color: var(--history-accent);
}

body.theme .pagination-size select {
    background-color: #374151;
    border-color: #4a5568;
    color: var(--history-text-primary);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23E2E8F0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

body.theme .pagination-size select:hover {
    border-color: var(--history-accent);
}

/* Responsive Design */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .pagination-info {
        order: 2;
        font-size: 0.75rem;
        text-align: center;
    }
    
    .pagination-controls {
        order: 1;
        width: 100%;
        justify-content: center;
    }
    
    .pagination-size {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .pagination-btn {
        min-width: 32px;
        height: 32px;
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .pagination-prev,
    .pagination-next {
        font-size: 1rem;
        padding: 6px 12px;
    }
    
    /* Hide some page numbers on very small screens */
    @media (max-width: 400px) {
        .pagination-pages .pagination-page:not(.active):not(:first-child):not(:last-child) {
            display: none;
        }
        
        .pagination-ellipsis {
            display: none;
        }
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pagination-container {
    animation: fadeIn 0.3s ease-out;
}