/* CSS specific to this application only */

/* The legend is deeply embedded in main.js so it's easier to let it build then hide it */
#legend {
    display: none;
}

#searchDiv {
    border: 2px solid #6c757d;
    display: none;
}

.h4 {
    margin-top: 0rem;
}

.filterItems {
    overflow: auto;
    max-height: 80%;
    position: fixed;
    padding: 5px;
    width: 15rem;
    color: black;
    background-color: #fbfdfd;
}

.filterItem {
    font-size: 14px;
}

.rms-navbar.disabled-initially {
    opacity: 0.5;
}

.labelVehicleType {
    width: 170px;
}

.btn-check:active+.btn-secondary,
.btn-check:checked+.btn-secondary,
.btn-secondary.active,
.btn-secondary:active {
    color: #fff !important;
    background-color: #002664 !important;
    border-color: #002664 !important;
}

/* popup styling */
#popupWindow {
    display: none;
    z-index: 999;
    width: 450px;
    position: absolute;
    background-color: rgb(250, 250, 250);

    /* height: 100%; */
    overflow: auto;
}

#popupContents {
    height: 100%;
}

#popupHeader {
    background-color: #00aa45; /* This can change dynamically now based on site types. */
    color: #fff;
    padding: 10px;
    /* padding-right: 50px; */

    display: flex;
    flex-direction: row;
}

.popupTitleContainer {
    display: flex;
    flex-direction: column;
    flex: 1;
    align-self: flex-start;
}

.popup-title {
    font-size: 24px;
}

.popup-subtitle {
    font-size: 14px;
    margin-top: 0rem !important;
}

.h4 {
    margin-top: 0rem;
}

.popupFacilities {
    font-size: 12px;
}

/***
Initially we used positioning to position the buttons within this container.

However, it does not work well on some physical iPhone/iPad devices.

Using transform also did not work.

Finally it is now working with:
    - Just using flex.
    - No width and height are set explicitly.
    - The inner buttons are both consistent in terms of HTML structures.
***/
#popupButtonsContainer {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-evenly;
}

#btnClosePopup {
    padding: 0 0.2rem;
    color: #fff;
    font-weight: bold;
    font-size: 28px;
    background: transparent;
    border: none;
    cursor: pointer;

    display: flex; /* Helps to position the image to the top. */
}

#btnSiteTypesLegendPopup {
    padding: 0 0.2rem;
    color: #fff;
    font-weight: bold;
    font-size: 28px;
    background: transparent;
    border: none;
    cursor: pointer;

    display: flex; /* Helps to position the image to the top. */
}

#btnSiteTypesLegendPopup img, #btnClosePopup img {
    width: 20px;
    height: 20px;
}

.popupSummary {
    font-size: 14px;
    margin-bottom: 0;
}

.popupSummary li {
    padding: 0.25rem;
}

.icon-text {
    font-size: 0.8rem;
    margin: 0 0 0 0.25rem;
    padding: 0;
}

.facilities-wrapper {
    padding: 0 1rem;
}

.facility-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0.25rem 0;
}
.facility-item > img {
    width: 24px;
    height: 24px;
}

#streetViewImage {
    height: 120px;

    display: flex;
    flex-direction: row;
    justify-content: center;

    border: none !important;
    background-color: transparent !important;

    margin-top: 1.25rem;
    ;
}

a.streetviewLink,
a.streetviewLink:visited,
a.streetviewLink:hover {
    text-decoration: none;
    color: #000;
}


#tcModalBody {
    overflow: auto;
    /* top: -4rem; */
    /* Not sure why the negative value works well. */
    max-height: 100%;
}

.vehicleSelectorImage {
    width: 100px;
    cursor: pointer;
}

.modalText {
    font-size: 12px;
    align-content: "left";
}

#vehicle-type-nav-buttons {
    display: block;
}

#network {
    display: none;
    /* 'flex' on smaller devices with media query. */
    position: absolute;
    z-index: 1000;
}

#networkFilter {
    display: none;
    /* This is always hidden initially regardless of screen size. */
    z-index: 1000;
    overflow: auto;
    max-height: 55%;
    width: 15rem;
    background: white;
    left: 15px;
}

#networkFilterIcon {
    display: none;
    /* 'block' on smaller devices with media query. */
    z-index: 1000;
    overflow: auto;
    max-height: 55%;
    width: 55px;
    background: white;
}

#networkFilterIconRight {
    /* right means to open */
    display: none;
    /* Dynamically set by JS for smaller screens. */
    z-index: 1000;
    overflow: auto;
    max-height: 55%;
    width: 55px;
    background: white;
}

