/* General Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

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

/* Elements Animations */
.site-header {
    animation: fadeIn 0.6s ease;
}

.main-featured {
    animation: slideInUp 0.8s ease;
}

.secondary-featured {
    animation: slideInUp 1s ease;
}

.category-section {
    animation: slideInUp 0.8s ease;
    animation-fill-mode: both;
}

.category-section:nth-child(2) {
    animation-delay: 0.2s;
}

.category-section:nth-child(3) {
    animation-delay: 0.4s;
}

/* Loading States */
.lazy-loading {
    position: relative;
    background: #f6f7f8;
    background: linear-gradient(to right, #f6f7f8 8%, #edeef1 18%, #f6f7f8 33%);
    background-size: 2000px 100%;
    animation: shimmer 1.5s infinite linear;
}

/* Hover Effects */
.btn-add-post:hover {
    animation: pulse 0.6s infinite;
}

.btn-register:hover {
    animation: pulse 0.6s infinite;
}

/* News Ticker Animation with Pause on Hover */
.ticker-items {
    animation: ticker 30s linear infinite;
}

.ticker:hover .ticker-items {
    animation-play-state: paused;
}

/* Card Hover Effects */
.featured-card .card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6));
    opacity: 0.6;
    transition: var(--transition-normal);
    z-index: 1;
}

.featured-card:hover .card-image::before {
    opacity: 0.8;
}

.news-card .card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4));
    opacity: 0.4;
    transition: var(--transition-normal);
    z-index: 1;
}

.news-card:hover .card-image::before {
    opacity: 0.6;
}

/* Button Effects */
.btn-subscribe {
    overflow: hidden;
    position: relative;
}

.btn-subscribe::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 100%;
    transform: scale(0);
    opacity: 0;
}

.btn-subscribe:active::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(40);
        opacity: 0;
    }
}

/* Scroll Animations for the Sidebar Widgets */
.sidebar .widget {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.sidebar .widget.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Logo Animation */
.logo {
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-normal);
}

.logo:hover::after {
    width: 100%;
}

/* Mobile Menu Toggle Animation */
.mobile-menu-toggle {
    position: relative;
}

.mobile-menu-toggle i {
    transition: transform var(--transition-fast);
}

.mobile-menu-toggle.active i {
    transform: rotate(90deg);
}

/* Login Form Animations */
.login-modal {
    animation: fadeIn 0.3s ease;
}

.login-modal-content {
    animation: slideInUp 0.4s ease;
}

.login-form .form-group {
    opacity: 0;
    animation: slideInUp 0.4s ease forwards;
}

.login-form .form-group:nth-child(1) {
    animation-delay: 0.1s;
}

.login-form .form-group:nth-child(2) {
    animation-delay: 0.2s;
}

.login-form .form-options {
    opacity: 0;
    animation: slideInUp 0.4s 0.3s ease forwards;
}

.login-form .btn-submit {
    opacity: 0;
    animation: slideInUp 0.4s 0.4s ease forwards;
}

.login-form .social-login {
    opacity: 0;
    animation: slideInUp 0.4s 0.5s ease forwards;
}

.login-form .register-prompt {
    opacity: 0;
    animation: slideInUp 0.4s 0.6s ease forwards;
}