:root {
    --primary-color: #1a6aff;
    /* Vibrant Blue */
    --secondary-color: #eff4ff;
    /* Light Blue Background */
    --text-color: #334155;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --bg-white: #ffffff;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --sidebar-width: 400px;
    --font-family: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

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

html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* App-like feel */
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
}

.app-container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
}

.close-sidebar-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    display: none;
    /* Only show on mobile */
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Panel Sections */
.panel-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Inputs */
.input-group {
    margin-bottom: 1rem;
    position: relative;
}

.input-group label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

.input-wrapper .prefix {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    font-weight: 600;
}

input[type="text"],
input[type="number"],
input[type="date"] {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-color);
    background: #f8fafc;
    transition: all 0.2s;
}

input[type="number"] {
    padding-left: 1rem;
}

.input-wrapper:has(.prefix) input {
    padding-left: 2rem;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px var(--secondary-color);
}

/* Suggestions Dropdown */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 100;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
    display: none;
}

.suggestions li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.suggestions li:hover {
    background: var(--secondary-color);
}

/* Buttons */
.btn-secondary {
    width: 100%;
    padding: 0.75rem;
    background: white;
    border: 2px dashed var(--primary-color);
    color: var(--primary-color);
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: var(--secondary-color);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(26, 106, 255, 0.4);
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px -1px rgba(26, 106, 255, 0.4);
}

.btn-text {
    width: 100%;
    padding: 0.75rem;
    background: none;
    border: none;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-text:hover {
    color: var(--danger-color);
    background: #fef2f2;
    border-radius: var(--radius);
}

/* Transport Selector */
.transport-selector {
    display: flex;
    gap: 0.5rem;
    background: #f8fafc;
    padding: 0.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.transport-btn {
    flex: 1;
    border: none;
    background: none;
    padding: 0.5rem;
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.transport-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    font-weight: bold;
}

/* Grid Layouts */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Results Summary */
.results-summary {
    background: #0f172a;
    color: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.result-item {
    display: flex;
    flex-direction: column;
}

.result-item .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.result-item .value {
    font-size: 1.25rem;
    font-weight: 800;
}

.result-item .value.green {
    color: var(--success-color);
}

.result-item .value.yellow {
    color: var(--warning-color);
}

.alert-box {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger-color);
    color: #fca5a5;
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    align-items: center;
    margin-top: 0.5rem;
}

.alert-box i {
    font-size: 1.5rem;
    color: var(--danger-color);
}

/* Map area */
.map-container {
    flex: 1;
    background: #e2e8f0;
    position: relative;
    z-index: 1;
}

.toggle-sidebar-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    font-size: 1.25rem;
    display: none;
    color: var(--text-color);
}

.toggle-sidebar-btn:hover {
    background: var(--secondary-color);
}

.toggle-traffic-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    font-size: 1.25rem;
    color: var(--text-color);
    transition: all 0.2s;
}

.toggle-traffic-btn:hover {
    background: var(--secondary-color);
}

.toggle-traffic-btn.active {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

/* Waypoints removal */
.waypoint-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.waypoint-item .remove-btn {
    color: var(--danger-color);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

/* Custom Pin Reset */
.custom-pin {
    background: none;
    border: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        transform: translateX(-100%);
        z-index: 3000;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .close-sidebar-btn {
        display: block;
    }

    .toggle-sidebar-btn {
        display: block;
    }
}