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

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.visible {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #4a5568;
    border-top: 4px solid #f59e0b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: #f59e0b;
    font-size: 1.1rem;
    font-weight: 600;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.subtitle {
    color: #888;
    font-size: 1rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #4a5568;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.upload-area:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.upload-area.dragover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.upload-prompt p {
    margin: 5px 0;
}

.upload-hint {
    color: #666;
    font-size: 0.85rem;
}

.upload-status {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    display: none;
}

.upload-status.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10b981;
    color: #10b981;
}

.upload-status.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
}

/* Controls Section */
.controls-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.pv-selection {
    margin-bottom: 20px;
}

.pv-selection label {
    font-weight: 600;
    color: #f59e0b;
    display: block;
    margin-bottom: 8px;
}

.pv-dropdown {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #4a5568;
    border-radius: 8px;
    background: #1a1a2e;
    color: #e0e0e0;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 10px;
}

.pv-dropdown:hover {
    border-color: #f59e0b;
}

.pv-info {
    padding: 10px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    font-size: 0.9rem;
    color: #f59e0b;
}

.pv-time-info {
    line-height: 1.6;
}

.time-control {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.time-control label {
    font-weight: 600;
    color: #f59e0b;
}

.time-control input[type="time"] {
    padding: 10px 15px;
    border: 1px solid #4a5568;
    border-radius: 8px;
    background: #1a1a2e;
    color: #e0e0e0;
    font-size: 1rem;
}

.time-slider {
    flex: 1;
    min-width: 200px;
    height: 8px;
    border-radius: 4px;
    background: #4a5568;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f59e0b;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.time-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f59e0b;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-input-group .time-input {
    width: 80px;
    padding: 10px 12px;
    border: 1px solid #4a5568;
    border-radius: 8px;
    background: #1a1a2e;
    color: #e0e0e0;
    font-size: 1rem;
    text-align: center;
}

.ampm-dropdown {
    padding: 10px 15px;
    border: 1px solid #4a5568;
    border-radius: 8px;
    background: #1a1a2e;
    color: #e0e0e0;
    font-size: 1rem;
    cursor: pointer;
    min-width: 70px;
}

.service-input {
    padding: 10px 15px;
    border: 1px solid #4a5568;
    border-radius: 8px;
    background: #1a1a2e;
    color: #e0e0e0;
    font-size: 1rem;
    width: 200px;
}

.btn-primary {
    padding: 10px 25px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 8px;
    color: #1a1a2e;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
    padding: 10px 25px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-left: 10px;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.3);
}

.time-range-info {
    margin-top: 10px;
    color: #888;
    font-size: 0.9rem;
}

/* PV Position Info */
.pv-position-info {
    margin-top: 20px;
}

.position-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #4a5568;
    border-radius: 12px;
    padding: 20px;
}

.position-card h3 {
    color: #f59e0b;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.status-badge.at_station {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status-badge.between {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.status-badge.not-started {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.status-badge.completed {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.position-details {
    display: grid;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: #888;
    font-size: 0.9rem;
}

.info-row .value {
    color: #e0e0e0;
    font-weight: 500;
}

.info-row .value.deviation.early {
    color: #3b82f6;
}

.info-row .value.deviation.late {
    color: #ef4444;
}

.info-row .value.deviation.on-time {
    color: #10b981;
}

/* Timeline */
.timeline {
    margin-top: 20px;
    padding: 20px 0;
    overflow-x: auto;
}

