/* ========================================================================================================================
   Global Styles
======================================================================================================================== */

body { 
    margin: 0; 
    padding: 0; 
    font-family: "Manrope", sans-serif;
    font-style: normal;
    color: white;
}
h1 {
    margin-top: 30px;
}
@media (max-width: 768px) {
    h1 {
        font-size: 1.3rem;
        margin-top: 25px;
    }
    h2 {
        font-size: 1rem;
    }
}
p {
    font-style: normal;
    font-size: 0.78rem;
}
hr {
    color: #4B5563;
    margin-top: 10px;
    margin-bottom: 0px;
    padding: 0px;
    border-width: 0.5px;
}
table {
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
    display: block;
    table-layout: fixed;
}
th, td {
    border: 2px solid white;
    padding: 1.1rem;
    text-align: left;
    vertical-align: top;
    font-size: .8rem;
    width: 50%; /* Force equal width */
    word-wrap: break-word; /* Handle long content */
}
th {
    color: #0E0F10;
}
a {
    text-decoration: none;
    color: #498bf7;
}
ul {
    padding-left: 20px;
    font-size: .8rem;
}
.accordion {
    cursor: pointer;
    padding-left: 20px;
    padding-top: 10px;
    padding-bottom: 10px;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    background-color: #0E0F10;
    color: white;
    font-size: .8rem;
    font-weight: bold;
    margin-top: 1rem;
}
.accordion-icon {
    position: relative;
    top: 4px;
    width: 17px;
    height: 17px;
}
.accordion-panel {
    padding-left: 5px;
    padding-right: 5px;
    padding-top: 5px;
    padding-bottom: 10px;
    text-align: left;
    outline: none;
    background-color: #ffffff;
    font-size: .8rem;
}
.btn {
    background-color: white;
    color: #0E0F10;
    padding: 8px 1.2rem;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.3s;
}
.btn:hover {
    background-color: #498bf7;
}
/* Fix for anchor scrolling problem */
[id] {
    scroll-margin-top: 100px; /* Slightly larger than navbar height to ensure comfortable spacing */
}

/* ========================================================================================================================
   About page features
======================================================================================================================== */

.container {
    max-width: 800px;
    width: 100vw;
    align-items: center;
    margin: 0 auto; /* Centers the container */
    text-align: left; /* Ensures content inside is left-aligned */
    padding-top: 70px;
    padding-left: 20px;
    padding-right: 20px;
    background-color: white;
    color: black;
    box-sizing: border-box; /* Add this to include padding in width calculation */
}
.container h2 {
    margin-top: 2rem;
}
.btn-back-to-top {
    position: fixed; /* Change from sticky to fixed */
    bottom: 20px; /* Position from bottom instead of top */
    left: 20px;
    background-color: #0E0F10;
    color: white;
    padding: 10px 1.2rem;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
    z-index: 1000; /* Ensure it stays above other content */
}
.btn-back-to-top:hover {
    background-color: #498bf7;
}
.section-icon {
    height: 20px;
    width: 20px;
}
@media (max-width: 768px) {
    .section-icon {
        height: 16px;
        width: 16px;
    }
}
.carousel {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 10px;
    padding-top: 0px;
    padding-bottom: 10px;
    margin-top: 0px;
    margin-bottom: 0rem;
    height: 405px;
}
.instagram-media {
    min-height: 400px !important;
    margin: auto; /* Centers the embed */
}

/* ========================================================================================================================
   Navigation Bar
======================================================================================================================== */

