/* timeline.css */
.timeline-page {
    body {
        overflow-x: hidden;
    }

    .timeline-tabs {
        margin-top: 20px;
        text-align: center;
    }

    #timeline-content {
        margin-top: 20px;
    }

    .media-card {
        margin-bottom: 20px;
        flex: 1 1 calc(33.333% - 20px);
        box-sizing: border-box;
        position: relative;
        cursor: pointer;
        transition: transform 0.2s ease;
        max-width: 32.53%;
    }

    .media-card:hover {
        transform: scale(1.05);
    }

    .media-card img {
        width: 100%;
        height: 250px;
        object-fit: cover;
        object-position: top;
    }

    .icon-overlay {
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.7);
        color: var(--white-color);
        padding: 5px 10px;
        border-radius: 5px;
    }

    .card-body {
        background-color: var(--background-color);
        padding: 20px;
        border-top: 1px solid #dee2e6;
        /* border-radius: 0 0 10px 10px; */
    }

    .card-title {
        font-size: 1rem;
        font-weight: bold;
        color: var(--accent-color);
    }

    .card-date {
        font-size: 0.9rem;
        color: var(--primary-color);
        /* text-transform: uppercase; */
        text-align: right;
    }

    .card-event i,
    .card-themes i {
        color: var(--primary-color);
    }

    .card-date a,
    .card-event a,
    .card-themes a {
        color: var(--primary-color);
        text-decoration: none;
        transition: color 0.2s ease;
    }

    .card-date a:hover,
    .card-event a:hover,
    .card-themes a:hover {
        color: var(--secondary-color);
        text-decoration: underline;
    }

    .date-link {
        color: var(--primary-color);
        text-decoration: none;
    }

    @media (max-width: 992px) {
        #sidebar {
            display: none;
        }
    }

    @media (min-width: 992px) {
        .dropdown-container {
            display: none;
        }

        #timeline-view {
            flex: 0 0 auto;
            width: 83.33333333%
        }
    }

    @media (max-width: 767.98px) {
        .media-card {
            flex: 1 1 100%;
            max-width: 100%;
        }

        .timeline-toggle,
        .timeline-filter {
            width: 100%;
            margin-bottom: 10px;
            text-align: center;
        }

        .toggle-group {
            flex-direction: column;
        }

        .toggle-btn {
            margin-bottom: 5px;
            width: 100%;
        }

        .timeline-filter .dropdown {
            width: 100%;
        }

        .timeline-filter .dropdown-toggle {
            width: 100%;
        }
    }

    #sidebar {
        width: 150px;
        padding: 0;

        .nav-link {
            color: var(--accent-color);
            /* font-weight: bold; */
        }
    }

    .sidebar-sticky {
        position: -webkit-sticky;
        position: sticky;
        padding-top: 0.5rem;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .sidebar .nav-link {
        font-weight: 500;
        color: var(--accent-color);
    }

    .sidebar .nav-link .feather {
        margin-right: 4px;
        color: #727272;
    }

    .sidebar .nav-link.active {
        color: var(--primary-color);
    }

    .chart-container {
        width: 100%;
        height: 400px;
        margin-top: 20px;
    }

    .dropdown-container {
        margin-top: 20px;
    }

    .rtl-text {
        direction: rtl;
        text-align: right;
    }

    .lazyload {
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }

    .lazyload[src] {
        opacity: 1;
    }

    /* General Styling */
    .timeline-container {
        padding: 10px;
        background-color: var(--accent-color);
        color: #e6e6e6;
    }

    /* Modern Toggle Buttons */
    .toggle-group {
        display: flex;
        border-radius: 5px;
        overflow: hidden;
        background-color: var(--background-color);
    }

    .toggle-btn {
        flex: 1;
        padding: 12px 15px;
        background-color: var(--primary-color);
        color: var(--white-color);
        border: none;
        cursor: pointer;
        transition: background-color 0.3s ease;
        text-align: center;
        font-weight: bold;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        height: 48px;
        /* Ensures uniform height with the filter button */
    }

    .toggle-btn:not(:last-child) {
        border-right: 1px solid var(--secondary-color);
    }

    .toggle-btn.active,
    .toggle-btn:hover {
        background-color: var(--secondary-color);
    }

    .timeline-tabs-dropdown {
        flex-grow: 1;
    }

    .timeline-tabs-dropdown .dropdown-toggle {
        text-align: left;
    }

    .timeline-tabs-dropdown .dropdown-item {
        display: flex;
        align-items: center;
    }

    .timeline-tabs-dropdown .dropdown-item i {
        margin-right: 8px;
    }

    /* Modern Filter Dropdown */
    .timeline-filter {
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .filter-btn {
        background-color: var(--background-color);
        border-color: var(--primary-color);
        color: var(--accent-color);
        padding: 12px 15px;
        border-radius: 5px;
        transition: background-color 0.3s ease;
        height: 48px;
        /* Uniform height with toggle buttons */
        font-weight: bold;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .filter-btn:hover {
        background-color: var(--primary-color);
        color: var(--white-color);
    }

    .timeline-filter .dropdown-menu .dropdown-item {
        color: var(--accent-color);
    }

    .timeline-filter .dropdown-menu .dropdown-item:hover {
        background-color: var(--secondary-color);
        color: var(--white-color);
    }

    .dropdown-item {
        cursor: pointer;
    }

    /* Selected Period Label */
    #selected-period {
        margin-top: 20px;
        font-size: 1.1rem;
        font-weight: bold;
        color: var(--accent-color);
        text-align: left;
        padding: 10px;
        background-color: var(--background-color);
        border-radius: 5px;
    }

    /* Content Styling */
    .timeline-content {
        padding: 20px;
        background-color: var(--background-color);
        border-radius: 8px;
    }

    /* Scroll to Top Button Styles */
    .scroll-to-top {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background-color: var(--primary-color);
        color: var(--white-color);
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: none;
        text-align: center;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        font-size: 24px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    .scroll-to-top:hover {
        background-color: var(--secondary-color);
    }

    #moreResultsButton {
        background-color: var(--primary-color);
        border: none;
        margin-top: 20px;
        width: 100%;
    }

    #moreResultsButton:hover {
        background-color: var(--secondary-color);
    }

    .active-filter {
        background-color: var(--primary-color) !important;
        /* Highlight color */
        color: var(--white-color) !important;
        /* Text color when active */
    }
}

#timeline-errorContainer {
    animation: fadeIn 0.5s ease-in-out;

    i {
        animation: bounce 1.5s infinite;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}