/* Evolution of Fairness Detection Timeline Styles */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    padding: 20px;
    color: #e0e0e0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 8px;
}

header p {
    color: #a0a0a0;
    font-size: 0.95rem;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.filter-btn.active {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Category-specific button colors */
.filter-btn[data-category="all"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.filter-btn[data-category="Early Cooperation"] {
    background: #3498db;
}

.filter-btn[data-category="Mammalian Reciprocity"] {
    background: #27ae60;
}

.filter-btn[data-category="Primate Social Cognition"] {
    background: #e67e22;
}

.filter-btn[data-category="Human Moral Systems"] {
    background: #e74c3c;
}

/* Navigation Controls */
.nav-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.nav-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Timeline Container */
#timeline {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    padding-left: 80px;
    padding-right: 80px;
    margin-bottom: 20px;
    overflow: hidden;
}

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

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

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

/* Timeline item styling */
.vis-item {
    border-radius: 6px !important;
    border: none !important;
    font-size: 12px !important;
    padding: 4px 10px !important;
}

.vis-item.vis-selected {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5) !important;
}

.vis-item .vis-item-content {
    color: #fff !important;
    font-weight: 500 !important;
}

/* Timeline axis */
.vis-time-axis .vis-text {
    color: #a0a0a0 !important;
    font-size: 11px !important;
}

.vis-time-axis .vis-grid.vis-minor {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.vis-time-axis .vis-grid.vis-major {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Tooltip styling */
.vis-tooltip {
    background: rgba(20, 20, 40, 0.95) !important;
    color: #fff !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    max-width: 320px !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;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

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

/* Instructions */
.instructions {
    text-align: center;
    color: #888;
    font-size: 12px;
    margin-bottom: 20px;
}

/* Info Panel */
.info-panel {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
}

/* Legend */
.legend {
    padding-right: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.legend h3 {
    font-size: 14px;
    color: #fff;
    margin-bottom: 15px;
}

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

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Event Details */
.event-details {
    min-height: 150px;
}

.event-details h3 {
    font-size: 14px;
    color: #fff;
    margin-bottom: 15px;
}

#event-content {
    color: #a0a0a0;
    font-size: 13px;
    line-height: 1.6;
}

#event-content.has-content {
    color: #e0e0e0;
}

#event-content h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 8px;
}

#event-content .event-date {
    color: #8be9fd;
    font-size: 12px;
    margin-bottom: 12px;
}

#event-content .event-description {
    margin-bottom: 12px;
}

#event-content .event-context {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

#event-content .event-context-label {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

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

    .legend {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-right: 0;
        padding-bottom: 15px;
    }

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

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