.blog-container {
    position: relative;
    width: 550px;
    cursor: pointer;
    max-height: 400px;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.blog-image-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite, pulse 2s ease-in-out infinite;
    transition: all 0.3s ease;
}

/* Enhanced loading animation with multiple effects */
.blog-image-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 25%,
        rgba(255, 255, 255, 0.8) 50%,
        rgba(255, 255, 255, 0.4) 75%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* Stop all animations when image is loaded */
.blog-image-wrapper.loaded {
    animation: none;
    background: transparent;
}

.blog-image-wrapper.loaded::before {
    opacity: 0;
    pointer-events: none;
}

/* Card loading indicator text */
.card-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
    transition: opacity 0.3s ease;
}

.card-loading-text {
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
    animation: textPulse 2s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(0, 255, 132, 0.3);
}

.blog-container img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
       object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
    opacity: 0;
    /* Performance optimizations */
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.blog-container img.loaded {
    opacity: 1;
}

.blog-container:hover img {
    transform: scale(1.05);
}

.blog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.6)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-container:hover .blog-overlay {
    opacity: 1;
}

.blog-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.blog-container:hover .blog-content {
    transform: translateY(0);
}

.blog-container h2 {
    color: white;
    font-size: 1.8rem;
    margin: 0 0 15px 0;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.blog-container:hover h2 {
    opacity: 1;
    transform: translateY(0);
}

.blog-card-read-more-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.blog-container:hover .blog-card-read-more-btn {
    opacity: 1;
    transform: translateY(0);
}

.blog-card-read-more-btn .arrow {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.blog-card-read-more-btn:hover .arrow {
    transform: translateX(5px);
}

.blog-category-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
    background: var(--color-primary);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.blog-container:hover .blog-category-tag {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .blog-container {
        width: 80%;
        max-height: 350px;
    }

    .blog-container h2,
    .blog-card-read-more-btn,
    .blog-category-tag {
        opacity: 1;
        transform: translateY(0);
    }

    .blog-content {
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .blog-container {
        width: 90%;
        max-height: 320px;
    }

    .blog-container h2 {
        font-size: 1.5rem;
    }

    .blog-container h2,
    .blog-card-read-more-btn,
    .blog-category-tag {
        opacity: 1;
        transform: translateY(0);
    }

    .blog-content {
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .blog-container {
        width: 100%;
        max-height: 280px;
    }

    .blog-container h2 {
        font-size: 1.2rem;
    }

    .blog-card-read-more-btn {
        padding: 6px 15px;
        font-size: 0.8rem;
    }

    .blog-category-tag {
        padding: 4px 10px;
        font-size: 0.7rem;
        top: 15px;
        left: 15px;
    }

    .blog-container h2,
    .blog-card-read-more-btn,
    .blog-category-tag {
        opacity: 1;
        transform: translateY(0);
    }

    .blog-content {
        transform: translateY(0);
    }
}

@media (max-width: 400px) {
    .blog-container h2 {
        font-size: 1rem;
    }

    .blog-card-read-more-btn {
        padding: 5px 12px;
        font-size: 0.75rem;
    }

    .blog-category-tag {
        padding: 3px 8px;
        font-size: 0.65rem;
        top: 10px;
        left: 10px;
    }
}

/* Animation keyframes for loading effects */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes textPulse {
    0%,
    100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

