/* Premium Category Posts Filter - Main Stylesheet */

/* ===== CSS VARIABLES ===== */
:root {
    --cpf-primary: #4361ee;
    --cpf-primary-dark: #3a56d4;
    --cpf-primary-light: #5a78ff;
    --cpf-accent: #f72585;
    --cpf-accent-dark: #d91c72;
    --cpf-gradient: linear-gradient(135deg, #4361ee 0%, #f72585 100%);
    --cpf-dark: #1e1e2f;
    --cpf-light: #f8f9fa;
    --cpf-gray: #6c757d;
    --cpf-border: #e9ecef;
    --cpf-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    --cpf-shadow-hover: 0 25px 50px rgba(67, 97, 238, 0.2);
    --cpf-transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --cpf-border-radius: 20px;
    --cpf-border-radius-sm: 12px;
}

/* ===== CONTAINER STYLES ===== */
.cpf-premium-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== FILTERS SECTION ===== */
.cpf-premium-filters {
    background: linear-gradient(145deg, #ffffff, #f8faff);
    border-radius: var(--cpf-border-radius);
    padding: 30px;
    margin-bottom: 50px;
    box-shadow: var(--cpf-shadow);
    border: 1px solid rgba(67, 97, 238, 0.1);
    position: relative;
    overflow: hidden;
}

.cpf-premium-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--cpf-gradient);
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.cpf-filters-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    position: relative;
    z-index: 2;
}

.cpf-filter-group {
    flex: 1 1 180px;
    position: relative;
}

.cpf-filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--cpf-dark);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpf-filter-group label .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--cpf-primary);
    animation: subtlePulse 2s infinite;
}

@keyframes subtlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.cpf-filter-select {
    width: 100%;
    padding: 14px 20px;
    padding-right: 40px;
    border: 2px solid var(--cpf-border);
    border-radius: var(--cpf-border-radius-sm);
    background: white;
    font-size: 14px;
    font-weight: 500;
    color: var(--cpf-dark);
    cursor: pointer;
    transition: var(--cpf-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234361ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

.cpf-filter-select:hover {
    border-color: var(--cpf-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.1);
}

.cpf-filter-select:focus {
    outline: none;
    border-color: var(--cpf-primary);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
}

.cpf-filter-select .count {
    color: var(--cpf-gray);
    font-size: 12px;
    margin-left: 5px;
}

.cpf-apply-btn {
    background: var(--cpf-gradient);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--cpf-border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--cpf-transition);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.3);
    height: 52px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.cpf-apply-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cpf-apply-btn:hover::before {
    width: 300px;
    height: 300px;
}

.cpf-apply-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(67, 97, 238, 0.4);
}

.cpf-apply-btn:active {
    transform: translateY(0);
}

/* ===== POSTS GRID ===== */
.cpf-posts-grid {
    display: grid;
    gap: 35px;
    margin-bottom: 50px;
}

/* Column layouts */
.cpf-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.cpf-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.cpf-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ===== PREMIUM CARD STYLES ===== */
.cpf-premium-card {
    background: white;
    border-radius: var(--cpf-border-radius);
    overflow: hidden;
    box-shadow: var(--cpf-shadow);
    transition: var(--cpf-transition);
    position: relative;
    border: 1px solid var(--cpf-border);
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: cardAppear 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cpf-premium-card:nth-child(1) { animation-delay: 0.1s; }
.cpf-premium-card:nth-child(2) { animation-delay: 0.2s; }
.cpf-premium-card:nth-child(3) { animation-delay: 0.3s; }
.cpf-premium-card:nth-child(4) { animation-delay: 0.4s; }
.cpf-premium-card:nth-child(5) { animation-delay: 0.5s; }
.cpf-premium-card:nth-child(6) { animation-delay: 0.6s; }
.cpf-premium-card:nth-child(7) { animation-delay: 0.7s; }
.cpf-premium-card:nth-child(8) { animation-delay: 0.8s; }
.cpf-premium-card:nth-child(9) { animation-delay: 0.9s; }

.cpf-premium-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--cpf-shadow-hover);
    border-color: transparent;
}

/* Card Media Section */
.cpf-card-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
    background: linear-gradient(45deg, #f3f4f6, #e5e7eb);
}

.cpf-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.cpf-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.45, 0.45, 0.95);
}

