@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --background-color: #1a1a1a;
    --text-color: #f0f0f0;
    --delete-color: #e74c3c;
    --grey-out-color: #808080;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

header {
    display: flex; /* Enables Flexbox layout */
    align-items: center; /* Vertically aligns items */
    justify-content: space-between; /* Spaces items horizontally */
    background-color: var(--primary-color); /* Keeps the header background */
    color: var(--text-color); /* Ensures text is visible */
    padding: 10px 20px; /* Adds spacing inside the header */
    font-size: 24px; /* Preserves original text size */
    font-weight: bold; /* Keeps text bold */
    text-transform: uppercase; /* Converts text to uppercase */
    letter-spacing: 2px; /* Adds spacing between letters */
}


/* Add these styles to your CSS file or in a <style> block in your HTML */
.load-more-container {
    text-align: center;
    margin-top: 20px;
}

#load-more-manuscripts {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    background-color: #4CAF50; /* Green background */
    color: white; /* White text */
    border-radius: 5px;
    display: inline-block;
}


#progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 4px;
    background-color: white;
    z-index: 10;
    transition: width 0.4s ease;
}

.main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100vh;
}

.top-half {
flex:1
    display: flex; /* Keep the flex layout if needed for child alignment */
    align-items: center; /* Vertical centering of children */
    padding: 10px; /* Adjust padding as needed */
    overflow: auto; /* Allow vertical scrolling */
    overflow-y: auto; /* Specifically enable vertical scrolling */
    position: relative;
}


.timeline {
    width: 14000px;
    height: 4px;
    background-color: var(--primary-color);
    position: relative;
    z-index: 1; /* Ensure timeline is below dots and legend */
}

.timeline::before,
.timeline::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

.timeline::before {
    left: -10px;
    border-right: 10px solid var(--primary-color);
}

.timeline::after {
    right: -10px;
    border-left: 10px solid var(--primary-color);
}

#timeline-container {
    position: relative;
   overflow-y: scroll; /* Always show vertical scroll bar */
    height: 20400px; /* Total height of the range */
}

.timeline-content {
    position: relative;
    min-height: calc(100% + 1px); /* Ensure content always exceeds the viewport */
    width: 100%; /* Full width of the timeline */
    
}

.event {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: absolute;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2; /* Ensure dots are above the timeline and year labels */
}

.event:hover {
    transform: scale(1.5);
}

.event.selected {
    box-shadow: 0 0 0 2px #fff;
}

.event.greyed-out {
    background-color: var(--grey-out-color);
}

.year-label {
    position: absolute;
    bottom: 0;
    transform: translateY(100%);
    background: black; /* Ensure the background is black to blend with the timeline background */
    padding: 2px 5px;
    font-size: 12px;
    color: white; /* Ensure the text color is white */
    border: 1px solid #ccc;
    z-index: 0; /* Ensure year labels are below the dots and timeline */
}

.bottom-half {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

.content-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

#event-content {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 20px;
    min-height: 200px;
}

.sidebar {
    flex: none;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: max-width 0.3s ease;
    max-width: 250px;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 3; /* Ensure sidebar is above everything else */
}

.sidebar.collapsed {
    max-width: 40px;
    overflow: hidden;
}

.sidebar-section {
    margin-bottom: 10px;
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
}

.sidebar li {
    cursor: pointer;
    padding: 5px 0;
}

.sidebar li:hover {
    text-decoration: underline;
}

.sidebar input[type="checkbox"] {
    margin-right: 5px;
}

