/* Custom Styles for Global News Portal */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Hide scrollbar for Chrome, Safari and Opera */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Card hover effects */
.news-card {
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.news-card img {
    transition: transform 0.3s ease;
}

.news-card:hover img {
    transform: scale(1.05);
}

/* Active navigation link */
.nav-link.active,
.mobile-nav-link.active {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.nav-link.active:hover,
.mobile-nav-link.active:hover {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #2d3748 25%, #4a5568 50%, #2d3748 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Carousel fade transition */
.carousel-slide {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

/* Tag cloud */
.tag-cloud-item {
    transition: all 0.2s ease;
}

.tag-cloud-item:hover {
    transform: scale(1.1);
}

/* Lazy loading images */
.lazy-image {
    filter: blur(5px);
    transition: filter 0.3s ease;
}

.lazy-image.loaded {
    filter: blur(0);
}

/* Article modal animation */
#article-modal {
    animation: fadeIn 0.3s ease;
}

#article-content {
    animation: slideUp 0.3s ease;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glow effect */
.glow-effect {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* Read more button */
.read-more-btn {
    position: relative;
    overflow: hidden;
}

.read-more-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.read-more-btn:hover::after {
    left: 100%;
}

/* Category badge colors */
.category-art { background-color: #ec4899; }
.category-tech { background-color: #3b82f6; }
.category-business { background-color: #10b981; }
.category-gaming { background-color: #8b5cf6; }
.category-community { background-color: #f59e0b; }
.category-shopping { background-color: #ef4444; }
.category-sports { background-color: #06b6d4; }
.category-travel { background-color: #14b8a6; }
.category-special { background-color: #6366f1; }

/* Trending indicator */
.trending-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    z-index: 1;
}

/* Infinite scroll loader */
.infinite-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.infinite-loader .loader {
    width: 40px;
    height: 40px;
    border: 3px solid #3b82f6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error state */
.error-state {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.error-state i {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 16px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 48px;
    color: #6b7280;
    margin-bottom: 16px;
}

/* Newsletter section */
.newsletter-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d1b4e 100%);
    border-radius: 12px;
    padding: 40px;
}

/* Header shadow */
header {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Hide scrollbar for nav */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Refresh notification animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}