.cpf-premium-card:hover .cpf-card-media img {
    transform: scale(1.15) rotate(1deg);
}

/* Image Overlay */
.cpf-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(67, 97, 238, 0.9) 0%, 
        rgba(247, 37, 133, 0.9) 100%);
    opacity: 0;
    transition: var(--cpf-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.cpf-premium-card:hover .cpf-image-overlay {
    opacity: 1;
}

.cpf-read-more-icon {
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0) rotate(-180deg);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.cpf-premium-card:hover .cpf-read-more-icon {
    transform: scale(1) rotate(0);
}

.cpf-read-more-icon .dashicons {
    color: var(--cpf-primary);
    font-size: 30px;
    width: 30px;
    height: 30px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Category Badge */
.cpf-category-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--cpf-gradient);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    z-index: 10;
    transition: var(--cpf-transition);
    border: 2px solid rgba(255,255,255,0.3);
}

.cpf-category-badge:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
    color: white;
}

/* No Image Placeholder */
.cpf-no-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.cpf-no-image-content {
    text-align: center;
    color: white;
    transform: scale(1);
    transition: transform 0.3s;
}

.cpf-no-image:hover .cpf-no-image-content {
    transform: scale(1.1);
}

.cpf-no-image-content .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Card Content */
.cpf-card-content {
    padding: 30px 25px 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    position: relative;
    z-index: 2;
}

.cpf-meta-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--cpf-gray);
}

.cpf-meta-top span {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--cpf-light);
    padding: 6px 15px;
    border-radius: 40px;
    transition: var(--cpf-transition);
}

.cpf-meta-top span:hover {
    background: var(--cpf-primary);
    color: white;
    transform: translateY(-2px);
}

.cpf-meta-top span:hover .dashicons {
    color: white;
}

.cpf-meta-top .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--cpf-primary);
    transition: color 0.3s;
}

/* Card Title */
.cpf-card-title {
    margin: 0 0 15px;
    font-size: 1.4rem;
    line-height: 1.4;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}

.cpf-card-title a {
    color: var(--cpf-dark);
    text-decoration: none;
    transition: all 0.3s;
    background: linear-gradient(var(--cpf-primary), var(--cpf-primary));
    background-size: 0 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.4s, color 0.3s;
}

.cpf-card-title a:hover {
    color: var(--cpf-primary);
    background-size: 100% 2px;
}

/* Excerpt */
.cpf-card-excerpt {
    color: var(--cpf-gray);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 25px;
    flex: 1;
    position: relative;
    padding-left: 15px;
    border-left: 3px solid var(--cpf-primary);
}

/* Card Footer */
.cpf-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 20px;
    border-top: 2px solid var(--cpf-border);
}

/* Read More Button */
.cpf-read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: var(--cpf-primary);
    padding: 10px 0;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: var(--cpf-transition);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.cpf-read-more-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--cpf-gradient);
    transform: translateX(-100%);
    transition: transform 0.3s;
}

.cpf-read-more-btn:hover::before {
    transform: translateX(0);
}

.cpf-read-more-btn:hover {
    gap: 15px;
    color: var(--cpf-primary-dark);
}

.cpf-read-more-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    transition: transform 0.3s;
}

.cpf-read-more-btn:hover .dashicons {
    transform: translateX(5px);
}

/* Author */
.cpf-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cpf-author img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--cpf-primary-light);
    transition: var(--cpf-transition);
}

.cpf-premium-card:hover .cpf-author img {
    border-color: var(--cpf-accent);
    transform: scale(1.1);
}

.cpf-author-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--cpf-dark);
}

/* Modern Style Decoration */
.cpf-style-modern .cpf-premium-card {
    position: relative;
}

.cpf-card-decoration {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.cpf-decoration-circle {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: var(--cpf-gradient);
    opacity: 0.03;
    border-radius: 50%;
    transition: var(--cpf-transition);
}

.cpf-premium-card:hover .cpf-decoration-circle {
    transform: scale(1.5);
    opacity: 0.06;
}

.cpf-decoration-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--cpf-gradient);
    transform: scaleX(0);
    transition: transform 0.6s cubic-bezier(0.86, 0, 0.07, 1);
    transform-origin: left;
}

.cpf-premium-card:hover .cpf-decoration-line {
    transform: scaleX(1);
}

/* Classic Style */
.cpf-style-classic .cpf-premium-card {
    border-radius: 12px;
    border: 1px solid var(--cpf-border);
}

