/* Blog Dynamic Styles for /blogs.html */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    text-align: center;
    color: var(--primary-color, #ff6b6b);
}

.loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color, #ff6b6b);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* News Block Animations */
.news-block_one {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-block_one.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.news-block_one.show {
    opacity: 1;
    transform: translateY(0);
}

.news-block_one.hovered {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* News Block Image Effects */
.news-block_one-image {
    transition: all 0.4s ease;
    overflow: hidden;
}

.news-block_one-image img {
    transition: transform 0.4s ease;
}

.news-block_one-image.zoom-in img {
    transform: scale(1.05);
}

/* Category Button Enhancements */
.codepro-custom-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.codepro-custom-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.codepro-custom-btn:hover::before {
    left: 100%;
}

.codepro-custom-btn.active {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Search Input Enhancements */
.searchInput {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.searchInput:focus {
    border-color: var(--primary-color, #ff6b6b);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
    transform: translateY(-1px);
}

/* Alert Styles */
.alert {
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideInDown 0.5s ease;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #363;
    border: 1px solid #cfc;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pagination Enhancements */
.pagination {
    margin: 2rem 0;
}

.page-item {
    margin: 0 0.25rem;
}

.page-link {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color, #e0e0e0);
    color: var(--text-secondary, #666);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: white;
}

.page-link:hover {
    background: var(--primary-color, #ff6b6b);
    color: white;
    border-color: var(--primary-color, #ff6b6b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.page-item.active .page-link {
    background: var(--primary-color, #ff6b6b);
    color: white;
    border-color: var(--primary-color, #ff6b6b);
}

/* Featured Articles Carousel Enhancements */
.owl-carousel .owl-item {
    transition: all 0.3s ease;
}

.owl-carousel .owl-item.animate-in {
    transform: scale(1.02);
}

/* Content Grid Enhancements */
.content {
    transition: all 0.3s ease;
}

.content.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Stagger Animation for Grid Items */
.news-block_one:nth-child(1) { animation-delay: 0.1s; }
.news-block_one:nth-child(2) { animation-delay: 0.2s; }
.news-block_one:nth-child(3) { animation-delay: 0.3s; }
.news-block_one:nth-child(4) { animation-delay: 0.4s; }
.news-block_one:nth-child(5) { animation-delay: 0.5s; }
.news-block_one:nth-child(6) { animation-delay: 0.6s; }
.news-block_one:nth-child(7) { animation-delay: 0.7s; }
.news-block_one:nth-child(8) { animation-delay: 0.8s; }
.news-block_one:nth-child(9) { animation-delay: 0.9s; }
.news-block_one:nth-child(10) { animation-delay: 1.0s; }
.news-block_one:nth-child(11) { animation-delay: 1.1s; }
.news-block_one:nth-child(12) { animation-delay: 1.2s; }

/* Load More Button */
.btn-load-more {
    display: block;
    margin: 2rem auto;
    padding: 1rem 2rem;
    background: white;
    color: var(--primary-color, #ff6b6b);
    border: 2px solid var(--primary-color, #ff6b6b);
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-load-more:hover {
    background: var(--primary-color, #ff6b6b);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.btn-load-more:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .loading-overlay {
        background: rgba(255, 255, 255, 0.95);
    }
    
    .news-block_one {
        margin-bottom: 1rem;
    }
    
    .codepro-custom-btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn-load-more {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    /* Reduce animation delays on mobile */
    .news-block_one:nth-child(n) { 
        animation-delay: 0.05s; 
    }
}

@media (max-width: 576px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-item {
        margin: 0.125rem;
    }
    
    .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Smooth transitions for filter changes */
.news-block_one.filter-hide {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.news-block_one.filter-show {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
}

/* Enhanced hover effects */
.news-block_one-inner {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.news-block_one:hover .news-block_one-inner {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Loading skeleton animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.news-block_one.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    height: 300px;
    border-radius: 12px;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.codepro-custom-btn:focus,
.page-link:focus,
.searchInput:focus,
.btn-load-more:focus {
    outline: 2px solid var(--primary-color, #ff6b6b);
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner .spinner {
        animation: none;
    }
}
