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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #000000;
    color: #ffffff;
    min-height: 100vh;
}

main {
    padding: 20px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 40px;
    background: #000000;
    border-radius: 0;
    box-shadow: none;
    border: 0px solid #1a1a1a;
    overflow-x: hidden;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1rem;
    color: #666666;
    margin-bottom: 8px;
    font-weight: 500;
}

.description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #999999;
    margin-bottom: 30px;
    padding: 20px;
    background: #0f0f0f;
    border-radius: 0;
    border-left: 2px solid #ffffff;
}

.instructions {
    font-size: 0.9rem;
    color: #808080;
    margin-bottom: 25px;
    padding: 12px 20px;
    background: #0f0f0f;
    border-radius: 0;
    display: inline-block;
    border: 1px solid #1a1a1a;
}

/* Sidebar and main content layout */
.main-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    position: relative;
}

.sidebar {
    flex-shrink: 0;
    width: 280px;
    background: #000000;
    border: 1px solid #1a1a1a;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    transition: margin-right 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    order: 2;
}

.sidebar.collapsed {
    margin-right: -320px;
}

.sidebar.collapsed > *:not(.sidebar-toggle) {
    opacity: 0;
    visibility: hidden;
}

.sidebar-toggle {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
    border-right: none;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.3s ease, right 0.3s ease, border-radius 0.3s ease, border 0.3s ease;
    z-index: 10;
    color: #ffffff;
    font-size: 20px;
    visibility: visible !important;
    opacity: 1 !important;
}

.sidebar-toggle:hover {
    background: #1a1a1a;
    border-color: #333333;
}

.sidebar.collapsed .sidebar-toggle {
    left: auto;
    right: 280px;
    border-right: 1px solid #1a1a1a;
    border-left: none;
    border-radius: 0;
}

.sidebar.collapsed .sidebar-toggle .arrow {
    transform: rotate(180deg);
}

.sidebar-toggle .arrow {
    transition: transform 0.3s ease;
    display: inline-block;
}

#timeline {
    flex: 1;
    order: 1;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #1a1a1a;
    background: #000000;
    border-radius: 0;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: 600;
}

.sidebar-controls {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid #1a1a1a;
}

.zoom-buttons-row {
    display: flex;
    gap: 10px;
}

.zoom-buttons-row .zoom-btn {
    flex: 1;
    justify-content: center;
}

.sidebar-controls .reset-btn,
.sidebar-controls .reposition-btn {
    width: 100%;
    justify-content: center;
}

.sidebar-section-header {
    padding: 15px 20px 10px 20px;
    background: #000000;
}

.sidebar-section-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #999999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    min-height: 0;
}

.company-group {
    margin-bottom: 20px;
}

.company-group:last-child {
    margin-bottom: 0;
}

.company-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    cursor: pointer;
    border-radius: 0;
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
    transition: all 0.2s ease;
    margin-bottom: 10px;
}

.company-header:hover {
    background: #1a1a1a;
    border-color: #333333;
    transform: translateX(2px);
}

.company-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #ffffff;
    flex-shrink: 0;
}

.company-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
    text-transform: capitalize;
}

.company-logo {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-left: auto;
}

.series-list {
    padding-left: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.series-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.2s ease;
    color: #808080;
    font-size: 0.88rem;
}

.series-item:hover {
    background: #0f0f0f;
    color: #ffffff;
}

.series-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #ffffff;
}

.series-item label {
    flex: 1;
    cursor: pointer;
    user-select: none;
}

/* Scrollbar for sidebar */
.sidebar-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #000000;
    border-radius: 0;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #1a1a1a;
    border-radius: 0;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #333333;
}

.reset-btn {
    background: #0f0f0f;
    color: #ffffff;
    border: 1px solid #1a1a1a;
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-weight: 500;
}

.reset-btn:hover {
    background: #1a1a1a;
    border-color: #333333;
}

/* Zoom controls styling */
.zoom-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #0f0f0f;
    border-radius: 0;
    border: 1px solid #1a1a1a;
    align-items: center;
}

.zoom-btn {
    background: #0f0f0f;
    color: #ffffff;
    border: 1px solid #1a1a1a;
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.zoom-btn:hover {
    background: #1a1a1a;
    border-color: #333333;
    transform: translateY(-1px);
}

.zoom-btn:active {
    transform: translateY(0);
}

.reposition-btn {
    background: #0f0f0f;
    color: #ffffff;
    border: 1px solid #1a1a1a;
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reposition-btn:hover {
    background: #1a1a1a;
    border-color: #333333;
    transform: translateY(-1px);
}

.reposition-btn:active {
    transform: translateY(0);
}

/* Scrollbar for dropdown */
.dropdown-content::-webkit-scrollbar {
    width: 8px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: #000000;
    border-radius: 0;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: #1a1a1a;
    border-radius: 0;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #333333;
}

#timeline {
    width: 100%;
    overflow: hidden;
    background: #000000;
    border-radius: 0;
    padding: 20px;
    border: 1px solid #1a1a1a;
}

#timeline svg {
    display: block;
    cursor: grab;
}

#timeline svg:active {
    cursor: grabbing;
}

/* Timeline axis styling */
.x-axis text,
.y-axis text {
    font-size: 12px;
    fill: #999999;
    font-weight: 500;
}

.x-axis line,
.y-axis line {
    stroke: #1a1a1a;
    stroke-width: 1;
}

.x-axis path,
.y-axis path {
    stroke: #333333;
    stroke-width: 2;
}

/* Model dots styling */
.model circle {
    cursor: pointer;
    transition: all 0.2s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.model:hover circle {
    r: 9;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.8)) brightness(1.3);
}

.model-label {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Tooltip styling */
.tooltip {
    z-index: 1000;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.9);
    font-family: 'Segoe UI', Roboto, sans-serif;
}

/* Row backgrounds */
.row-bg {
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.row:hover .row-bg {
    opacity: 0.55;
}

/* Year marker lines */
.year-marker {
    stroke: #ffffff;
    stroke-width: 1;
    stroke-dasharray: 5, 5;
    opacity: 0.2;
    pointer-events: none;
}

.year-marker-label {
    fill: #999999;
    font-size: 11px;
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
}

/* Legend (if we add one) */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
    background: #0f0f0f;
    border-radius: 0;
    border: 1px solid #1a1a1a;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #999999;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 0;
    border: 2px solid #333333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .description,
    .instructions {
        font-size: 0.85rem;
    }
}

/* Scrollbar styling for dark mode */
#timeline::-webkit-scrollbar {
    height: 10px;
}

#timeline::-webkit-scrollbar-track {
    background: #000000;
    border-radius: 0;
}

#timeline::-webkit-scrollbar-thumb {
    background: #1a1a1a;
    border-radius: 0;
}

#timeline::-webkit-scrollbar-thumb:hover {
    background: #333333;
}

/* Footer styling */
footer {
    margin-top: 20px;
    padding: 20px;
    background: #000000;
    border-top: 1px solid #1a1a1a;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-content p {
    margin: 0;
    color: #666666;
    font-size: 0.9rem;
}

.footer-content a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-content a:hover {
    color: #cccccc;
    text-decoration: underline;
}
