body {
    font-family: sans-serif;
    margin: 10px 0 0 0;
    background-color: #f4f4f4;
    color: #333;
    min-height: 100vh; /* Ensure the body is at least the height of the viewport */
    position: relative; /* Needed for absolute positioning of the footer */
}

#figure-list-container {
    /* padding: 15px; */
}

#figure-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    padding: 15px;
    margin-top: 10px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.figure-item {
    border: 1px solid #ddd;
    padding: 8px 12px;
    cursor: pointer;
    background-color: #fff;
    border-radius: 4px;
    transition: transform 0.2s ease-in-out;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    text-align: left;
}

.figure-item.highlighted {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background-color: #d4d2d2;
}

.figure-item img {
    height: 50px;
    width: auto;
    margin-right: 10px;
}

.figure-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.figure-item h3 {
    margin-top: 0;
    color: #333;
}

#header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #f0f0f0;
    /* padding: 8px 0 4px 0; */
    height: 22em;
}

#header-bottom {
    width: 100%;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

#figure-details-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 70%;
    background-color: #eee;
    padding: 12px 16px;
    position: relative;
    min-height: 80px;
    gap: 20px;
}

#detail-label {
    text-align: center;
    margin-left: 4em;
    font-size: 1.4em;
}

#detail-info {
    flex: 1 1 0;
    text-align: left;
    /* Optionally add a little left padding if you want */
    /* padding-left: 8px; */
}

#detail-image {
    flex: 0 0 auto;
    max-width: 200px;
    margin: 0;
}

#detail-image img {
    display: block;
    height: 200px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.culture-info {
    font-size: 0.8em;
    color: #777;
    margin-left: 10px;
}

#back-to-list {
    padding: 10px 15px;
    background-color: #5cb85c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

#back-to-list:hover {
    background-color: #4cae4c;
}

.hidden {
    display: none !important;
}

#detail-info p {
    margin-bottom: 10px;
}

#detail-info strong {
    font-weight: bold;
}

#detail-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    text-align: left;
}

.sticky-footer {
    background-color: #f0f0f0;
    /* padding: 10px 20px; */
    text-align: center;
    position: fixed; /* Make it stick! */
    bottom: 0;            /* Stick to the bottom */
    left: 0;
    width: 100%;
}

.sticky-footer a {
    color: #337ab7;
    text-decoration: none;
}

.sticky-footer a:hover {
    text-decoration: underline;
}

/* Tab container styles */
#tab-container {
    margin-top: 20px;
}

#tabs {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 0;
}

.tab-button {
    padding: 10px 20px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 5px;
    transition: background-color 0.3s ease;
}

.tab-button.active {
    background-color: #5cb85c;
    color: white;
    border-color: #4cae4c;
}

.tab-button:hover {
    background-color: #e0e0e0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}


/* Timeline-specific styles */
#figure-timeline-container {
    position: relative;
    margin-left: .5em;
    margin-right: .5em;
}

#figure-timeline-scale {
    width: 100%;
}

#figure-timeline-scale {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    border-bottom: 1px solid #ccc;
    height: 24px;
    width: 100%;
    font-size: 0.85em;
    user-select: none;
    margin-bottom: 0;
}

#figure-timeline-scale {
    display: none;
}

#figure-timeline-scale.active {
    display: block;
}

#figure-timeline-scale.active {
    display: block;
}

#figure-timeline {
    position: relative;
    height: 500px;
    overflow-y: auto;
    padding: .5em;
}

.timeline-figure {
    position: absolute;
    height: 14px; /* or your preferred bar height */
    background: #1976d2;
    border-radius: 4px;
    opacity: 0.85;
    z-index: 1;
    transition: background 0.2s, outline 0.2s;
    /* Optional: for debugging, add a border */
    /* border: 1px solid #333; */
}

.timeline-figure:hover {
    transform: scale(1.1); /* Slightly enlarge on hover */
    background-color: #5cb85c; /* Change color on hover */
}

.timeline-figure.highlighted {
    outline: 3px solid #1976d2;
    background: #e3f2fd;
    z-index: 2;
}

.timeline-scroll-wrapper {
    position: relative;
    overflow-x: auto;
    width: 100%;
    background: #fff;
}

.timeline-tick {
    position: absolute;
    top: 0;
    height: 100%;
    border-left: 1px solid #888;
    text-align: left;
    white-space: nowrap;
    pointer-events: none;
}
.timeline-tick-label {
    position: absolute;
    top: 0;
    left: 2px;
    transform: translateX(-50%);
    font-size: 0.85em;
    background: #fff;
    padding: 0 2px;
    pointer-events: none;
}

#date-range-slider {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 99;
}

/* date-range-slider styles */
#date-range-slider {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 99;
}

#date-range {
    width: 300px;
    margin: 10px 0;
}

#date-range-slider span {
    font-size: 1rem;
    font-weight: bold;
}

.timeline-country-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-size: 0.8em;
    background: rgba(255,255,255,0.85);
    padding: 0 4px;
    border-radius: 3px;
    pointer-events: none;
    color: #333;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-country-label.right {
    left: 100%;
    margin-left: 6px;
    text-align: left;
}

.timeline-country-label.left {
    right: 100%;
    margin-right: 6px;
    text-align: right;
}

#timeline-play-btn {
    margin-left: 0.5em;
    font-size: 1em;
    cursor: pointer;
    background: none;
    border: none;
}

#main-title {
    width: 100%;
    text-align: center;
    margin: 0 0 6px 0;
    font-size: 1.2em;
    display: block;
}

#figure-map-container {
    width: 100%;
    height: 500px;
    min-height: 300px;
    background: #eaeaea;
    display: none; /* Hidden by default, shown when tab is active */
}

#figure-map-container.active {
    display: block;
}

#figure-map {
    width: 100%;
    height: 100%;
    min-height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#figure-map-scale {
    width: 100%;
    min-width: 300px;
    margin: 0 auto 10px auto;
    position: relative;
}

.about-wrapper {
 margin:3em ;
}