#networkFilterIconLeft {
    /* left means to close */
    display: none;
    /* Dynamically set by JS for smaller screens. */
    z-index: 1000;
    overflow: auto;
    max-height: 55%;
    width: 55px;
    background: white;
}

#filter {
    border: "border-primary";
}

#networkHeader {
    position: relative;
    top: 0;
    right: 0;
    width: 15rem;
    height: 55px;
    line-height: 55px;
    color: #fff;
    background-color: #002664;
    text-align: center;
    pointer-events: all;
}

.modalTitle {
    text-align: center !important;
    flex-shrink: 0;
    align-items: center;
    color: #fff;
    background-color: #002664;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.tcCloseButton {
    background-color: #002664;
    color: #fff;
    border-radius: 4px;
}

.search-mar {
    margin: 0 0rem;
    /* give a higher value to make sure its always top */
    z-index: 99;
}

#modalBody {
    max-height: 100%;
    top: 0rem;
}

.modal-dialog {
    max-width: 650px !important;
    margin: 1.75rem auto;
}

.driverMessage {
    position: absolute;
    border: 2px solid;
    border-radius: 12px;
    border-color: #002664;
    border-radius: 5px;
    right: 0.5rem;
    bottom: 60px;
    display: inline-block;
    width: 240px;
    color: black;
    outline: none;
    margin-bottom: 50px;
}

@media only screen and (max-width: 1280px) {
    .logo-img {
        height: 1.5rem;
    }

    #networkFilterIconRight {
        display: block;
        /* 'block' when the panel is in closed state; 'none' when panel is in opened state */
    }

    #networkFilterIconLeft {
        display: none;
        /* 'none' when the panel is in closed state; 'block' when panel is in opened state */
    }

    #network {
        display: flex;
    }

    #vehicle-type-nav-buttons {
        display: none;
    }

    #networkFilterIcon {
        display: block;
    }

    #popupWindow {
        /* In small screens the popup fills the width automatically. */
        width: 100%;
        max-width: 450px;
        /* max-height: 90%; */
    }
}

@media only screen and (max-width: 767.98px) {
    #pageTitle {
        color: #002664;
        font-size: 1.5rem;
        margin: 0.75rem;
        padding: 0;
        width: unset;
    }

    .info-text {
        margin-top: 15px;
        font-size: 12px;
    }

    .fa-circle-question {
        margin-left: 10%;
        font-size: 80%;
    }

    
    #network {
        display: flex;
    }

    .driverMessage {
        position: absolute;
        border: 2px solid;
        border-radius: 12px;
        border-color: #002664;
        border-radius: 5px;
        right: 0.5rem;
        bottom: 60px;
        display: inline-block;
        width: 240px;
        color: black;
        outline: none;
        margin-bottom: 0px;
    }

}

@media screen and (min-width: 653px) and (max-width: 654px) {
    .driverMessage {
        position: absolute;
        border: 2px solid;
        border-radius: 12px;
        border-color: #002664;
        border-radius: 5px;
        right: 4rem;
        bottom: 60px;
        display: inline-block;
        width: 240px;
        color: black;
        outline: none;
        margin-bottom: 0px;
    }
}

@media screen and (min-width: 720px) and (max-width: 740px) {
    .driverMessage {
        position: absolute;
        border: 2px solid;
        border-radius: 12px;
        border-color: #002664;
        border-radius: 5px;
        right: 0.5rem;
        bottom: 60px;
        display: inline-block;
        width: 240px;
        color: black;
        outline: none;
        margin-bottom: 0px;
    }
}


/* Landscape on smaller devices. */
@media screen and (min-width: 601px) and (max-width: 1280px) {
    #pageTitle {
        padding-left: 1rem;
        font-size: 2rem;
        font-family: 'Public Sans';
        font-style: normal;
        font-weight: 700;
        color: #002664;
    }
}

@media screen and (max-height: 460px) {
    /* #popupWindow {
        max-height: 90%;
    } */

    #filter .filterItems {
        /* This enables scrollbar on small screen landscape mode for the legend. */
        height: 200px;
    }

    #networkFilter .filterItems {
        height: unset;
    }
}

@media screen and (min-height: 1024px) and (max-height: 1440px) {

    /* One-off fix - this fixes the modal position in iPad Air & iPad Pro; not sure why. */
    #tcModalBody {
        top: 0;
    }
}

.driverMessageHeader {
    display: flex;
    align-items: center;
    padding: .5rem .75rem;
    color: white;
    background-color: #002664;
    background-clip: padding-box;
}

.driverMessageBody {
    padding: .75rem;
    word-wrap: break-word;
    background-color: white;
    border-radius: 5px;
}