.navbar {
    position: fixed;
    width: 100%;
    display: flex;
    align-items: left;
    justify-content: space-between;
    background-color: #0E0F10;
    padding-left: 20px;
    padding-right: 20px;
    color: white;
    top: 0px;
    height: 80px;
    z-index: 10000;
}
.nav-logo-and-title {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}
.nav-logo-and-title img {
    padding-top: 5px;
    height: 40px;
    width: auto;
    align-items: center;
}
.nav-title {
    margin-bottom: .2rem;
    display: block;
    font-size: 0.9rem;
    font-weight: bold;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin: .2rem;
    padding-right: 35px;
}
.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.3s;
}
.nav-links .nav-a-current {
    color: #498bf7;
}
.nav-links a:hover {
    color: #498bf7;
}
.nav-hamburger {
    position: fixed;
    right: 20px;
    top: 25px;
    display: none;
    cursor: pointer;
    z-index: 200001;
}
.nav-hamburger div {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px;
    z-index: 200001;
}
.nav-links-mobile {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 80px;
    right: 0px;
    padding-right: 20px;
    padding-left: 20px;
    padding-bottom: 20px;
    gap: 10px;
    background-color: #0E0F10;
    width: 28%;
    text-align: right;
    z-index: 2000001;
}
.nav-links-mobile a {
    font-size: 0.75rem;
    color: white;
}
/* Responsive for Mobile */
@media (max-width: 768px) {
    .navbar {
        text-align: left;
        gap: 10px;
        width: 100%;
    }
    .nav-logo-and-title img {
        align-items: center;
    }
    .nav-title {
        margin-top: 5px;
        font-size: 1.5rem;
        font-weight: bold;
    }
    .nav-links {
        display: none;
    }
    .nav-hamburger {
        display: block;
    }
    .container {
        width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    /* Force tables to be responsive */
    table {
        width: 100% !important;
        display: block;
        overflow-x: auto;
    }

    /* Make accordion panels fit mobile width */
    .accordion-panel {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
    }

    /* Adjust feature cards for mobile */
    .detail-panel-container {
        padding-left: 10px;
        padding-right: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Ensure images don't overflow */
    .jetty-image-container {
        max-width: 100%;
    }

    /* Make lists fit within container */
    ul, ol {
        padding-left: 15px;
    }

    #lga-menu {
        position: fixed;
        width: 100vw !important;
        top: calc(100vh - 50vh) !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        height: 50vh !important;
        display: flex;
        flex-direction: column;
        overflow: hidden; /* Prevent double scrollbars */
    }

    #lga-menu .map-title,
    #lga-menu .list-title {
        flex-shrink: 0; /* Keep headers fixed */
    }

    #lga-menu .lga-section {
        min-height: min-content; /* Ensure content is not collapsed */
    }

    /* Create a scrollable container for all sections */
    #lga-menu .lga-sections-container {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
    }

    /* Ensure jetty lists are visible when expanded */
    #lga-menu .jetty-list {
        max-height: none;
        overflow: visible;
    }

    #lga-menu {
        position: fixed;
        width: 100vw !important;
        top: calc(100vh - 50vh) !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        height: 50vh !important;
        display: flex;
        flex-direction: column;
    }

    #lga-menu .map-title,
    #lga-menu .list-title {
        flex-shrink: 0; /* Prevent header from shrinking */
    }

    /* Create a scrollable container for the sections */
    #lga-menu > div:not(.map-title):not(.list-title) {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #map {
        margin-left: 0;
        margin-right: 0;
        height: 50vh !important;
    }

    #map {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        height: 50vh !important;
    }
    
    #map.panel-open,
    #map.no-right-panel {
        margin-right: 0 !important;
        width: 100% !important;
    }
    
    #jetty-details, 
    #route-details,
    #welcome-panel {
        width: 91vw;
        top: 50vh;
        right: 0;
        left: 0;
        height: calc(100vh - 50vh);
    }
}

/* ========================================================================================================================
   Map page and map elements
======================================================================================================================== */

/* ===================================================================================================================== */
/* Map */

#main-element {
    position: absolute;
    top: 80px;
    width: 100%;
    height: calc(100vh - 80px);
    display: flex;
}

#map {
    position: relative;
    flex-grow: 1;
    height: 100%;
    visibility: hidden;
    margin-left: 256px; /* LGA menu width */
    margin-right: 368px; /* Initial margin for welcome panel */
    transition: all 0.3s ease;
}

#map.no-right-panel {
    margin-right: 0;
}

#map.panel-open {
    margin-right: 368px;
}

@media (max-width: 768px) {
    #map {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        height: 50vh !important;
    }
}

#loading { 
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
}
.map-jetty-name-label {
    background-color: transparent;
    border: none;
    padding: 2px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    color: #0E0F10;
    text-shadow: 
        -1px -1px 0 white,  
         1px -1px 0 white,
        -1px  1px 0 white,
         1px  1px 0 white;
    pointer-events: none;
}

