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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #f5f5f5;
    overflow: hidden;
}

#app {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.title {
    font-size: 1.5rem;
    font-weight: 700;
}

.city-selector {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
}

.city-selector option {
    background: #1d4ed8;
}

.zoom-indicator {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Main Container */
.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebars */
.sidebar {
    background: white;
    padding: 1rem;
    overflow-y: auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.sidebar-left {
    width: 260px;
    border-right: 1px solid #e5e7eb;
}

.sidebar-right {
    width: 280px;
    border-left: 1px solid #e5e7eb;
}

.sidebar h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #374151;
}

.sidebar h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #6b7280;
}

/* Vehicle Palette */
.vehicle-palette {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.vehicle-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.5rem;
    align-items: center;
}

.vehicle-btn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-1px);
}

.vehicle-btn.selected {
    border-color: #2563eb;
    background: #dbeafe;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.vehicle-icon {
    font-size: 1.5rem;
    grid-row: 1 / 3;
}

.vehicle-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #111827;
}

.vehicle-cost {
    font-size: 0.75rem;
    grid-row: 1;
    grid-column: 3;
}

.vehicle-capacity {
    font-size: 0.7rem;
    color: #10b981;
    grid-row: 2;
    grid-column: 2 / 4;
}

/* Elevation Control */
.elevation-control {
    background: #f9fafb;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
}

.elevation-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.elevation-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.elevation-btn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.elevation-btn.active {
    border-color: #2563eb;
    background: #dbeafe;
    font-weight: 600;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#canvas {
    display: block;
    cursor: crosshair;
}

.mode-indicator {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    pointer-events: none;
}

/* Bottom Toolbar */
.bottom-toolbar {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.zoom-controls,
.mode-controls,
.action-controls {
    display: flex;
    gap: 0.5rem;
}

.bottom-toolbar button {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.bottom-toolbar button:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.bottom-toolbar button.active {
    border-color: #2563eb;
    background: #dbeafe;
}

/* Routes List */
.routes-list {
    max-height: 400px;
    overflow-y: auto;
}

.empty-state {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 2rem 1rem;
}

.route-item {
    background: #f9fafb;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.route-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.route-icon {
    font-size: 1.25rem;
}

.route-name-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.route-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.route-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-delete:hover {
    opacity: 1;
}

/* Route Stats */
.route-stats {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e5e7eb;
}

.stat {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.stat span:first-child {
    color: #6b7280;
}

.stat span:last-child {
    font-weight: 600;
    color: #111827;
}

/* Info Panel */
.info-panel {
    position: absolute;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    max-width: 300px;
    pointer-events: none;
    z-index: 1000;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}

.close:hover {
    color: #111827;
}

.tutorial-content h2 {
    margin-bottom: 1rem;
    color: #111827;
}

.tutorial-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #374151;
}

.tutorial-content ol,
.tutorial-content ul {
    margin-left: 1.5rem;
    line-height: 1.6;
}

.tutorial-content li {
    margin-bottom: 0.5rem;
}

.tutorial-content p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.footer a {
    color: #60a5fa;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer button {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.footer button:hover {
    background: rgba(255,255,255,0.2);
}

.version {
    color: #9ca3af;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar-left,
    .sidebar-right {
        position: absolute;
        height: calc(100% - 60px);
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar-right {
        right: 0;
        transform: translateX(100%);
    }
    
    .bottom-toolbar {
        flex-wrap: wrap;
        max-width: 90%;
    }
}