.closebtn {
    margin-left: 50px;
    color: white;
    font-weight: bold;
    float: right;
    font-size: 28px;
    line-height: 15px;
    cursor: pointer;
    transition: 0.3s;
}

#street-map-hint {
    position: absolute;
    bottom: 61px;
    right: 410px;
    /* display: none; */
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: 12px;
    z-index: 998;
    width: 34px;
    padding: 0 0.5rem;
    border-radius: 4px;
    height: 34px;
    background-color: #fff;
    cursor: pointer;

    text-overflow: clip;
    white-space: nowrap;
    overflow: hidden;
}

.animate-increase-width {
    animation-name: increaseWidth;
    animation-duration: 0.5s;
    animation-fill-mode: forwards;

}

@keyframes increaseWidth {
    from {
        width: 34px;
        /* Initial width */
    }

    to {
        width: 14rem;
        /* Final width */
    }
}

.animate-decrease-width {
    animation-name: decreaseWidth;
    animation-duration: 0.5s;
    animation-fill-mode: forwards;

}

@keyframes decreaseWidth {
    from {
        width: 14rem;
    }

    to {
        width: 34px;
    }
}

.btns {
    float: right;
}

.btn:hover {
    background-color: RoyalBlue;
}

/* White btn-header style */
btn-header {
    background-color: white;
    color: black;
    padding: 10px 0;
    text-align: center;
    border-bottom: 1px solid #ddd;
    /* Optional: adds a border line */
    width: 100%;
}

/* Ensure the buttons are equal in width and height, and rounded edges */
.border-between {
    border-right: 1px solid #ddd;
}

/* Ensure container covers most of the screen, and align content to the top */
.container-fullscreen {
    height: calc(90vh - 50px);
    /* Adjust height to account for btn-header */
    display: flex;
    flex-direction: column;
    /* Stack items vertically */
    justify-content: flex-start;
    /* Align items at the top */
    align-items: center;
    /* Center items horizontally */
    margin-top: 10px;
    /* Margin to separate from the btn-header */
}

.btn-square i {
    font-size: 2rem;
    /* Larger icon size */
}

.car-icon {
    color: #f0e9e9;
    /* Blue color for the car icon */
}

.truck-icon {
    color: #f0e9e9;
    /* #002664 color for the truck icon */
}

.btn-description {
    margin-top: 1rem;
    /* Space above the btn-description */
    text-align: center;
    color: white;
    /* Center the text */
}

.btn-li {
    text-align: left;
    /* Center the text */
    font-size: small;
}

.tabs-underlined {
    display: flex;
    align-items: center;
}

/* info page div*/
.info-tab-content {
    height: 100%;
    width: 100%;
    word-wrap: break-word;
    padding-top: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
    padding-left: 20px;

}

/* Custom CSS for the tab underline */
.nav-tabs .nav-link {
    border: none;
}

.nav-tabs .nav-link.active {
    border-bottom: 3px solid #ff1100;
    border-left: 2px solid blue;
    border-right: 2px solid blue;
    border-top: 2px solid blue;
}

/* Ensuring the tab content fills the remaining space */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}



.mobile-tabs {
    display: none;
    flex-grow: 1;
    height: 100%;
}

.tab-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Scrollbar for larger content */
    padding: 0px;

    position: relative;
}

.tab-pane {
    flex-grow: 1;
    overflow-y: auto;
    /* Vertical scrollbar for each tab content */
}

/* Ensure footer sticks at the bottom */
footer {
    border-top: 2px solid #dee2e6;
    padding: 0px !important;
    background-color: #f8f9fa;
    text-align: center;
}

/* Desktop layout: Fixed width for the side panel */
.desktop-layout {
    display: none;
    flex-grow: 1;
    /* Make sure it grows to fill the entire page */
}

.desktop-layout .main-map-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 0px;
    overflow-y: auto;
    /* Ensure it scrolls if content is large */
}


.mobile-map-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 0px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    /* Ensure it scrolls if content is large */
}

.side-content {
    width: 340px;
    border-left: 2px solid #CDD3D6;
    padding: 0px;
    display: flex;
    flex-direction: column;
}

.side-content .tab-content {
    flex-grow: 1;
    overflow-y: auto;
}

.accordion {
    flex-grow: 1;
    overflow-y: auto;
}

.accordion-body {
    flex-grow: 1;
    overflow-y: auto;
}

#legendContent {
    flex-grow: 1;
    overflow-y: auto;
}

.map-container {
    display: flex;
    flex-grow: 1;
}

.legendRow {
    border-bottom: none
}

.hidden-section {
    display: none;
}

