* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    background: #f7f9fb;
    color: #222;
}

/* --- Header --- */
.app-header {
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: white;
    padding: 0.8rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
}

.logo {
    width: 32px;
    height: 32px;
    margin-right: 0.75rem;
}

.nav-links a {
    color: white;
    margin-left: 1rem;
    text-decoration: none;
    font-weight: 500;
}

.nav-links a:hover {
    text-decoration: underline;
}

/* --- Main --- */
.container {
    max-width: 1100px;
    margin: 1rem auto 3rem;
    padding: 0 1rem;
}

.controls {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.form-group {
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.form-group label {
    font-size: 0.9rem;
    color: #4a4a4a;
}

input, select {
    padding: 0.5rem;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 1rem;
}

button {
    padding: 0.6rem 1.6rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

button:hover:not(:disabled) {
    background: #1d4ed8;
}

button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    padding: 0.6rem 1.6rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dropdown-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 220px;
    overflow: hidden;
    z-index: 1000;
}

.dropdown-menu a {
    display: block;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: #222;
    font-size: 0.95rem;
}

.dropdown-menu a:hover {
    background: #2563eb;
    color: white;
}

.dropdown.open .dropdown-menu {
    display: block;
}

#map {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

#routeInfo {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);    
}

.about {
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.about a {
    color: #2563eb;
    text-decoration: none;
}
.about a:hover {
    text-decoration: underline;
}

.app-footer {
    background: linear-gradient(180deg, #111827, #0f172a);
    color: #ddd;
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.app-footer a {
    color: #93c5fd;
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 700px) {
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
}


@media (prefers-color-scheme: dark) {
    body {
        background: #0f172a;
        color: #e5e7eb;
    }

    .app-header {
        background: linear-gradient(90deg, #1e3a8a, #1e40af);
        box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    }

    .controls,
    #routeInfo,
    .about {
        background: #1e293b;
        color: #e5e7eb;
        box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    }

    input,
    select {
        background: #334155;
        border: 1px solid #475569;
        color: #f1f5f9;
    }

    input::placeholder,
    select option {
        color: #cbd5e1;
    }

    button {
        background: #3b82f6;
        color: white;
        box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    }

    button:hover:not(:disabled) {
        background: #2563eb;
    }

    .dropdown-menu {
        background: #1e293b;
        box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    }
    .dropdown-menu a {
        color: #f1f5f9;
    }
    .dropdown-menu a:hover {
        background: #2563eb;
        color: white;
    }

    .form-group label {
        color: #e5e7eb;
    }

    #map {
        box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    }

    .app-footer {
        background: linear-gradient(180deg, #0f172a, #1e293b);
        color: #cbd5e1;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .app-footer a {
        color: #60a5fa;
    }

    .nav-links a {
        color: #e0e7ff;
    }

    .nav-links a:hover {
        text-decoration: underline;
        color: #93c5fd;
    }
}