/* Animations & Animated Components */

/* Generic Fade In Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards; /* Added forwards to keep the final state */
}

/* Generic Slide Up and Fade In */
@keyframes slideInUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Generic Scale In (for elements that pop into view) */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Entry List (Scrolling Animation) Styles - Existing, with minor adjustments for consistency */
.entry_list {
    max-width: 100%;
    margin-top: 80px; /* Offset for header/layout */
    /* Add a small delay and fade-in for the entire list */
    animation: fadeIn 0.8s ease-out 0.2s forwards;
    opacity: 0; /* Start hidden for animation */
}

.entry_list .list {
    list-style: none;
    padding-block: 10px;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap; /* Default to wrap for flexibility, will be nowrap for animation */
    gap: 10px;
}

.entry_list[data-animated="true"] {
    overflow: hidden;
    -webkit-mask: linear-gradient(90deg, transparent, white, 20%, white 80%, transparent);
    mask: linear-gradient(90deg, transparent, white, 20%, white 80%, transparent);
}

.entry_list[data-animated="true"] .list {
    width: max-content; /* Critical for continuous scroll */
    flex-wrap: nowrap; /* Ensures items stay on one line for animation */
    animation: scroll var(--_animation-duration, 120s) var(--_animation-direction, forwards) linear infinite;
}

.entry_list[data-direction="right"] {
    --_animation-direction: reverse;
}

@keyframes scroll {
    to {
        transform: translateX(calc(-50% - 5px));
    }
}

.entry_list .list li {
    margin-bottom: 12px;
    padding: 10px;
    background-color: #f4f4f4;
    border-radius: 5px;
    text-align: center;
    font-size: 1.8rem;
    /* Add a subtle hover effect for list items */
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.entry_list .list li:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.entry_list .list a {
    font-size: 1.6rem;
}

/* --- New Animations for other elements --- */

/* Quote of the Day Animations */
@keyframes quoteEntrance {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}


.quote_of_day {
    overflow: hidden; /* Important for typewriter effect */
    opacity: 0; /* Start hidden for animation */
    animation: quoteEntrance 0.8s ease-out 0.5s forwards; /* Delayed entrance */
}

/* Picture of the Day Animations */
@keyframes imagePopIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.picture_of_day {
    opacity: 0; /* Start hidden */
    animation: imagePopIn 0.7s ease-out 0.8s forwards; /* Delayed pop-in */
}

/* Trends and Box Animations */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.trends .box {
    opacity: 0; /* Start hidden for animation */
    animation: slideInFromBottom 0.6s ease-out forwards;
}

/* Stagger animation for trend boxes */
.trends .box:nth-child(1) { animation-delay: 1.0s; }
.trends .box:nth-child(2) { animation-delay: 1.1s; }
.trends .box:nth-child(3) { animation-delay: 1.2s; }
.trends .box:nth-child(4) { animation-delay: 1.3s; }
/* Add more :nth-child rules if you have more boxes, or use JavaScript for dynamic staggering */

.trends .box:hover {
    transform: translateY(-5px) scale(1.02); /* Lift and slightly enlarge on hover */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}


/* New: Animation for News Articles */
@keyframes newsArticleFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-article-snippet {
    opacity: 0; /* Start hidden for animation */
    animation: newsArticleFadeIn 0.5s ease-out forwards;
}

/* Stagger animation for news articles */
/* Adjust the start delay and increment as needed */
.news-article-snippet:nth-child(1) { animation-delay: 2.5s; } /* Start later than trends */
.news-article-snippet:nth-child(2) { animation-delay: 2.7s; }
.news-article-snippet:nth-child(3) { animation-delay: 2.9s; }
.news-article-snippet:nth-child(4) { animation-delay: 3.1s; }
.news-article-snippet:nth-child(5) { animation-delay: 3.3s; }
.news-article-snippet:nth-child(6) { animation-delay: 3.5s; }
/* Add more :nth-child rules as per the maximum number of news articles you expect */

.news-article-snippet:hover {
    transform: translateY(-3px); /* Lift on hover */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); /* Darker shadow on hover */
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}