#legendContent .accordion-item table td,
table th {
    border-bottom: none;
}

/* The Modal (background) */
.surveyModal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(00, 0);
    background-color: rgba(0, 0, 0, 0.4);
}

/* Modal Content */
.survey-modal-content {
    position: absolute;
    min-width: 25rem;
    min-height: 22rem;
    left: 50%;
    top: 50%;
    border-radius: 5px;
    background-color: #fff;
    transform: translate(-50%, -50%);
}

#openSurveyBtn {
    background-color: #2E5299;
    border-color: #2E5299;
}

.nsw-in-page-nav {
    padding-top: 0rem !important;
    padding-bottom: 0rem !important;
    margin: 0rem !important;
}

.rest_area_number{
    display: none;
}

/* Media query for screens larger than 768px (desktop view) */
@media (min-width: 768px) {
    .nsw-header__icon {
        display: flex;
        justify-content: center;
        padding-left: .75rem !important;
    }

    .logo-img-nsw {
        height: 76px;
    }

    .mobile-tabs {
        display: none;
        /* Hide mobile tabs */
    }

    .reviver-item{
        display: none;
    }

    /* .reviver-item-desktop {
        display: block;
    } */

    .desktop-layout {
        display: flex;
        /* Show desktop layout */
        height: 100%;
        width: 100%;
    }

    /* ensure tabs got underline */
    .tabs-underlined {
        .tab-underlined {
            color: black;
            font-size: large;
            padding: 8px;
            margin: 0px 0px;
            opacity: .4;
            cursor: pointer;
            text-decoration: none;
            /* border-bottom: 4px solid transparent; */
            border-bottom: 2px solid #CDD3D6;
            display: block;
        }

        .tab-underlined:hover {
            opacity: 0.5;
        }

        .tab-underlined.active {
            opacity: 1;
            border-bottom: 4px solid #FF0000;
        }
    }

    #legendHeader {
        height: 55px;
        line-height: 55px;
    }

    #filter_btn_mob_map {
        display: none;
    }
}

/* Media query for screens smaller than 768px (mobile view) */
@media (max-width: 767.98px) {
    .logo-img-nsw {
        height: 48px;
    }

    .mobile-tabs {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    .reviver-item{
        display: block;
    }
    /* .reviver-item-desktop {
        display: none;
    } */
    .desktop-layout {
        display: none;
        /* Hide desktop layout */
    }

    /* Adjust the padding of tabs for mobile */
    .nav-tabs .nav-link {
        padding: 5px 5px;
        /* Tighter padding for mobile */
        font-size: 12px;
        /* Slightly smaller font size */
    }

    .tabs-underlined {
        .tab-underlined {
            color: black;
            font-size: large;
            padding: 0px;
            margin: 0px 0px;
            opacity: .4;
            cursor: pointer;
            text-decoration: none;
            /* border-bottom: 4px solid transparent; */
            border-bottom: 2px solid #CDD3D6;
            display: block;
        }

        .tab-underlined:hover {
            opacity: 0.5;
        }

        .tab-underlined.active {
            opacity: 1;
            border-bottom: 4px solid #FF0000;

        }
    }

    #legendHeader {
        height: 50px;
        line-height: 50px;
    }

    .filter-mobile-container {
        display: flex;
        flex-direction: column;
        height: 100vh;
        /* Full viewport height */
    }

    .accordion {
        flex-grow: 1;
        /* Make the accordion grow to fill the available space */
    }

    .accordion-body {
        max-height: calc(100vh - 100px);
        /* You can adjust this value */
        overflow-y: auto;
        padding: 1rem 1rem !important;
       
    }

    .accordion-button {
        padding: 0.5rem 1.25rem;
    }

    #map-canvas {
        height: 100%;
        width: 100%;
        z-index: 1;

    }

    .legendRow td {
        vertical-align: middle;
        /* Vertically center-aligns all cells */
        padding: 5px;
        /* Adds some padding for better spacing */
    }

    .radioItemRow,
    .checkboxItemRow {
        width: 40px;
        /* Ensures both input columns have the same width */
    }

    .filterItem {
        width: 220px;
        /* Adjust as needed to fit both tables' labels */
    }


    .legendRow img {
        margin-right: 4px;
        /* Reduces the space between the icon and text */
    }

    .ms-1,
    .me-1 {
        margin-left: 2px !important;
        /* Decrease the margin to reduce spacing */
        margin-right: 2px !important;
    }

    #filter_btn_mob_map {
        display: block;
        background-color: #d7153a;
        border-color: #d7153a;
        color: #fff;
        border-radius: 4px;
        padding: 0.5rem 1.5rem;
        margin-right: 1rem;
    }
}