/* Adjust map height for mobile */
@media (max-width: 768px) {
    #map {
        height: calc(100dvh - 80px); /* Use dynamic viewport height */
        max-height: -webkit-fill-available; /* For iOS Safari */
    }
    #main-element {
        height: calc(100dvh - 80px);
        max-height: -webkit-fill-available;
    }
}

/* ===================================================================================================================== */
/* Map page welcome info panel and popup */

#welcome-panel {
    position: fixed;
    bottom: 0;
    top: 80px;
    right: 0;
    width: 328px;
    color: white;
    background: #0E0F10;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 5001;
    overflow-y: scroll;
    border-top: 0.5px solid #4B5563;
}
#welcome-panel h1 {
    font-size: 1.3rem;
    margin-top: 0rem;
    padding-top: 0rem;
}
#welcome-panel h2 {
    font-size: 1.1rem;
}

/* Popup Style (Hidden by Default) */
#welcome-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    max-width: 300px;
    max-height: 1000px;
    color: white;
    background: #0E0F10;
    padding: 20px;
    overflow-y: scroll;
    z-index: 5001;
    border: 0.5px solid white;
}
#welcome-popup h1 {
    font-size: 1.1rem;
    margin-top: 0rem;
    padding-top: 0rem;
}
#welcome-popup h2 {
    font-size: 0.9rem;
}
/* Mobile View: Hide Info Pane & Show Popup */
@media (max-width: 768px) {
    #welcome-panel {
        display: none;
    }
    #welcome-popup {
        display: block;
    }
}
.close-btn {
    position: absolute;
    top: 1.1rem;
    right: 1.8rem;
    width: 5px;
    height: 5px;
    cursor: pointer;
    color: #a5acb8;
    background: none;
    border: none;
}

/* ========================================================================================================================
   Detail panel for jetty and route
/* ===================================================================================================================== */

.detail-panel-container {
    padding: 0px;
}

.detail-panel-container .detail-panel-type-label {
    font-size: 0.75rem;
    color: white;
    font-weight: normal;
    padding-top: 0px;
}
.detail-panel-container .detail-panel-title {
    font-size: 1rem;
    margin-top: 0rem;
    font-weight: bold;
    padding-top: 10px;
    padding-bottom: 10px;
}
.detail-panel-container .detail-panel-attributes {
    font-size: 0.75rem;
    padding-top: 2px;
    padding-bottom: 2px;
    color: #9CA3AF;
}
.detail-panel-container .detail-panel-section-title {
    font-size: 0.85rem;
    font-weight: bold;
    padding-top: 10px;
    padding-bottom: 10px;
    color: white;
}
.detail-panel-container .detail-panel-explain {
    font-size: 0.75rem;
    font-weight: normal;
    padding-top: 10px;
    padding-bottom: 2px;
    color: #9CA3AF;
}
.detail-panel-container table {
    margin: 0px;
    padding: 0px;
    width: 100%;
    table-layout: fixed; /* Force equal column distribution */
}
.detail-panel-container th, 
.detail-panel-container td {
    border: 2px solid white;
    padding: 10px;
    text-align: left;
    vertical-align: top;
    font-size: .8rem;
    width: 50%; /* Force equal width */
    word-wrap: break-word; /* Handle long content */
}

#jetty-details {
    position: fixed;
    top: 80px;
    right: 0;
    width: 328px;
    height: calc(100vh - 80px);
    background: #0E0F10;
    padding: 20px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    display: none;
    border-top: 0.5px solid #4B5563;
}

#jetty-details-content {
    padding-bottom: 80px; /* Add bottom padding to ensure last content is visible */
}

.jetty-image-container {
    width: 100%;
    max-height: 180px;
    overflow: hidden;
    align-items: center;
    display: flex;
    justify-content: center;
}
.jetty-image-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    display: block;
}

.detail-group-table table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    margin-top: 10px;
    background-color: #1A1D21;
    border: 0.5px solid #4B5563;
    table-layout: fixed; /* Force equal column distribution */
}

.detail-group-table th, 
.detail-group-table td {
    padding: 8px;
    text-align: left;
    color: white;
    font-size: 0.75rem;
    border: none;
    width: 50%; /* Force equal width */
    word-wrap: break-word; /* Handle long content */
}

