/* ---------- General App Section & Tab Styles ---------- */
/* These classes are used throughout the app for consistent styling */

/* App Section - General container for content sections */


.bottom-sheet-content {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 0 40px 0; /* Add padding at bottom to ensure content isn't hidden by bottom of viewport */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    flex: 1;
    touch-action: pan-y; /* Allow vertical scrolling only in content */
    position: relative;
    min-height-x: 1000px; /* PLEASE STOP REMOVING OR CHANGING THIS: This is to ensure the bottom sheet max size always fills the veritcal space */
    position: relative; /* Needed for absolute positioning of views */
}

/* --- View Transition Styles (Shared with Desktop) --- */
.view-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--app-section-bg-color);
    box-shadow: var(--app-ui-shadow-panel-inset);
    border-radius: var(--app-ui-border-radius-panel);
    transition: transform 0.3s ease-out;
    transform: translateX(0);
    z-index: 1;
}

#mobile-bottom-sheet .view-container {
    border-radius: 0 0 0 0 !important;
}

.view-default {
    background-color: var(--app-bg-color);
}

.view-route-builder {
    background-color: var(--app-bg-color);
    box-shadow: none;
}

.app-panel {
    display: flex;
    flex-direction: column;
    /* background: var(--app-section-bg-color);
    box-shadow: var(--app-ui-shadow-panel-inset);
    border-radius: var(--app-ui-border-radius-panel); */
}

.app-section {
    background:var(--app-bg-color);
    border-radius: 8px;
    border: 0px solid var(--app-section-border-color); 
    /* box-shadow: 0 2px 8px rgba(22, 22, 22, 0.05); */
    padding: 1.25rem 1.5rem;
}


.app-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-dark);
    margin-bottom: 0.25rem;
    /* background-color: var(--app-bg-color); */
}

/* before makeover
.app-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-dark);
    margin-bottom: 0.25rem;
}

.app-section-title i {
    font-size: 1.2rem;
    color: var(--bs-primary);
}

.app-section-subtitle {
    font-size: 0.75rem;
    color: var(--app-medium-fg-color);
    letter-spacing: 0.02em;
    margin-bottom: 1.25rem;
    margin-left: 0.1rem;
}
*/

.app-section-title--top {
    padding-top: 0.0rem;
}


.app-section-title--tabs {
    padding-left: 1.0rem;
}

.app-section-title i {
    font-size: 1.2rem;
    color: var(--bs-primary);
    /* width: 1.25rem; */
}

.app-section-subtitle {
    font-size: 0.75rem;
    color: var(--app-medium-fg-color);
    letter-spacing: 0.02em;
    margin-bottom: 1.25rem;
    margin-left: 0.25rem; 
    /* padding-bottom: 1rem; */
    /* background-color: var(--app-bg-color);
    box-shadow: var(--app-ui-shadow-panel); */
}

.app-pane-section-control {
    margin-bottom: 1rem;
}

.app-section-body {
    position: relative;
    z-index: 1;
}

.app-section--controls {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    box-shadow: var(--app-ui-shadow-panel);
    border-radius: 0px;
    border-bottom: 1px solid var(--app-section-border-color); 
}

#desktop-side-panel .app-section--controls {
    border-radius: 8px !important;
    /* margin-left: 1.25rem;
    margin-right: 1.25rem; */
    margin-top: 1.25rem;
    margin-bottom: 0.0rem;
    border: 1px solid var(--app-section-border-color); 
}

.app-section--locations {
    background: var(--app-section-bg-color);
    padding: 0.5rem 1.0rem;

}

#desktop-side-panel .app-section--locations {

    margin-top: 1.25rem;
}


.view-manage .app-section--actions {
    margin-top: 0.0rem;
    /* margin-bottom: 1.5rem; */
}

#desktop-side-panel  .view-route-builder  .app-section--actions{
    /* margin-top: 0.0rem;
    border-radius: var(--app-ui-border-radius-panel) !important;
    margin-left: 0.0rem;
    margin-right: 0.0rem; */
    /* padding: 1.25rem;
    background-color: var(--app-section-bg-color);
    box-shadow: var(--app-ui-shadow-panel-inset); */
    /* margin: 1.25rem; */
}

#desktop-side-panel  .app-section--actions-home {
    margin-top: 1.5rem;
    border-radius: 0px;
    margin-left: 1.25rem;
    margin-right: 1.25rem;
}


#desktop-side-panel .app-section--actions-home {
    margin-top: 0.0rem;
    margin-left: 0.0rem;
    margin-right: 0.0rem;
}


#desktop-side-panel .view-profile .app-section--actions-home {
    margin-left: 1.25rem;
    margin-right: 1.25rem;
}

.app-section--actions {
    margin-top: 1.5rem;
    border-radius: 0px;
}


.app-section--actions-home {
    margin-top: 1.5rem;
    border-radius: 0px;
    margin-left: 1.25rem;
    margin-right: 1.25rem;
}


.app-section--tabs {
    padding: 0;
    overflow: hidden;
    /* margin-top: 1.5rem;    */
    border-radius: 0px;
    
}

