/* Blog Carousel Styles */

/* Loading animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Carousel Container */
.blog-carousel-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.blog-carousel-wrapper:hover .carousel-btn {
    opacity: 1;
}

.blog-carousel {
    overflow: hidden;
    border-radius: 12px;
}

.blog-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    display: flex;
    width: 100%;
    flex-shrink: 0;
    gap: 1rem;
}

/* Blog Post Cards */
.blog-post-card {
    flex: 1;
    min-height: 300px;
}

.blog-post-card .glass-card {
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-post-card .glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Line clamping */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Carousel Controls */
.carousel-btn {
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-btn:hover {
    background: rgba(59, 130, 246, 0.8);
    transform: scale(1.1);
}

.carousel-btn:active {
    transform: scale(0.95);
}

/* Carousel Indicators */
.carousel-indicators button {
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.carousel-indicators button:hover {
    background-color: #6b7280 !important;
}

/* Filter button active states */
.blog-filter-btn.active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-color: #3b82f6;
}

.blog-filter-btn {
    transition: all 0.3s ease;
}

.blog-filter-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .carousel-slide {
        gap: 0.75rem;
    }
    
    .blog-post-card {
        min-height: 280px;
    }
}

@media (max-width: 768px) {
    .carousel-slide {
        flex-direction: column;
        gap: 1rem;
    }
    
    .blog-post-card {
        width: 100%;
        min-height: 250px;
    }
    
    .carousel-btn {
        opacity: 1; /* Always show on mobile */
        width: 40px;
        height: 40px;
    }
    
    .carousel-prev {
        left: 8px;
    }
    
    .carousel-next {
        right: 8px;
    }
    
    .blog-filter-btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .blog-post-card .glass-card {
        padding: 1rem;
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
    }
    
    .carousel-indicators {
        margin-top: 1rem;
    }
}

/* Fade-in animation for dynamically loaded content */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Loading state */
.blog-carousel-wrapper .loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
    width: 100%;
}

/* Auto-play pause indicator */
.carousel-paused::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    opacity: 0.7;
}

/* Smooth scrolling for better UX */
.blog-carousel-track {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.carousel-btn:focus,
.carousel-indicators button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .glass-card {
        border: 2px solid #ffffff;
        background: rgba(0, 0, 0, 0.9);
    }
    
    .carousel-btn {
        background: #000000;
        border: 2px solid #ffffff;
    }
}