.timeline-track {
    position: relative;
    height: 60px;
    min-width: 800px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.timeline-station {
    position: absolute;
    transform: translateX(-50%);
    text-align: center;
    bottom: 0;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    background: #4a5568;
    border-radius: 50%;
    margin: 0 auto 5px;
}

.timeline-station.current .timeline-dot {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.timeline-station.prev .timeline-dot {
    background: #3b82f6;
}

.timeline-station.next .timeline-dot {
    background: #f59e0b;
}

.timeline-name {
    font-size: 0.65rem;
    color: #888;
    white-space: nowrap;
}

.timeline-station.current .timeline-name {
    color: #10b981;
    font-weight: 600;
}

.timeline-train {
    position: absolute;
    transform: translateX(-50%);
    top: 5px;
}

.timeline-train-dot {
    font-size: 1.5rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Visualization */
.visualization-section {
    margin-bottom: 30px;
}

/* Circle Line Visualization */
.circle-visualization {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

#circleCanvas {
    border-radius: 8px;
    cursor: grab;
    max-width: 100%;
    height: auto;
}

#circleCanvas:active {
    cursor: grabbing;
}

.tooltip {
    position: absolute;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 15px;
    color: #e0e0e0;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip.visible {
    opacity: 1;
}

.tooltip-title {
    font-weight: 600;
    color: #f59e0b;
    margin-bottom: 5px;
}

.tooltip-content {
    font-size: 0.8rem;
    color: #888;
}

.visualization-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.btn-control {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #4a5568;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-control:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #f59e0b;
}

.adjacent-info {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: none;
}

.adjacent-info.visible {
    display: block;
}

.adjacent-info h3 {
    color: #f59e0b;
    margin-bottom: 15px;
}

.adjacent-trains {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.adjacent-train {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    flex: 1;
    min-width: 200px;
}

.adjacent-train.current {
    border: 2px solid #f59e0b;
}

.adjacent-train.ahead {
    border-left: 3px solid #10b981;
}

.adjacent-train.behind {
    border-left: 3px solid #3b82f6;
}

.track-container {
    margin-bottom: 30px;
}

.track-label {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.track {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 30px 20px;
    min-height: 120px;
    overflow-x: auto;
    overflow-y: visible;
}

.stations {
    position: relative;
    height: 30px;
    margin-bottom: 20px;
    min-width: 100%;
}

.station {
    position: absolute;
    transform: translateX(-50%);
    text-align: center;
}

.station-dot {
    width: 12px;
    height: 12px;
    background: #4a5568;
    border-radius: 50%;
    margin: 0 auto 5px;
}

.station-name {
    font-size: 0.7rem;
    color: #888;
    white-space: nowrap;
}

.trains {
    position: relative;
    min-height: 60px;
    min-width: 100%;
}

.train {
    position: absolute;
    transform: translateX(-50%);
    text-align: center;
    cursor: pointer;
    /* NO transition/animation - trains appear immediately */
}

.train:hover {
    transform: translateX(-50%) scale(1.1);
    z-index: 10;
}

.train-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: 0 auto 5px;
    border: 2px solid transparent;
}

.train-dot.at-station {
    background: #10b981;
}

.train-dot.between {
    background: #f59e0b;
}

.train-dot.on-time {
    border-color: #10b981;
}

.train-dot.early {
    border-color: #3b82f6;
}

.train-dot.late {
    border-color: #ef4444;
}

.train-dot.highlight {
    background: #f59e0b !important;
    border-color: #fff !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.6); }
    50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.9); }
}

.train-label {
    font-size: 0.65rem;
    color: #e0e0e0;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 5px;
    border-radius: 3px;
}

.train-pv {
    font-size: 0.6rem;
    color: #888;
}

/* Legend */
.legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

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

.legend-item .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-item .dot.between { background: #10b981; }
.legend-item .dot.highlight { background: #f59e0b; border: 2px solid #fff; }

/* Train List */
.train-list-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
}

.train-list-section h3 {
    margin-bottom: 15px;
    color: #f59e0b;
}

.train-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .train-lists {
        grid-template-columns: 1fr;
    }
}

.train-list h4 {
    color: #888;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.train-list ul {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.train-list li {
    padding: 8px 12px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.train-list li:hover {
    background: rgba(255, 255, 255, 0.08);
}

.train-list li.highlight {
    background: rgba(245, 158, 11, 0.2);
    border-left: 3px solid #f59e0b;
}

.train-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.train-service {
    font-weight: 600;
    color: #f59e0b;
}

.train-status {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.train-status.at-station {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.train-status.between {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.deviation {
    font-size: 0.75rem;
}

.deviation.early {
    color: #3b82f6;
}

.deviation.late {
    color: #ef4444;
}

.deviation.on-time {
    color: #10b981;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6578;
}
/* Journey Analysis Section Styles - Improved */
.journey-analysis-section {
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
    border: 2px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.journey-header {
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.journey-analysis-section h3 {
    color: #f59e0b;
    margin-bottom: 8px;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-hint {
    color: #94a3b8;
    margin-bottom: 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.journey-controls {
    display: grid;
    grid-template-columns: 1fr 1.5fr auto;
    gap: 20px;
    align-items: end;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(45, 55, 72, 0.4);
    border-radius: 12px;
}

.journey-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.journey-input-group.time-group {
    gap: 10px;
}

.journey-input-group label {
    color: #f59e0b;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.time-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.journey-select {
    padding: 12px 14px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
    font-size: 14px;
    min-width: 220px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.journey-select:hover {
    border-color: rgba(245, 158, 11, 0.5);
}

.journey-select:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.journey-input {
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
    font-size: 14px;
    transition: all 0.2s ease;
}

.time-input {
    width: 110px;
}

.journey-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.time-display {
    background: rgba(245, 158, 11, 0.15);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    color: #f59e0b;
    font-size: 1.1rem;
    min-width: 70px;
    text-align: center;
}

.journey-buttons {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.journey-buttons .btn-primary,
.journey-buttons .btn-secondary {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    min-width: 140px;
}

.journey-result {
    margin-top: 25px;
}

.journey-summary {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(30, 41, 59, 0.6) 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.summary-item {
    color: #e2e8f0;
    font-size: 0.95rem;
}

.summary-item strong {
    color: #f59e0b;
    font-size: 1.1rem;
}

.journey-table-container {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.journey-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(30, 41, 59, 0.6);
    font-size: 13px;
}

.journey-table thead {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(245, 158, 11, 0.15) 100%);
}

.journey-table th {
    padding: 14px 12px;
    text-align: left;
    color: #fbbf24;
    font-weight: 700;
    border-bottom: 2px solid rgba(245, 158, 11, 0.3);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.journey-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

.journey-table tbody tr {
    transition: background 0.2s ease;
}

.journey-table tbody tr:hover {
    background: rgba(245, 158, 11, 0.08);
}

.journey-table .target-pv-row {
    background: rgba(245, 158, 11, 0.15);
    border-left: 3px solid #f59e0b;
}

.journey-table .target-pv-row:hover {
    background: rgba(245, 158, 11, 0.2);
}

.status-late {
    color: #ef4444 !important;
    font-weight: bold;
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.status-early {
    color: #22c55e !important;
    font-weight: bold;
    background: rgba(34, 197, 94, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.status-on-time {
    color: #3b82f6 !important;
    font-weight: bold;
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

@media (max-width: 900px) {
    .journey-controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .journey-buttons {
        flex-direction: row;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .journey-analysis-section {
        padding: 20px;
    }
    
    .journey-controls {
        padding: 15px;
    }
    
    .journey-table {
        font-size: 11px;
    }
    
    .journey-table th,
    .journey-table td {
        padding: 8px 6px;
    }
    
    .time-controls {
        flex-wrap: wrap;
    }
}

/* Time Suggestions Styles */
.time-suggestions {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(30, 41, 59, 0.6) 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(239, 68, 68, 0.3);
    margin-bottom: 20px;
}

.suggestion-error {
    color: #fbbf24;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.suggestion-prompt {
    color: #94a3b8;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.suggestion-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.suggestion-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(45, 55, 72, 0.8);
    border: 2px solid rgba(245, 158, 11, 0.4);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #e2e8f0;
    font-size: 14px;
}

.suggestion-btn:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    transform: translateY(-2px);
}

.suggestion-arrow {
    font-size: 1.2rem;
}

.suggestion-time {
    font-weight: 700;
    font-size: 1.1rem;
    color: #f59e0b;
}

.suggestion-pv {
    background: rgba(59, 130, 246, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #60a5fa;
}

.suggestion-offset {
    color: #94a3b8;
    font-size: 12px;
}

/* Deviation Chart Section */
.deviation-chart-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.deviation-header {
    margin-bottom: 20px;
}

.deviation-header h3 {
    font-size: 1.5rem;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.deviation-controls {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.deviation-input-group {
    flex: 1;
    min-width: 150px;
}

.deviation-input-group label {
    display: block;
    margin-bottom: 8px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
}

.deviation-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #4a5568;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.deviation-select:hover:not(:disabled) {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.deviation-select:focus {
    outline: none;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.deviation-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.deviation-buttons {
    flex-shrink: 0;
}

.deviation-chart-result {
    margin-top: 20px;
}

.chart-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    border: 1px solid #10b981;
}

.chart-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    max-height: 600px;
    overflow: hidden;
}

#deviationChart {
    max-height: 500px;
}

.chart-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.legend-bar {
    display: inline-block;
    width: 20px;
    height: 12px;
    border-radius: 2px;
    margin-right: 5px;
}

.legend-bar.arr {
    background: rgba(59, 130, 246, 0.7);
}

.legend-bar.dep {
    background: rgba(239, 68, 68, 0.7);
}

.legend-bar.scheduled {
    background: rgba(59, 130, 246, 0.7);
}

.legend-bar.actual {
    background: rgba(239, 68, 68, 0.7);
}

.chart-section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
    margin: 30px 0 20px 0;
}

.chart-subtitle {
    color: #e0e0e0;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    text-align: center;
}

.legend-line {
    display: inline-block;
    width: 20px;
    height: 2px;
    margin-right: 5px;
}

.legend-line.ref {
    background: rgba(16, 185, 129, 0.8);
}

.legend-item {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Time-First Dropdown Styles */
.dropdown-selection {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-top: 25px;
    padding: 20px;
    background: rgba(45, 55, 72, 0.3);
    border-radius: 12px;
}

.dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dropdown-group label {
    color: #f59e0b;
    font-size: 0.9rem;
    font-weight: 600;
}

.dropdown {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown:hover {
    border-color: rgba(245, 158, 11, 0.5);
}

.dropdown:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.time-input {
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
    font-size: 14px;
    transition: all 0.2s ease;
}

.time-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.selected-train-info {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(30, 41, 59, 0.6) 100%);
    border-radius: 12px;
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.selected-train-info h3 {
    color: #f59e0b;
    font-size: 1.3rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-train-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.detail-item {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.detail-label {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.detail-value {
    color: #e2e8f0;
    font-size: 1.1rem;
    font-weight: 600;
}

.detail-value.it {
    color: #3b82f6;
}

.detail-value.ot {
    color: #ef4444;
}

@media (max-width: 900px) {
    .dropdown-selection {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}


/* Stored CSV Dropdown Styles */
.stored-csv-section {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

.stored-csv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stored-csv-header label {
    color: #3b82f6;
    font-size: 1rem;
    font-weight: 600;
}

.btn-refresh {
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid #3b82f6;
    border-radius: 6px;
    color: #3b82f6;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: scale(1.1);
}

.stored-csv-dropdown {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(59, 130, 246, 0.4);
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.stored-csv-dropdown:hover {
    border-color: #3b82f6;
}

.stored-csv-dropdown:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.stored-csv-info {
    margin-top: 12px;
    padding: 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
    font-size: 0.9rem;
    color: #94a3b8;
}

.stored-csv-info .info-item {
    margin: 5px 0;
}

.stored-csv-info .info-label {
    color: #3b82f6;
    font-weight: 600;
}

/* Progress Bar Styles */
.upload-progress {
    margin-top: 15px;
    padding: 15px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #22c55e);
    border-radius: 10px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
}

.progress-text {
    margin-top: 8px;
    text-align: center;
    color: #10b981;
    font-size: 0.9rem;
    font-weight: 600;
}