.detail-group-table .big-text {
    font-size: 0.75rem;
    font-weight: bold;
}

.detail-group-table .big-text-normal {
    font-size: 0.75rem;
    font-weight: normal;
    margin-bottom: 10px;
    color: white;
}

.detail-group-table .small-text {
    font-size: 0.68rem;
    color: #9CA3AF;
}

.detail-group-table .jetty-routes-item {
    margin-bottom: 15px;
}

.detail-group-table .jetty-routes-item a {
    cursor: pointer;
    display: inline-block;
    width: 100%;
}

.detail-group-table .big-text a {
    cursor: pointer;
    display: inline-block;
    width: 100%;
}

#jetty-details .operator-section {
    border: 0.5px solid #4B5563;
}

.detail-group-table .jetty-routes-item.charter-only {
    background-color: rgba(128, 21, 0, 0.15);
    padding: 10px;
    border-radius: 4px;
}

.charter-notice {
    color: #801500;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.destination-accordion {
    cursor: pointer;
    padding-left: 0px;
    padding-top: 0px;
    padding-bottom: 0px;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    background-color: #0E0F10;
    color: #9CA3AF;
    font-size: .8rem;
    font-weight: normal;
}
.destination-accordion-icon {
    position: relative;
    top: 4px;
    width: 17px;
    height: 17px;
}
.destination-accordion-panel {
    padding-left: 5px;
    padding-right: 5px;
    padding-top: 0px;
    padding-bottom: 0px;
    text-align: left;
    outline: none;
    background-color: #000000;
    font-size: .8rem;
    border: 0.5px solid #4B5563;
}

/* Route Details Panel */
#route-details {
    position: fixed;
    top: 80px;
    right: 0;
    width: 328px;
    height: calc(100vh - 80px);
    background: #0E0F10;
    padding: 20px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    display: none;
    border-top: 0.5px solid #4B5563;
}

#route-details-content {
    padding-bottom: 80px; /* Add bottom padding to ensure last content is visible */
}

#route-details .close-btn {
    color: #323232;
}

/* Adjust map container for menus */
@media (min-width: 769px) {
    #map {
        margin-left: 256px;
        width: calc(100% - 256px);
        transition: all 0.3s ease;
    }

    #map.panel-open {
        width: calc(100% - 624px); /* 256px (left menu) + 328px (right panel) */
    }
}

@media (max-width: 768px) {
    #jetty-details, #route-details {
        width: 91vw;
        top: 50vh;
        right: 0;
        left: 0;
        height: calc(100vh - 50vh);
    }

    #lga-menu {
        position: fixed;
        width: 100vw !important;
        top: calc(100vh - 50vh) !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        height: 50vh !important;
        display: flex;
        flex-direction: column;
    }

    #lga-menu .map-title,
    #lga-menu .list-title {
        flex-shrink: 0; /* Prevent header from shrinking */
    }

    /* Create a scrollable container for the sections */
    #lga-menu > div:not(.map-title):not(.list-title) {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #map {
        margin-left: 0;
        width: 100%;
        height: 50vh !important;
    }
}

.feedback_button {
    background-color: #4B5563;
    width: 100%;
    color: white;
    border-color: white;
    border-width: 0px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 20px;
    padding-right: 20px;
    margin: 0px;
}

/* ===================================================================================================================== */
/* Map legend */
/* ===================================================================================================================== */

