/* Control Systems History Timeline - Styles */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: aliceblue;
}

/* Header Section */
.timeline-header {
    background: linear-gradient(135deg, #800000 0%, #a52a2a 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.timeline-header h1 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
}

.timeline-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Filter Controls */
.filter-controls {
    background: white;
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    border-bottom: 1px solid #ddd;
    justify-content: center;
}

.filter-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-right: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.filter-btn.active {
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Category-specific button styles */
.filter-btn[data-category="all"] {
    background-color: #666;
    color: white;
}

.filter-btn[data-category="all"]:hover,
.filter-btn[data-category="all"].active {
    background-color: #444;
}

.filter-btn[data-category="classical"] {
    background-color: #2E7D32;
    color: white;
}

.filter-btn[data-category="classical"]:hover,
.filter-btn[data-category="classical"].active {
    background-color: #1B5E20;
}

.filter-btn[data-category="modern"] {
    background-color: #1565C0;
    color: white;
}

.filter-btn[data-category="modern"]:hover,
.filter-btn[data-category="modern"].active {
    background-color: #0D47A1;
}

.filter-btn[data-category="consumer"] {
    background-color: #FF8F00;
    color: white;
}

.filter-btn[data-category="consumer"]:hover,
.filter-btn[data-category="consumer"].active {
    background-color: #E65100;
}

/* Navigation Controls */
.nav-controls {
    background: #f5f5f5;
    padding: 10px 20px;
    display: flex;
    gap: 8px;
    justify-content: center;
    border-bottom: 1px solid #ddd;
}

.nav-btn {
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: #e0e0e0;
}

/* Timeline Container */
#timeline {
    padding-left: 80px;
    padding-right: 80px;
    overflow: hidden;
    background: white;
}

/* vis-timeline overrides */
.vis-timeline {
    border: none !important;
    overflow: visible !important;
}

.vis-panel.vis-center {
    overflow: visible !important;
}

.vis-item .vis-item-overflow {
    overflow: visible !important;
}

.vis-item {
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.vis-item.vis-selected {
    box-shadow: 0 0 0 3px rgba(128, 0, 0, 0.4);
}

/* Group labels */
.vis-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

/* Tooltip styling */
.vis-tooltip {
    background: #2c3e50 !important;
    color: white !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    max-width: 350px !important;
    line-height: 1.5 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

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

/* Info Panel */
.info-panel {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

/* Legend */
.legend {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.legend h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

/* Event Details Panel */
.event-details {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-height: 120px;
}

.event-details h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.event-details .event-date {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.event-details .event-category {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    margin-bottom: 12px;
}

.event-details .event-description {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}

.event-details .placeholder {
    color: #999;
    font-style: italic;
}

/* Instructions */
.instructions {
    text-align: center;
    padding: 8px 20px;
    background: #fff8e1;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #ddd;
}

/* Back link */
.back-link {
    text-align: center;
    padding: 15px;
    background: #f5f5f5;
}

.back-link a {
    color: #800000;
    text-decoration: none;
    font-size: 14px;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .info-panel {
        grid-template-columns: 1fr;
    }

    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-btn {
        text-align: center;
    }

    #timeline {
        padding-left: 20px;
        padding-right: 20px;
    }
}