.cpf-style-classic .cpf-card-media {
    border-radius: 12px 12px 0 0;
}

/* Minimal Style */
.cpf-style-minimal .cpf-premium-card {
    box-shadow: none;
    border: 1px solid var(--cpf-border);
    border-radius: 16px;
    background: white;
}

.cpf-style-minimal .cpf-card-media {
    border-radius: 16px 16px 0 0;
}

.cpf-style-minimal .cpf-card-content {
    background: white;
}

/* ===== PAGINATION ===== */
.cpf-pagination {
    margin-top: 60px;
    text-align: center;
}

.cpf-pagination ul {
    display: inline-flex;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.cpf-pagination li {
    margin: 0;
}

.cpf-pagination a,
.cpf-pagination span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: white;
    border: 2px solid var(--cpf-border);
    border-radius: var(--cpf-border-radius-sm);
    color: var(--cpf-dark);
    text-decoration: none;
    font-weight: 600;
    transition: var(--cpf-transition);
    min-width: 50px;
    justify-content: center;
}

.cpf-pagination a:hover {
    background: var(--cpf-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.3);
}

.cpf-pagination .current {
    background: var(--cpf-gradient);
    color: white;
    border-color: transparent;
    font-weight: 700;
    transform: scale(1.05);
}

.cpf-pagination .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ===== LOADING OVERLAY ===== */
.cpf-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cpf-loader {
    text-align: center;
    transform: translateY(0);
    animation: loaderFloat 2s infinite;
}

@keyframes loaderFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.cpf-loader-circle {
    width: 80px;
    height: 80px;
    border: 5px solid var(--cpf-border);
    border-top: 5px solid var(--cpf-primary);
    border-right: 5px solid var(--cpf-accent);
    border-radius: 50%;
    margin: 0 auto 25px;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

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

.cpf-loader-text {
    color: var(--cpf-dark);
    font-weight: 600;
    font-size: 18px;
    background: var(--cpf-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

/* ===== NO RESULTS ===== */
.cpf-no-results {
    text-align: center;
    padding: 80px 30px;
    background: white;
    border-radius: var(--cpf-border-radius);
    box-shadow: var(--cpf-shadow);
    animation: slideUp 0.6s;
}

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

.cpf-no-results .dashicons {
    font-size: 80px;
    width: 80px;
    height: 80px;
    color: var(--cpf-primary);
    margin-bottom: 25px;
    animation: searchBounce 2s infinite;
}

@keyframes searchBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.cpf-no-results h3 {
    font-size: 28px;
    color: var(--cpf-dark);
    margin-bottom: 15px;
    font-weight: 700;
}

.cpf-no-results p {
    color: var(--cpf-gray);
    font-size: 16px;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .cpf-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .cpf-cols-3,
    .cpf-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cpf-card-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .cpf-filters-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    
    .cpf-filter-group {
        width: 100%;
    }
    
    .cpf-apply-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cpf-cols-2,
    .cpf-cols-3,
    .cpf-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .cpf-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .cpf-author {
        width: 100%;
        justify-content: flex-start;
    }
    
    .cpf-pagination ul {
        gap: 5px;
    }
    
    .cpf-pagination a,
    .cpf-pagination span {
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    .cpf-premium-container {
        padding: 20px 10px;
    }
    
    .cpf-premium-filters {
        padding: 20px;
    }
    
    .cpf-card-title {
        font-size: 1.2rem;
    }
    
    .cpf-meta-top {
        flex-direction: column;
        gap: 10px;
    }
    
    .cpf-meta-top span {
        width: fit-content;
    }
}

/* ===== HOVER EFFECTS ===== */
.cpf-premium-card {
    cursor: pointer;
}

.cpf-premium-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--cpf-border-radius);
    box-shadow: 0 0 0 2px transparent;
    transition: all 0.3s;
    pointer-events: none;
}

.cpf-premium-card:hover::after {
    box-shadow: 0 0 0 3px var(--cpf-primary);
}

/* Tooltip styles */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: var(--cpf-dark);
    color: white;
    font-size: 12px;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    pointer-events: none;
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Print styles */
@media print {
    .cpf-premium-filters,
    .cpf-pagination,
    .cpf-read-more-btn {
        display: none !important;
    }
    
    .cpf-premium-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
