* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Category Sidebar */
.category-sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid #e0e0e0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.category-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.category-header h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.3em;
}

.category-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.category-filters {
    padding: 20px;
}

.category-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.category-item:hover {
    background-color: #f8f9fa;
}

.category-checkbox {
    margin-right: 12px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.category-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 10px;
    flex-shrink: 0;
}

.category-name {
    font-weight: 500;
    color: #2c3e50;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
}

.timeline-container {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    padding: 20px 0;
    margin-bottom: 40px;
}

.timeline-wrapper {
    position: relative;
    min-width: 1000px;
    min-height: 400px;
}

.timeline {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #e0e0e0 0%, #e0e0e0 100%);
    background-size: 50px 2px;
    background-repeat: repeat-x;
    background-position: center;
}

.timeline-axis {
    position: relative;
    height: 40px;
    margin-bottom: 10px;
    border-bottom: 2px solid #34495e;
}

.year-marker {
    position: absolute;
    bottom: -25px;
    transform: translateX(-50%);
    font-size: 0.9em;
    font-weight: bold;
    color: #34495e;
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
}

.year-marker::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 15px;
    background-color: #34495e;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 70px; /* Position the main timeline line at a fixed position */
    left: 0;
    right: 0;
    height: 3px;
    background-color: #34495e;
}

.timeline-entry {
    position: absolute;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-entry:hover {
    transform: scale(1.05);
}

.timeline-bar {
    height: 40px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    min-width: 120px;
}

.timeline-label {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(52, 73, 94, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.8em;
    white-space: nowrap;
}

/* Color schemes for different types */
.education {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.work {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.volunteer {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.volunteering {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.research {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.teaching {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.other {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

/* Info Panel */
.info-panel {
    display: block;
    margin-top: 40px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.info-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.info-panel-content h3 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.info-panel-meta {
    margin-bottom: 15px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.info-dates {
    color: #e74c3c;
    font-weight: bold;
    font-size: 0.9em;
}

.info-location {
    color: #7f8c8d;
    font-style: italic;
    font-size: 0.9em;
}

.info-location:before {
    content: "📍 ";
    margin-right: 4px;
}

.info-description {
    color: #555;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}


/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

#modal-title {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
}

#modal-description {
    line-height: 1.8;
    color: #555;
    white-space: pre-wrap;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2em;
    }

    .timeline-wrapper {
        min-width: 800px;
    }

    .legend {
        flex-direction: column;
        align-items: center;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}