#desktop-side-panel .app-section--tabs {
    padding: 0;
    overflow: hidden;
    margin-top: 0.0rem;
    border-radius: 0px;
    border-width: 0px;
}

#mobile-bottom-sheet .app-section--tabs {
    /* box-shadow: var(--app-ui-shadow-panel),var(--app-ui-shadow-panel-top); */

}

.app-tabs-nav-wrapper {
    padding: 1rem 0rem 0.6rem;;
    background: var(--app-bg-color);
    /* border-bottom: 1px solid var(--app-section-border-color);  */
    border-top: 1px solid var(--app-section-border-color); 
    
}

#desktop-side-panel .app-tabs-nav-wrapper {
    border-top: 0px; 
    
}
.app-section-white-bg {
    background: var(--app-bg-color);
}
.app-section-spacer-bottom {
    min-height: 1.5rem;
    background: var(--app-section-bg-color);
    box-shadow: var(--app-ui-shadow-panel-inset);
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
    border-bottom-left-radius: var(--app-ui-border-radius-panel);
    border-bottom-right-radius: var(--app-ui-border-radius-panel);
}

#desktop-side-panel .view-route-viewer .app-pane-container {
    background: var(--app-section-bg-color);
    box-shadow: var(--app-ui-shadow-panel-inset);
    border-radius: var(--app-ui-border-radius-panel);
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-bottom: 1.25rem;
}


#desktop-side-panel .view-route-builder .app-pane-container {
    background: var(--app-section-bg-color);
    box-shadow: var(--app-ui-shadow-panel-inset);
    border-radius: var(--app-ui-border-radius-panel);
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-bottom: 1.25rem;
}


#desktop-side-panel .view-default .app-pane-container {
    background: var(--app-section-bg-color);
    box-shadow: var(--app-ui-shadow-panel-inset);
    border-radius: var(--app-ui-border-radius-panel);
    padding: 1.25rem;
}

#mobile-bottom-sheet .view-route-viewer .app-pane-container {
    background: var(--app-section-bg-color);
    box-shadow: var(--app-ui-shadow-panel-inset);
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-bottom: 1.25rem;
}

#mobile-bottom-sheet .view-route-builder .app-pane-container {
    background: var(--app-section-bg-color);
    box-shadow: var(--app-ui-shadow-panel-inset);
    padding-bottom: 1.25rem;
}


#mobile-bottom-sheet .view-default .app-pane-container {
    background: var(--app-section-bg-color);
    box-shadow: var(--app-ui-shadow-panel-inset);
    padding-bottom: 1.25rem;
}

.app-pane-section {
    background: var(--app-section-bg-color);
    border-radius: 8px;
    border: 0px solid var(--app-bg-color); 
    /* box-shadow: 0 2px 8px rgba(22, 22, 22, 0.05); */
    padding: 0rem 0rem;
    margin-bottom: 1rem;
}

.app-pane-widget {
    background: var(--app-bg-color);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    border: 1px solid var(--app-section-border-color);
    box-shadow: var(--app-ui-shadow-panel);
}

.app-pane-section--metrics {
    background: var(--app-bg-color);
    border: 1px solid var(--app-section-border-color); 
    box-shadow: var(--app-ui-shadow-panel);
    padding: 0.75rem 0.75rem;
    margin-bottom: 2rem;
}


/* Tab Content */
.app-tabs-content {
    padding: 1.25rem;
    box-shadow: var(--app-ui-shadow-panel-inset);
    background-clip: padding-box; 
    border-radius: var(--app-ui-border-radius-panel);
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--app-section-border-color); 
    background: var(--app-section-bg-color);
}

.app-tab-pane {
    padding: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
}


/* Tab Navigation */
.app-tabs-nav {
    border-bottom: 0;
    gap: 0.5rem;
    display: flex;
    padding-left: 1rem;
    padding-right: 1rem;
}

.app-route-alert {
    margin-top: 1rem;
    margin-left: 1rem;  
    margin-right: 1rem; 
    margin-bottom: 0rem; 
}

.app-pane-text {
    font-size: 0.75rem;
    color: var(--app-medium-fg-color);
    letter-spacing: 0.02em;
}


.panel-shadow-top-bottom {
  box-shadow:  var(--app-ui-shadow-panel),var(--app-ui-shadow-panel-top);
}


.panel-shadow-top {
  box-shadow:  var(--app-ui-shadow-panel-top);
}

@media (max-width: 767px) {


    /* Ensure the tab content can scroll if needed within the main sheet scroll */
    .app-tab-content {
        flex-grow: 1; /* Allow tab content to expand */
        /* overflow-y: auto; */ /* NO - Let the parent .bottom-sheet-content handle scroll */
        min-height: 200px; /* Give it some minimum height */
    }

}


.app-section--meta {
    padding-bottom: 1rem;
    margin-top: 1rem;
}

.app-section-description {
    font-size: 0.95rem;
    color: rgba(0, 0, 0, 0.7);
}