#legend {
    position: fixed;
    top: 80px;
    left: 256px;
    background: rgba(255, 255, 255, .8);
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 10px;
    padding-right: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    font-size: 0.68rem;
    transform: translateZ(0);
    color: black;
}
#legend p {
    margin-top: 0.3rem; 
    margin-bottom: 0.3rem;
    font-size: 0.68rem;
}
.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}
.legend-color {
    width: 10px;
    height: 10px;
    margin-right: 5px;
    display: inline-block;
}
@media (max-width: 768px) {
    #legend {
        top: 80px;
        left: 0rem;
    }
    #legend p {
        font-size: 0.7rem;
    }
    .legend-item {
        font-size: 0.7rem;
    }
}
/* Legend Info Icon Tooltip Container */
.legend-tooltip-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    isolation: isolate;
    margin-left: 4px; /* Add spacing from legend text */
    vertical-align: middle; /* Align with legend text */
}
/* Legend Info Icon Styling */
.legend-info-icon {
    width: 0.7rem;
    height: 0.7rem;
    color: #989898;
    margin-left: 2px;
    position: relative;
    z-index: 0;
}
/* Legend Info Icon Tooltip Box */
.legend-tooltip {
    position: absolute;
    top: 100%; /* Change from bottom:100% to top:100% */
    left: 100%;
    transform: translateX(-40%);
    margin-top: 10px; /* Change from margin-bottom to margin-top */
    background-color: rgb(30, 30, 30);
    color: white;
    padding: 8px;
    border-radius: 5px;
    font-size: .7rem;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    min-width: 200px;
    max-width: 250px;
    white-space: normal;
    word-wrap: break-word;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 20000;
}
/* Arrow above tooltip */
.legend-tooltip::after {
    content: "";
    position: absolute;
    top: -10px; /* Change from bottom to top */
    left: 37%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgb(30, 30, 30) transparent; /* Reverse arrow direction */
}
/* Show tooltip on hover (Desktop) */
.legend-tooltip-container:hover .legend-tooltip {
    visibility: visible;
    opacity: 1;
    z-index: 20000;
}
/* Mobile: Show tooltip on click */
@media (max-width: 768px) {
    .legend-tooltip-container:hover .legend-tooltip {
        visibility: hidden; /* Disable hover tooltip on mobile */
        z-index: 20000;
    }
}

/* ===================================================================================================================== */
/* Map feature popups */
/* ===================================================================================================================== */

.leaflet-popup-content {
    font-family: "Manrope", sans-serif;
}
.map-popup-clicked {
    max-height: 300px;
    max-width: 100px;
    overflow-y: auto;
    overflow-x: none;
    z-index: 6000;
}
.map-popup-clicked h1 {
    font-size: 1rem;            
}
.map-popup-clicked h2 {
    font-size: .9rem;            
}
.map-popup-clicked p {
    font-size: .7rem;
    color: #757575;    
    margin-top: 0.1rem;
    margin-bottom: 0.1rem;        
}
.map-popup-clicked-jetty .leaflet-popup-tip {
    display: none;
}
.map-popup-clicked-route .leaflet-popup-tip {
    display: none;
}

/* ===================================================================================================================== */
/* Left Menu for LGAS and Ferry Jetties */
/* ===================================================================================================================== */

#lga-menu {
    position: fixed;
    top: 80px;
    left: 0;
    width: 256px;
    height: calc(100vh - 80px);
    background: #0E0F10;
    padding: 0px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    border-top: 0.5px solid #4B5563;
}

#lga-menu .map-title {
    font-size: .875rem;
    font-weight: bold;
    padding-top: 20px;
    padding-bottom: 20px;
    padding-left: 20px;
    padding-right: 20px;
    color: white;
}

#lga-menu .list-title {
    font-size: 0.68rem;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 20px;
    padding-right: 20px;
    color: #9CA3AF;
    border-top: 0.5px solid #4B5563;
}

.lga-section {
    width: 100%;
    margin-bottom: 10px;
}

.lga-title {
    font-size: .875rem;
    font-weight: bold;
    color: #9CA3AF;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 20px;
    padding-right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jetty-item:hover {
    background-color: #1A1D21;
    
}

.lga-title:hover {
    background-color: #1A1D21;
    
}

.jetty-list {
    list-style: none;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 20px;
    padding-right: 20px;
    margin: 0;
    gap: 5px;
}

.jetty-item {
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #9CA3AF;
    transition: all 0.2s;
    font-weight: normal;
}

.jetty-item:hover {
    color: #498bf7;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 8px 0;
    margin-bottom: 16px;
}

.back-btn:hover {
    color: #498bf7;
}

.back-btn i {
    width: 16px;
    height: 16px;
}

/* Icon styles for different contexts */
.inline-icon {
    color: #ffffff;
    width: 17px;
    height: 17px;
    margin-right: 4px;
    margin-bottom: -3px;
}

.destination-accordion .inline-icon {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}