:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --background-color: #f5f7fa;
  --secondary-background: #ecf0f1;
  --text-color: #2c3e50;
  --secondary-text-color: #7f8c8d;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
}


body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: Arial, sans-serif; /* or your preferred sans-serif font */
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

#container {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: #f4f4f4;
    padding: 20px;
    text-align: center;
}

h1 {
    margin: 0;
    color: #2c3e50;
}

#project-description {
    max-width: 800px; /* Adjust this value to your preference */
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    background-color: var(--secondary-background);
    color: var(--secondary-text-color);
    border-radius: 8px;
    margin-bottom: 20px;
}

#timeline-container {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 20px 0;
    background-color: #eaf1f9;
}

#timeline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 90%; /* Adjust this value as needed */
    max-width: 1200px; /* Set a max-width to prevent stretching on very wide screens */
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 10px;
}

.year-dot {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #3498db;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    margin-bottom: 10px;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.name-label {
    font-size: 14px;
    line-height: 1.2;
    max-width: 120px; /* Adjust based on your content */
    font-weight: bold;
    transition: color 0.3s ease;
}

.main-container {
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin: 20px auto;
    padding: 20px;
    max-width: 1200px;
}
/* Maintain hover effects */
.timeline-item:hover .year-dot {
    transform: scale(1.1);
    background-color: #2980b9;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
}

.timeline-item:hover .name-label {
    color: #2980b9;
}

/* Add a connecting line */
#timeline::before {
    content: '';
    position: absolute;
    top: 50px; /* Adjust to align with the center of your year dots */
    left: 0;
    right: 0;
    height: 2px;
    background-color: #3498db;
    z-index: 0;
}

.year-dot {
    position: relative;
    z-index: 1;
}

#subcategories {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.sub-dot {
    padding: 5px 10px;
    background-color: #2ecc71;
    color: white;
    border-radius: 15px;
    margin: 5px;
    font-size: 12px;
    cursor: pointer;
}

#timeline::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 70px; /* Adjusted based on new timeline-item width */
    right: 70px;
    height: 2px;
    background-color: #bdc3c7;
    z-index: 1;
}

#subcategories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.sub-dot {
    padding: 5px 10px;
    background-color: #2ecc71;
    color: white;
    border-radius: 15px;
    cursor: pointer;
    margin: 5px;
    font-size: 12px;
    white-space: nowrap;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.sub-dot:hover {
    transform: scale(1.05);
}

.sub-dot.active {
    background-color: #e67e22;
    box-shadow: 0 0 10px rgba(230, 126, 34, 0.5);
}

#details-panel {
    position: fixed;
    max-height: 80vh; /* Limit the height to 80% of the viewport height */
    overflow-y: auto; /* Add vertical scrolling when content exceeds max-height */
    width: 300px; /* Or whatever width you prefer */
    background-color: var(--secondary-background);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#details-panel.active {
    opacity: 1;
    visibility: visible;
}

#close-details {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    z-index: 1001; /* Ensure it's above other content */
    color: var(--accent-color);
}

#close-details:hover {
    color: red; /* Or any color to indicate it's interactive */
}

#details-content {
    margin-top: 20px;
    padding-right: 10px; /* Add some padding to prevent content from touching the scrollbar */
}

.no-description {
    font-style: italic;
    color: #999;
}

.challenges-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f0f0;
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

.challenges-section h3 {
    margin-top: 0;
    color: #2c3e50;
}

/* Add a line connecting timeline items */
#timeline::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 2px;
    background-color: #bdc3c7;
    z-index: -1;
}

#details-panel h2 span {
    font-size: 0.8em;
    color: #7f8c8d;
}

/* Ensure there's space below the timeline for subcategories */
#timeline::after {
    content: '';
    display: block;
    height: 60px; /* Adjust as needed */
}

/* Adjust year and label styling for better visibility */
.year-dot {
    width: 50px; /* Increased size */
    height: 50px; /* Increased size */
    font-size: 16px; /* Larger font */
    margin-bottom: 10px; /* More space between dot and label */
}

.year-label {
    font-size: 14px; /* Slightly larger font */
    text-align: center;
    max-width: 120px; /* Adjusted based on new timeline-item width */
}

.subcategories-container {
    display: none;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.subcategory-line {
    width: 2px;
    height: 20px;
    background-color: #bdc3c7;
}

.subcategory {
    padding: 5px 10px;
    margin: 3px 0;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--primary-color);
    color: white;
}

.subcategory:hover {
    transform: translateY(-3px);
    background-color: #2980b9; /* Darker shade on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.subcategory.active {
    background-color: var(--accent-color);
    font-weight: bold;
}

[data-action="close-panel"] {
    position: sticky;
    top: 0;
    right: 0;
    background-color: #f9f9f9;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    z-index: 1001;
}

[data-action="close-panel"]:hover {
    background-color: #e0e0e0;
}

.close-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    z-index: 1002;
    color: #333;
}

.close-button:hover {
    color: red;
}

.dangers-section {
    background-color: rgba(231, 76, 60, 0.1); /* Light red background */
    border-left: 4px solid var(--accent-color);
    padding: 10px;
    margin-top: 10px;
}

.dangers-section h3,
.dangers-section h4 {
    color: #d32f2f; /* Dark red color for the heading */
    margin-top: 0;
}

.dangers-section ul {
    margin-bottom: 0;
}

#attribution {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #f0f0f0;
    text-align: center;
    padding: 10px 0;
    font-size: 14px;
    color: #666;
}

#attribution p {
    margin: 0;
    padding: 0;
}

#description-background {
    width: 100%;
    background-color: #f0f4f8; /* This is the light blue color from the image */
    padding: 20px 0; /* Add some vertical padding */
}

#description-content {
    max-width: 800px; /* Or whatever width you prefer for the text */
    margin: 0 auto;
    padding: 0 20px; /* Add some horizontal padding */
    text-align: center;
}

#description-content p {
    margin: 10px 0; /* Add some space between paragraphs */
}