.app-section-description > :last-child {
    margin-bottom: 0;
}








.app-tabs-nav .nav-item {
    margin-bottom: 0;
    flex: 1 1 0;
    min-width: 0;
}

.app-tabs-nav .nav-link {
    border-color: var(--app-section-border-color);
    border-radius: 8px;
    border-width: 1px;
    background: var(--app-bg-color);
    color: var(--bs-dark);
    padding: 0.8rem 0.45rem;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    min-height: 84px;
    box-shadow: var(--app-ui-shadow);
}

.app-tabs-nav .nav-link i {
    font-size: 1.4rem;
    color: var(--bs-dark);
    transition: color 0.2s ease;
    margin: 0;
}

.app-tabs-nav .nav-link:hover {
    color: var(--bs-primary);
}

.app-tabs-nav .nav-link:hover i {
    color: var(--bs-primary);
}

.app-tabs-nav .nav-link.active {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: var(--app-lightest-fg-color) !important;
    border-width: 0px;
    box-shadow: var(--app-ui-button-shadow-subtle);
}

.app-tabs-nav .nav-link.active i {
    color: var(--app-lightest-fg-color);
}




/* Getting Started Alert Close Button */
.alert-primary .btn-close-custom {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.alert-primary .btn-close-custom:hover {
    opacity: 1;
}

.alert-primary .btn-close-custom i {
    font-size: 1rem;
    font-weight: bold;
}


/* New Route Details Grid Styles */
.route-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    /* margin-bottom: 1rem; */
}

.route-metric {
    display: flex;
    align-items: flex-start;
    padding: 8px;
    /* background-color: rgba(248, 249, 250, 0.7); */
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.route-metric:hover {
    /* background-color: rgba(248, 249, 250, 1); */
}

.route-metric i {
    font-size: 1.2rem;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.route-metric-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.route-metric-label {
    font-size: 0.8rem;
    color: #6c757d;
    display: block;
    margin-bottom: 2px;
}

.route-metric-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.safety-meter {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    width: 100%;
    max-width: 80px;
    overflow: hidden;
}

.safety-indicator {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Route Locations Section (Start/End Addresses) */
.route-locations {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: .5rem;
}

.location-card {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    transition: all 0.2s ease;
    background: var(--app-bg-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--app-section-border-color);
    box-shadow: 0 2px 8px rgba(22, 22, 22, 0.05);
}

.location-card:hover {
    background: rgba(248, 249, 250, 0.5);
    border-color: rgba(22, 22, 22, 0.12);
}

.location-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 12px;
    flex-shrink: 0;
}

.location-icon i {
    font-size: 1.3rem;
}

.location-content {
    flex: 1;
    min-width: 0;
}

.location-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 4px;
}

.location-value {
    font-size: 0.95rem;
    line-height: 1.4;
    color: rgba(0, 0, 0, 0.85);
    word-wrap: break-word;
}

.location-value--placeholder {
    color: rgba(0, 0, 0, 0.45);
    font-style: italic;
    font-weight: 400;
}


/* direcitons start and end */

/* Directions Locations List */
.directions-locations-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.directions-location-item {
    background: var(--app-lightest-fg-color);
    border: 1px solid var(--app-section-border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    box-shadow: var(--app-ui-shadow);
}

.directions-location-item:hover {
    border-color: var(--app-accent);
    box-shadow: 0 2px 8px rgba(22, 22, 22, 0.08);
}


.transit-line-indicator {
    width: 4px;
    height: 24px;
    border-radius: 2px;
}

.transit-line-name {
    font-size: 0.85rem;
}



.tab-pane .list-group-item {
    border-top: none;
    border-bottom: 1px solid #eee;
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
}

.tab-pane .list-group-item:last-child {
    border-bottom: none;
}

/* ---------- Mobile Overrides ---------- */
@media (max-width: 767px) {


    .app-tabs-nav .nav-link {
        min-height: 74px;
        padding: 0.65rem 0.35rem;
        font-size: 0.68rem;
        letter-spacing: 0.04em;
    }

    .mobile-side-margin {
        margin-left: 1.0rem;
        margin-right: 1.0rem;
    }

    .mobile-flush {
        margin-left: 0.0rem;
        margin-right:0.0rem;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        padding: 1rem 1.25rem;
    }

    .route-metrics-grid {
        gap: 8px;
    }

    .route-metric {
        padding: 6px;
    }

    .route-metric-value {
        font-size: 1rem;
    }

    .route-metric i {
        font-size: 1.1rem;
    }

    .location-card {
        padding: 10px;
    }

    .location-icon {
        width: 28px;
        height: 28px;
    }

    .location-icon i {
        font-size: 1.2rem;
    }

    .location-value {
        font-size: 0.9rem;
    }

    #map-container,
    #map {
        touch-action: none;
        -webkit-overflow-scrolling: touch;
    }

    .maplibregl-canvas {
        touch-action: none;
        cursor: pointer;
    }

    .maplibregl-canvas-container {
        touch-action: none;
    }

}