.history-route-list {
    position: absolute;
    top: 36px;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 10px 10px 0;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(147, 51, 234, 0.4) transparent;
}

.history-route-list::-webkit-scrollbar {
    width: 6px;
}

.history-route-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-route-list::-webkit-scrollbar-thumb {
    background: rgba(147, 51, 234, 0.35);
    border-radius: 3px;
}

.history-route-list::-webkit-scrollbar-thumb:hover {
    background: rgba(147, 51, 234, 0.65);
}

.history-route-item {
    background: white;
    border-radius: 8px;
    padding: 12px 36px 12px 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.history-route-item:hover {
    background: #faf5ff;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.15);
    transform: translateX(4px);
}

.history-route-item.selected {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.history-route-item.selected .route-name {
    color: white;
}

.history-route-item.selected .route-info {
    color: rgba(255, 255, 255, 0.8);
}

.history-route-item .route-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.history-route-item .route-info {
    font-size: 12px;
    color: #666;
}

.history-route-item .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    color: #999;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.history-route-item:hover .delete-btn {
    background: #e53935;
    color: white;
}

.history-route-item.selected .delete-btn {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.history-route-item.selected:hover .delete-btn {
    background: #ff5252;
    color: white;
}

.center-panel {
    width: 20%;
    background-color: #f5f5f5;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    position: relative;
    height: 100%;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
}

.left-panel h2,
.center-panel h2 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    flex-shrink: 0;
}

#tab-planning > h2,
#tab-planning > .area-row,
#tab-planning > .input-group,
#tab-planning > .slider-row,
#tab-planning > .avoid-roads-row {
    flex-shrink: 0;
    min-width: 0;
}

#tab-history > h2 {
    flex-shrink: 0;
}

#tab-history.active {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.route-stats {
    font-size: 13px;
    color: #666;
    margin-left: 8px;
}

.stats-success {
    color: #28a745;
    font-weight: 600;
}

.stats-fail {
    color: #dc3545;
    font-weight: 600;
}

.validation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.validation-box {
    background: #000;
    border-radius: 12px;
    padding: 30px 40px;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.validation-icon {
    width: 40px;
    height: 40px;
    border: 3px solid #fff;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: validation-spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

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

.validation-text {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.validation-progress {
    font-size: 18px;
    color: #fff;
    font-weight: 700;
}

.workflow-output {
    margin-bottom: 20px;
    padding: 15px;
    background-color: transparent;
    border: none;
    border-radius: 0;
    flex: 1;
    min-height: 0;
    height: calc(100vh - 585px);
    overflow-x: hidden;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(147, 51, 234, 0.4) transparent;
}

.workflow-output::-webkit-scrollbar {
    width: 6px;
}

.workflow-output::-webkit-scrollbar-track {
    background: transparent;
}

.workflow-output::-webkit-scrollbar-thumb {
    background: rgba(147, 51, 234, 0.35);
    border-radius: 3px;
}

.workflow-output::-webkit-scrollbar-thumb:hover {
    background: rgba(147, 51, 234, 0.65);
}

.output-placeholder {
    color: #999;
    text-align: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    gap: 8px;
}

.output-placeholder .icon {
    font-size: 24px;
    color: #bbb;
}

.output-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.output-loading {
    color: #9333ea;
    font-weight: 600;
}

.output-error {
    color: #e74c3c;
    font-weight: 600;
}

.route-list {
    margin-top: 15px;
}

.route-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.route-item:hover {
    background: #e9ecef;
    border-color: #9333ea;
}

.route-item.selected {
    background: #f3e8ff;
    border: 2px solid #9333ea;
    box-shadow: 0 2px 8px rgba(147, 51, 234, 0.3);
}

.route-special-roads {
    font-size: 12px;
    color: #e53935;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e0e0e0;
}

.route-item.validating {
    background: #fff3e0;
    border: 2px solid #ff9800;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.route-item.disabled {
    background: #f5f5f5;
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #ccc;
}

.route-item.disabled:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.route-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.status-warning {
    font-size: 16px;
    line-height: 1;
    cursor: help;
}

.route-roads-conflict {
    color: #e53935 !important;
}

.route-item.route-avoid-conflict .route-roads .label {
    color: #e53935;
}

.status-success {
    color: #28a745;
}

.status-fail {
    color: #dc3545;
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #9333ea;
    margin-bottom: 10px;
    font-size: 14px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}

.route-title {
    flex: 1;
    min-width: 0;
}

.route-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.route-header .route-distance {
    color: #9333ea;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.route-info {
    font-size: 13px;
    line-height: 1.8;
}

.route-info .label {
    color: #6c757d;
    font-weight: 500;
}

.route-start,
.route-end,
.route-origin,
.route-destination {
    margin-bottom: 5px;
}

.route-origin,
.route-destination {
    font-size: 12px;
    color: #888;
}

.route-waypoints {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #dee2e6;
    color: #495057;
}

.route-empty {
    text-align: center;
    color: #999;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.route-empty .empty-icon {
    font-size: 48px;
    opacity: 0.6;
}

.route-empty .empty-text {
    font-size: 14px;
}

.route-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #9333ea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: #9333ea;
    font-size: 14px;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