#legendFooter {
    position: absolute;
    bottom: 0;
    padding: 0.5rem;
    height: 4rem;
    width: 100%;
    background-color: #fff;
    border-top: 1px solid #CDD3D6;

    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
}

/* The Close Button */
.close {
    color: #05467e;
    float: right;
    font-size: 28px;
    padding-right: 3%;
    font-weight: bold;
    margin-top: -1%;
    margin-bottom: -1%;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}


.smcx-embed {
    width: 100%;
    height: 90% !important;
    border: none;
}

.nsw-footer__lower {
    padding: 0rem 0rem !important;
}

#last-updated-date {
    font-weight: bold;
}

.section {
    padding: 10px 0 !important;
    border-bottom: 0px solid #ddd;
}

#backToTopModal {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
}

.modal-info-body {
    max-height: 100%;
    overflow-y: auto;
    position: relative;
}

#header__container {
    margin-left: 2%;
    margin-right: 2%;
    /* max-width: var(--nsw-container-width); */
    padding-left: 1rem;
    padding-right: 1rem;
    position: relative;
}

.aheader__main {
    align-items: center;
    display: flex;
    justify-content: flex-start;
    margin: .75rem 4.5rem .75rem 1rem;
    position: relative;
    width: 65%;
}

.navbar-group-2 {
    padding: 0.25rem 0.5rem;
    align-items: center;
    display: flex;
    justify-content: center;
}

.nsw-header__waratah-gov {
    height: 3.75rem !important;
}

@media (max-width: 540px) {
    .aheader__main {
        align-items: center;
        display: flex;
        justify-content: flex-start;
        margin: .25rem 4.5rem .25rem 1rem;
        position: relative;
        width: 65%;
    }

    .survey-modal-content {
        position: absolute;
        min-width: 90%;
        min-height: 22rem;
        left: 50%;
        top: 50%;
        border-radius: 5px;
        background-color: #fff;
        transform: translate(-50%, -50%);
    }
}

#reset-filter-button > i {
    margin-right: 0.5rem;
}

#miscContainer {
    display: flex;
    flex-direction: row;
    box-shadow: none !important;
}

#legendButton {
    /* Initially not visible until layer is ready. */
    display: none;

    cursor: pointer;

    background-color: #fff;
}

#legendButtonImage {
    width: 32px;
    height: 32px;

    padding: 4px;
}

.siteTypeLegendItemsContainer {
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.siteTypeLegendItem {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0.5rem;
}

.siteTypeLegendItem img {
    margin-right: 1rem;
}

.siteTypeLegendItem p {
    flex: 1;
    margin: 0;
}

.siteTypesLegendCloseButton {
    background-color: #002664;
    color: #fff;
    border-radius: 4px;
}

.siteTypesLegenedBody {
    padding: 1rem 1rem 0 1rem;
}

.siteTypesLegendDot {
    height: 25px;
    width: 25px;
    border-radius: 50%;
    display: inline-block;

    margin-right: 2rem;
    margin-bottom: 5px;
     border: 1.1px solid white;
}

.siteTypesLegendRestArea {
    background-color: #00aa45;
}

.siteTypesLegendRestAreaWithDriverRevier {
    background-color: #146cfd;
}

.siteTypesLegendServiceCentre {
    background-color: #f3631b;
}

.vehicle-type-filter-container {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    padding-top: 1.5rem;
}

.vehicle-type-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    cursor: pointer;
    background-color: #fff;
}

.vehicle-type-container .light-vehicle-icon {
    content: url("./../img/car-icon-dark.svg");
}

.vehicle-type-container .heavy-vehicle-icon {
    content: url("./../img/truck-icon-dark.svg");
}

.vehicle-type-icon {
    border-radius: 0.25rem;
    width: 5rem;
    height: 5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background-color: #fff;
}

.vehicle-type-container .light-vehicle-icon.selected {
    content: url("./../img/car-icon-light.svg");
}

.vehicle-type-container .heavy-vehicle-icon.selected {
    content: url("./../img/truck-icon-light.svg");
}

.vehicle-type-container  .vehicle-type-icon.selected {
    background-color: #002664;
}

.gapToFixHeight {
    padding: 2rem 0;
}

.reviver-item {
    font-size: 0.8rem;
    padding-left: 3%;
}

.reviver-item-desktop {
    font-size: 0.8rem;
    padding-left: 3.2rem;
    padding-right: 2rem;
    padding-top: 2%;
}

.reviver-link-item {
    text-decoration: underline !important;
    color: #0d6efd !important;
    font-weight: lighter !important;
}
