/**
 * Content Paginator CSS v2.1
 * Beautiful, animated styling with customization options
 */

/* Main paginator container */
.content-paginator {
    margin: 30px 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    position: relative;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Single content without pagination */
.content-paginator-single {
    margin: 20px 0;
}

/* Individual page content */
.paginator-page {
    min-height: 120px;
    margin-bottom: 0;
    padding: 25px 30px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(10px);
}

.paginator-page.active {
    opacity: 1;
    transform: translateY(0);
}

.paginator-page p:last-child {
    margin-bottom: 0;
}

.paginator-page h1,
.paginator-page h2,
.paginator-page h3,
.paginator-page h4,
.paginator-page h5,
.paginator-page h6 {
    color: #2c3e50;
    margin-top: 0;
}

/* Navigation controls container */
.paginator-controls {
    display: flex;
    align-items: center;
    margin-top: 0;
    padding: 20px 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.paginator-controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3498db, transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Alignment options */
.paginator-controls.align-left {
    justify-content: flex-start;
}

.paginator-controls.align-center {
    justify-content: center;
}

.paginator-controls.align-right {
    justify-content: flex-end;
}

.paginator-controls.align-space-between {
    justify-content: space-between;
}

/* Page info text */
.paginator-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    padding: 8px 16px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    transition: all 0.3s ease;
    order: 2;
}

.paginator-controls.align-center .paginator-info {
    order: 0;
}

.paginator-info:hover {
    background: rgba(52, 152, 219, 0.15);
    transform: translateY(-1px);
}

.paginator-info .current-page {
    font-weight: 700;
    color: #3498db;
    font-size: 16px;
}

.paginator-info .total-pages {
    font-weight: 700;
    color: #2c3e50;
}

/* Navigation buttons */
.paginator-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transform: translateY(0);
    opacity: 0;
    animation: buttonSlideIn 0.5s ease forwards;
}

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

.paginator-btn.animate-in {
    animation: buttonBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes buttonBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(20px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.paginator-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
}

.paginator-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.paginator-btn:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3), 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Previous button specific styling */
.paginator-prev {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
    order: 1;
}

.paginator-prev:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
    box-shadow: 0 8px 25px rgba(149, 165, 166, 0.4);
}

.paginator-prev:focus {
    box-shadow: 0 0 0 3px rgba(149, 165, 166, 0.3), 0 4px 15px rgba(149, 165, 166, 0.3);
}

/* Next button */
.paginator-next {
    order: 3;
}

/* Button ripple effect */
.paginator-btn {
    overflow: hidden;
}

.paginator-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Button loading state */
.paginator-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.paginator-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button icons (optional) */
.paginator-btn::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 0;
    transition: all 0.3s ease;
}

.paginator-prev::before {
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-right: 6px solid currentColor;
    margin-right: 8px;
}

.paginator-next::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid currentColor;
    margin-left: 8px;
}

/* Responsive design */
@media (max-width: 768px) {
    .content-paginator {
        margin: 20px 0;
        border-radius: 8px;
    }
    
    .paginator-page {
        padding: 20px;
    }
    
    .paginator-controls {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }
    
    .paginator-controls.align-left,
    .paginator-controls.align-right,
    .paginator-controls.align-space-between {
        justify-content: center;
    }
    
    .paginator-btn {
        min-width: 140px;
        padding: 14px 28px;
        font-size: 15px;
    }
    
    .paginator-info {
        order: -1;
        margin-bottom: 5px;
    }
    
    .paginator-prev,
    .paginator-next {
        order: 0;
    }
}

@media (max-width: 480px) {
    .content-paginator {
        margin: 15px 0;
    }
    
    .paginator-page {
        padding: 15px;
    }
    
    .paginator-controls {
        padding: 15px;
        gap: 12px;
    }
    
    .paginator-btn {
        width: 100%;
        max-width: 200px;
        margin: 3px 0;
        padding: 16px 32px;
        font-size: 16px;
    }
    
    .paginator-info {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .content-paginator {
        color: #e1e5e9;
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    }
    
    .paginator-controls {
        background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .paginator-info {
        color: #bbb;
        background: rgba(52, 152, 219, 0.2);
        border-color: rgba(52, 152, 219, 0.3);
    }
    
    .paginator-info .current-page,
    .paginator-info .total-pages {
        color: #fff;
    }
    
    .paginator-page h1,
    .paginator-page h2,
    .paginator-page h3,
    .paginator-page h4,
    .paginator-page h5,
    .paginator-page h6 {
        color: #ecf0f1;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .content-paginator {
        border: 2px solid #000;
    }
    
    .paginator-btn {
        border: 2px solid #000;
        background: #000;
        color: #fff;
    }
    
    .paginator-btn:hover {
        background: #333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .paginator-page,
    .paginator-btn,
    .paginator-info {
        transition: none;
        animation: none;
    }
    
    .paginator-controls::before {
        animation: none;
    }
}

/* Focus styles for keyboard navigation */
.content-paginator:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
    border-radius: 12px;
}

/* Print styles */
@media print {
    .paginator-controls {
        display: none;
    }
    
    .paginator-page {
        display: block !important;
        opacity: 1 !important;
        page-break-inside: avoid;
        margin-bottom: 30px;
        padding: 0;
        background: none;
        box-shadow: none;
    }
    
    .content-paginator {
        background: none;
        box-shadow: none;
        margin: 0;
    }
    
    .paginator-page:not(:last-child)::after {
        content: "";
        display: block;
        height: 1px;
        background: #ccc;
        margin: 20px 0;
    }
}

/* Custom scrollbar for webkit browsers */
.content-paginator::-webkit-scrollbar {
    width: 6px;
}

.content-paginator::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.content-paginator::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
}

.content-paginator::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Pulse animation for page info */
.paginator-info {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

/* Hover effect for the entire paginator */
.content-paginator:hover {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Loading state for pages */
.paginator-page.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.paginator-page.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

