body {
    padding: 20px;
    background-color: #f8f9fa;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #2c3e50;
}

.main-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 32px;
    border: 1px solid #e9ecef;
}

.expressway-group {
    background: #6c757d;
    color: white;
    padding: 10px 16px;
    margin: 4px 0;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    position: sticky;
    top: 0;
    z-index: 10;
    border: none;
}

.expressway-option {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.2s ease;
    border-radius: 0;
    margin: 0;
    color: #495057;
}

.expressway-option:hover {
    background-color: #dee2e6;
    color: #212529;
    transform: none;
    border-left: 3px solid #6c757d;
    padding-left: 13px;
}

.expressway-option:last-child {
    border-bottom: none;
}

.dropdown-container {
    position: relative;
}

.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.custom-dropdown.show {
    display: block;
}

.suggestion-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.result-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: none;
}

.card-header {
    font-weight: 600;
    border-radius: 8px 8px 0 0 !important;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa !important;
    color: #495057 !important;
}

.btn-primary {
    background-color: #495057;
    border: 1px solid #495057;
    border-radius: 6px;
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #343a40;
    border-color: #343a40;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 12px 16px;
    transition: all 0.2s ease;
    font-size: 16px;
}

.form-control:focus {
    border-color: #6c757d;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.1);
}

.segment-list {
    max-height: 300px;
    overflow-y: auto;
}

.list-group-item {
    border-radius: 6px !important;
    margin: 4px 0;
    border: 1px solid #e9ecef;
    background: white;
}

#mapContainer {
    height: 400px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.badge {
    border-radius: 4px;
    padding: 6px 10px;
    font-weight: 500;
}

.badge.bg-primary {
    background-color: #6c757d !important;
}

.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-info {
    background-color: #17a2b8 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.title-section {
    text-align: center;
    margin-bottom: 40px;
    color: #2c3e50;
}

.title-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #2c3e50;
}

.title-section p {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 400;
}

.alert {
    border-radius: 6px;
    border: 1px solid;
}

.suggestion-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    color: #495057;
}

/* Mobile optimizations */
@media (max-width: 575.98px) {
    body {
        padding: 15px;
    }

    .main-container {
        padding: 20px;
    }

    .title-section {
        margin-bottom: 30px;
    }

    .title-section h1 {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .title-section p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* Compact title layout for mobile */
    .title-compact {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .title-line-1 {
        font-size: 1.4rem;
        font-weight: 700;
        color: #2c3e50;
        margin: 0;
    }

    .title-line-2 {
        font-size: 1.2rem;
        font-weight: 600;
        color: #495057;
        margin: 0;
    }

    .card-header {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .card-body {
        padding: 15px;
    }

    .form-control {
        padding: 10px 14px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .btn-primary {
        padding: 12px 20px;
        width: 100%;
        margin-top: 10px;
    }

    .expressway-option {
        padding: 12px 14px;
        font-size: 14px;
    }

    .badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .suggestion-content {
        padding: 15px;
        font-size: 0.8rem;
        max-height: 250px;
    }

    .list-group-item {
        padding: 12px;
        font-size: 14px;
    }

    #mapContainer {
        height: 300px;
        margin-bottom: 15px;
    }

    .segment-list {
        max-height: 200px;
    }

    /* Stack cards on mobile */
    .row.g-4 {
        --bs-gutter-y: 1.5rem;
    }
}

/* Small mobile devices */
@media (max-width: 374px) {
    .title-line-1 {
        font-size: 1.25rem;
    }

    .title-line-2 {
        font-size: 1.1rem;
    }

    .main-container {
        padding: 15px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .expressway-option {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .btn-primary {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .form-control {
        min-height: 48px;
    }
}

/* Collapsible route suggestion styles */
.collapse-icon {
    transition: transform 0.3s ease;
}

/* Rotate the chevron when collapsed */
[data-bs-toggle="collapse"][aria-expanded="false"] .collapse-icon {
    transform: rotate(-90deg);
}

/* Button hover effect for the collapsible header */
.card-header .btn-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.card-header .btn-link {
    border: none;
    outline: none;
    box-shadow: none;
    padding: 8px;
    margin: -8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.card-header .btn-link:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.collapse {
    transition: height 0.35s ease;
}

.suggestion-card .card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 575.98px) {
    .card-header .btn-link {
        padding: 6px;
        margin: -6px;
    }
    
    .collapse-icon {
        font-size: 0.9rem;
    }
}

/* Traffic toggle button */
.traffic-toggle {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Expressway segments styling */
.expressway-segments {
    border-left: 4px solid #6c757d;
}

.expressway-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.expressway-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #dee2e6;
}

.step-number {
    background: #6c757d;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.step-details {
    flex: 1;
}

.step-instruction {
    font-weight: 500;
    color: #495057;
    margin-bottom: 4px;
    line-height: 1.4;
}

.step-info {
    font-size: 14px;
    color: #6c757d;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.distance, .duration {
    font-weight: 500;
}

/* Traffic status indicators */
.traffic-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.traffic-light {
    background: #d4edda;
    color: #155724;
}

.traffic-moderate {
    background: #fff3cd;
    color: #856404;
}

.traffic-heavy {
    background: #f8d7da;
    color: #721c24;
}

/* Enhanced route info card */
.route-info-card {
    border-left: 4px solid #28a745;
}

.route-info-card .card-title {
    color: #495057;
    font-size: 1.1rem;
}

/* Expressway-specific map markers */
.expressway-marker {
    background: #6c757d;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile optimizations for traffic info */
@media (max-width: 575.98px) {
    .expressway-step {
        padding: 10px;
        gap: 8px;
    }
    
    .step-number {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
    
    .step-instruction {
        font-size: 14px;
    }
    
    .step-info {
        font-size: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .traffic-status {
        padding: 1px 6px;
        font-size: 11px;
    }
    
    .traffic-toggle {
        text-align: center;
    }
    
    .traffic-toggle .btn {
        width: 100%;
    }
}

/* Enhanced alert styling for expressway context */
.alert.alert-warning {
    border-left: 4px solid #ffc107;
}

.alert.alert-success {
    border-left: 4px solid #28a745;
}

.alert.alert-danger {
    border-left: 4px solid #dc3545;
}

/* Expressway route highlighting */
.route-info-card .expressway-badge {
    background: #6c757d;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 4px;
}

/* Traffic layer toggle styling */
#trafficBtn {
    transition: all 0.2s ease;
}

#trafficBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Segment analysis styling */
.expressway-segments .card-header {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border-bottom: none;
}

.expressway-segments .card-header h6 {
    margin: 0;
    font-weight: 600;
}

/* Animation for step cards */
.expressway-step {
    transition: all 0.2s ease;
}

.expressway-step:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left-color: #6c757d;
}