/* Global Reset and Box Sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    overflow: hidden;
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optional: if a small page margin is desired */
body {
    margin: 0;
}

/* Main Timeline Container */
#timelineContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* Timeline Canvas */
#timelineCanvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    /* Width and height set by JavaScript for DPI scaling */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Speedline Canvas */
#speedlineCanvas {
    display: block;
    position: absolute;
    /* top, width, height set by JavaScript for DPI scaling */
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Welcome screen fade-out */
.welcome-screen {
    opacity: 1;
    transition: opacity 0.4s ease;
}

/* Popup Styling */
#popup {
    position: absolute;
    display: none;
    z-index: 11000;
    background-color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
    pointer-events: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    font-size: 15px;
}

.popup-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 16px;
    background-color: #f8fafc;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    white-space: normal;
    font-size: 14px;
    line-height: 1.6;
}

/* Settings Panel */
#settings-line {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    padding: 16px 20px;
    border: none;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-size: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

#settings-data {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-right: auto;
    color: #0f172a;
    font-weight: 600;
}

.settings-metric {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
}

.settings-metric__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
}

#settings-line label {
    margin-right: 12px;
    color: #334155;
    font-weight: 600;
    font-size: 14px;
}

#settings-line input,
#settings-line select {
    margin-right: 10px;
    padding: 8px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#settings-line input:focus,
#settings-line select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Save Button */
#save-settings {
    padding: 8px 16px;
    font-size: 14px;
}

/* Company ID Input */
#company-id-input {
    width: 90px;
    text-align: center;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 24px;
    border: none;
    border-radius: 12px;
    width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Close Button */
.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
}

/* Generic Button Styling */
button {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.45);
}

button:active {
    transform: translateY(0);
}

/* Scraper options panel */
.options-panel {
    position: fixed;
    min-width: 280px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    padding: 16px;
    z-index: 2000;
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
}

.options-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 8px;
}

.options-panel__close {
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
}

.options-panel__body label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: #4a5568;
}

.options-panel__body input[type="number"] {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f7fafc;
}

.options-panel__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.options-panel__footer button {
    padding: 6px 12px;
}

/* Disclaimer Styling */
#disclaimer {
    padding: 5px;
    color: gray;
    text-align: right;
    font-style: italic;
}