.toggle-sidebar {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
    align-self: flex-end;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    position: relative;
    z-index: 2; /* Ensure legend items are above the timeline and year labels */
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.legend-checkbox {
    margin-right: 5px;
}

.question-mark {
    cursor: pointer;
    margin-left: 5px;
    color: var(--primary-color);
    position: relative;
}

.tooltip {
    visibility: hidden;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 9999; /* Increased z-index to ensure the tooltip is above everything */
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    width: 120px;
}

.question-mark:hover .tooltip {
    visibility: visible;
    opacity: 1;
}


.timeline-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.arrow {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-top: 2px solid black;
    border-right: 2px solid black;
    transform: rotate(45deg);
    transition: transform 0.3s;
}

.arrow.collapsed {
    transform: rotate(-135deg);
}

.arrow-reverse {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-top: 2px solid black;
    border-right: 2px solid black;
    transform: rotate(-135deg);
    transition: transform 0.3s;
}

.arrow-reverse.collapsed {
    transform: rotate(45deg);
}

@media (max-width: 768px) {
    header {
        font-size: 20px;
        padding: 8px 0;
    }


    .content-container {
        padding: 10px;
    }

    .sidebar {
        flex: none;
        height: 100%;
        transition: max-width 0.3s ease;
        max-width: 100%;
    }

    .sidebar.collapsed {
        max-width: 40px;
        overflow: hidden;
    }

    .toggle-sidebar {
        top: 10px;
        right: 10px;
    }

    .timeline-controls {
        top: 5px;
        right: 5px;
        gap: 5px;
    }
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #333;
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 6px;
}

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

.load-more-btn {
    margin-left: 10px;
    background-color: #3498db;
    color: #fff;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.load-more-btn:hover {
    background-color: #2980b9;
}

.load-more-btn:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

/* CSS for event dots on the timeline */
.event-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: yellow; /* Change color as needed */
    border-radius: 50%;
    cursor: pointer;
}

/* Default state of collapsible content */
#instructions, #legend {
    display: block; /* Show by default */
}


.read-more-link {
    font-size: 12px;
    color: #3498db;
    text-decoration: none;
    margin-left: 5px;
}
.read-more-link:hover {
    text-decoration: underline;
}

#top-menu {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex; /* Enables inline horizontal alignment */
    align-items: center; /* Vertically centers items */
     display: flex; /* Enables inline horizontal alignment */
    gap: 10px; /* Adds space between the home icon and the menu toggle */
    margin-top: -5px; /* Adjust the value to move items up */
}

#menu-toggle {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 1px; /* Adjust padding if needed */
    cursor: pointer;
    border-radius: 5px;
    font-size: 18px; /* Updated to match yours */
    margin: 0; /* Remove unwanted spacing */
    line-height: 1; /* Ensure consistent vertical alignment */
}

#menu-toggle:hover {
    color: var(--secondary-color); /* Adds hover effect */
}


#menu-list {
    position: absolute;
    top: 40px;
    left: 0;
    z-index: 1000;
    background-color: #3498db; /* A nice blue background */
    color: white; /* White text for better contrast */
    list-style-type: none;
    margin: 0;
    padding: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
    border-radius: 5px; /* Rounded corners */
    font-family: Arial, sans-serif; /* Clean font */
    width: 150px; /* Optional: Fix width */
    font-size: 16px; /* Adjust the size here */
}






#menu-list.hidden {
    display: none;
}

#menu-list li {
    margin: 5px 0; /* Space between items */
    font-size: 16px; /* Adjust the size here */
}

#menu-list li a {
    color: white; /* White text for links */
    text-decoration: none; /* No underlines */
    display: block; /* Make links fill their container */
    padding: 5px 10px; /* Add some padding for clickability */
    border-radius: 3px; /* Rounded corners for links */
    transition: background-color 0.3s ease; /* Smooth hover effect */
}

#menu-list li a:hover {
    background-color: #2980b9; /* Slightly darker blue on hover */
}

.home-icon {
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0; /* Remove any default margins */
    padding: 0; /* Remove any default padding */
}

.home-icon svg {
    width: 24px;
    height: 24px;
}


.home-icon:hover {
    transform: scale(1.1);
}

.header-title {
    flex-grow: 1;
    text-align: center;
}


