body {
    background: aliceblue;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 10px 15px;
    color: #333;
}

h2 {
    text-align: center;
    color: #3F51B5;
    margin: 5px 0 10px 0;
    font-size: 1.4rem;
}

/* Filter buttons container */
.filter-controls {
    text-align: center;
    margin-bottom: 10px;
}

.filter-controls button {
    border: 2px solid #999;
    border-radius: 20px;
    padding: 5px 14px;
    margin: 3px 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    color: #555;
}

.filter-controls button:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.filter-controls button.active {
    color: white;
}

.filter-controls button[data-category="all"] {
    border-color: #666;
}
.filter-controls button[data-category="all"].active {
    background: #666;
    border-color: #666;
}

.filter-controls button[data-category="theory"] {
    border-color: #2196F3;
}
.filter-controls button[data-category="theory"].active {
    background: #2196F3;
    border-color: #2196F3;
}

.filter-controls button[data-category="hardware"] {
    border-color: #4CAF50;
}
.filter-controls button[data-category="hardware"].active {
    background: #4CAF50;
    border-color: #4CAF50;
}

.filter-controls button[data-category="industry"] {
    border-color: #FF9800;
}
.filter-controls button[data-category="industry"].active {
    background: #FF9800;
    border-color: #FF9800;
}

.filter-controls button[data-category="milestone"] {
    border-color: #F44336;
}
.filter-controls button[data-category="milestone"].active {
    background: #F44336;
    border-color: #F44336;
}

/* Timeline container */
#timeline {
    width: 100%;
    height: 300px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
}

/* Event details panel */
#event-details {
    margin-top: 10px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    min-height: 60px;
    display: none;
}

#event-details.visible {
    display: block;
}

#event-details h3 {
    margin: 0 0 8px 0;
    font-size: 1.05rem;
    color: #3F51B5;
}

#event-details .detail-row {
    margin-bottom: 6px;
    font-size: 0.88rem;
    line-height: 1.45;
}

#event-details .detail-label {
    font-weight: 700;
    color: #555;
}

#event-details .category-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    color: white;
    font-size: 0.78rem;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

.category-badge.theory { background: #2196F3; }
.category-badge.hardware { background: #4CAF50; }
.category-badge.industry { background: #FF9800; }
.category-badge.milestone { background: #F44336; }

#placeholder-text {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

/* vis-timeline item styling */
.vis-item.theory {
    background-color: #2196F3;
    border-color: #1565C0;
    color: white;
}

.vis-item.hardware {
    background-color: #4CAF50;
    border-color: #2E7D32;
    color: white;
}

.vis-item.industry {
    background-color: #FF9800;
    border-color: #E65100;
    color: white;
}

.vis-item.milestone {
    background-color: #F44336;
    border-color: #B71C1C;
    color: white;
}

/* vis-timeline tooltip */
.vis-tooltip {
    max-width: 320px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.72rem;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    color: #333;
}

.vis-tooltip div {
    max-width: 300px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* vis-timeline overrides for cleaner look */
.vis-item .vis-item-content {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    white-space: nowrap !important;
    min-width: fit-content !important;
}

.vis-item.vis-range {
    min-width: fit-content !important;
}

.vis-item.vis-box {
    min-width: fit-content !important;
}

.vis-item.vis-selected {
    outline: 4px solid #3F51B5;
    outline-offset: 1px;
    color: black !important;
    border-width: 4px;
}
