/* ======================
   Blog Enhancement Styles
   Modern and Cool Blog Design
   ====================== */

/* Blog Card Enhanced Styles */
.blog-card {
    background: var(--color-white);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 30px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
    cursor: pointer;
    opacity: 1; /* Ensure card is always visible */
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(80, 201, 195, 0.1) 100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1;
}

.blog-card:hover {
    transform: translateY(-15px) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    opacity: 1 !important; /* Force opacity to stay at 1 */
}

.blog-card:hover::before {
    opacity: 1;
}

/* Blog Image Enhanced */
.blog-card .blog-img {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
}

.blog-card .blog-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(74, 144, 226, 0.3) 0%, rgba(80, 201, 195, 0.3) 100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.blog-card:hover .blog-img::after {
    opacity: 1;
}

.blog-card .blog-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: brightness(1);
}

.blog-card:hover .blog-img img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* Blog Content Enhanced */
.blog-card .blog-content {
    padding: 25px;
    position: relative;
    z-index: 3;
    background: var(--color-white);
}

/* Meta Card with Modern Design */
.blog-card .blog-content .blog-meta-card {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.blog-card .blog-content .blog-meta-card .blog-date,
.blog-card .blog-content .blog-meta-card .blog-meta {
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.blog-card:hover .blog-content .blog-meta-card .blog-date,
.blog-card:hover .blog-content .blog-meta-card .blog-meta {
    background: linear-gradient(135deg, #4a90e2 0%, #50c9c3 100%);
    color: white;
    transform: translateY(-2px);
}

.blog-card .blog-content .blog-meta-card .blog-date i,
.blog-card .blog-content .blog-meta-card .blog-meta i {
    margin-right: 6px;
    font-size: 12px;
}

/* Blog Title Enhanced */
.blog-card .blog-content .blog-title {
    margin-bottom: 15px;
}

.blog-card .blog-content .blog-title h4 {
    line-height: 1.4;
    margin-bottom: 0;
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.blog-card .blog-content .blog-title h4 a {
    color: inherit;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.blog-card:hover .blog-content .blog-title h4 a {
    color: #4a90e2;
    transform: translateX(5px);
}

/* Blog Excerpt */
.blog-card .blog-content .blog-excerpt {
    margin-bottom: 20px;
    min-height: 40px; /* Ensure consistent spacing even when no excerpt */
}

.blog-card .blog-content .blog-excerpt p {
    font-size: 14px;
    line-height: 1.6;
    color: #6c757d;
    margin-bottom: 0;
    transition: all 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card .blog-content .blog-excerpt p.no-excerpt {
    font-style: italic;
    opacity: 0.7;
    color: #9ca3af;
}

.blog-card:hover .blog-content .blog-excerpt p {
    color: #495057;
}

.blog-card:hover .blog-content .blog-excerpt p.no-excerpt {
    color: #6b7280;
}

/* When no excerpt is available */
.blog-card .blog-content .blog-title + .read-more-btn {
    margin-top: 40px; /* Add extra space when no excerpt */
}

/* Read More Button Enhanced */
.blog-card .blog-content .read-more-btn {
    margin-top: auto;
}

.blog-card .blog-content .read-more-btn a {
    font-size: 14px;
    font-weight: 600;
    color: #4a90e2;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.blog-card .blog-content .read-more-btn a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4a90e2 0%, #50c9c3 100%);
    transition: all 0.3s ease;
    z-index: -1;
}

.blog-card .blog-content .read-more-btn a:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

.blog-card .blog-content .read-more-btn a:hover::before {
    left: 0;
}

.blog-card .blog-content .read-more-btn a i {
    margin-left: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.blog-card .blog-content .read-more-btn a:hover i {
    transform: translateX(5px);
}

/* Blog Section Enhanced */
.blog-section .inner-section {
    position: relative;
}

.blog-section .inner-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(74, 144, 226, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(80, 201, 195, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(74, 144, 226, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.blog-card {
    animation: fadeInUp 0.6s ease forwards;
    animation-fill-mode: forwards; /* Keep final state */
}

.blog-card:nth-child(3n+1) { 
    animation: slideInLeft 0.6s ease forwards;
    animation-delay: 0.1s; 
}
.blog-card:nth-child(3n+2) { 
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.2s; 
}
.blog-card:nth-child(3n+3) { 
    animation: slideInRight 0.6s ease forwards;
    animation-delay: 0.3s; 
}

/* Floating Animation - Remove conflicting hover animation */
@keyframes subtleFloat {
    0%, 100% { transform: translateY(-15px); }
    50% { transform: translateY(-20px); }
}

.blog-card:hover {
    animation: subtleFloat 1.5s ease-in-out infinite !important;
}

/* Disable conflicting animations */
.blog-card.search-filtered {
    animation: none !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.blog-card.loaded {
    animation: none !important;
    opacity: 1 !important;
}

/* Empty State Enhanced */
.empty_card {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.empty_card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.empty_card .empty_img {
    margin-bottom: 20px;
}

.empty_card .empty_img img {
    max-width: 200px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.empty_card:hover .empty_img img {
    opacity: 1;
    transform: scale(1.05);
}

.empty_card h3 {
    color: #6c757d;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

/* Pagination Enhanced */
.pagination {
    justify-content: center;
    margin-top: 40px;
}

.pagination .page-link {
    border: none;
    background: #f8f9fa;
    color: #6c757d;
    margin: 0 3px;
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination .page-link:hover,
.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #4a90e2 0%, #50c9c3 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

/* Breadcrumb Enhanced */
.breadcrumb-section {
    position: relative;
    background: linear-gradient(135deg, #4a90e2 0%, #50c9c3 100%);
    overflow: hidden;
}

.breadcrumb-section::before {
    background: rgba(0, 0, 0, 0.2);
}

.breadcrumb-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.breadcrumb-section .breadcrumb-card h2 {
    font-size: 48px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .blog-card .blog-img {
        height: 200px;
    }
    
    .blog-card .blog-content {
        padding: 20px;
    }
    
    .blog-card .blog-content .blog-title h4 {
        font-size: 18px;
    }
    
    .blog-card .blog-content .blog-meta-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .breadcrumb-section .breadcrumb-card h2 {
        font-size: 36px;
    }
    
    .blog-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .blog-search .search-box {
        max-width: 100%;
    }
    
    .blog-filter-tabs {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .blog-card .blog-img {
        height: 180px;
    }
    
    .blog-card .blog-content {
        padding: 15px;
    }
    
    .breadcrumb-section .breadcrumb-card h2 {
        font-size: 28px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Loading Skeleton Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

.blog-card.loading {
    pointer-events: none;
}

.blog-card.loading .blog-img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

.blog-card.loading .blog-content .blog-title h4,
.blog-card.loading .blog-content .blog-excerpt p,
.blog-card.loading .blog-content .blog-meta-card div {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    color: transparent;
    border-radius: 4px;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #4a90e2 0%, #50c9c3 100%);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Blog Counter */
.blog-counter {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #4a90e2 0%, #50c9c3 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 4;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.blog-card:hover .blog-counter {
    opacity: 1;
    transform: scale(1);
}

/* Blog Filters */
.blog-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.blog-search .search-box {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.blog-search .search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 2;
}

.blog-search .search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.blog-search .search-box input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.blog-filter-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    background: white;
    color: #6c757d;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, #4a90e2 0%, #50c9c3 100%);
    border-color: #4a90e2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

/* Social Share Buttons */
.blog-share {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 4;
}

.blog-card:hover .blog-share {
    opacity: 1;
    transform: translateY(0);
}

.blog-share a {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    color: #4a90e2;
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.blog-share a:hover {
    background: #4a90e2;
    color: white;
    transform: scale(1.1);
}

/* Ensure blog cards are always visible */
.blog-card,
.blog-card:hover,
.blog-card:focus,
.blog-card:active {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Override any conflicting styles */
.col-lg-4.col-md-6 {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix for search functionality */
.blog-card.hidden {
    display: none !important;
}

.blog-card.visible {
    display: block !important;
    opacity: 1 !important;
}
