/*--- Loading Screen ---*/
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #343741;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 1s ease;}
  .logo {font-size: 2rem; margin-bottom: 20px; font-family: sans-serif;}
  .logo img { width: 50vw; height: auto;}
  .progress-bar {
    width: 60%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;}
  .progress-fill {
    width: 0%;
    height: 100%;
    background: #b2d33e;
    animation: fillProgress 2s ease-out forwards;}
  @keyframes fillProgress { to {width: 100%;}}
  #splash-screen.fade-out { opacity: 0; pointer-events: none;}
  #splash-message{
  font-size: 1.2rem;
  color: #fff;
  margin-top: 20px;
  font-family: sans-serif;
  text-align: center;}

/*--- Globals ---*/
body {margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #fff;
    background-color: #1a1a1a;
    overflow: hidden;}
canvas {display: block;}
h1 {margin: 0;font-weight: 500;}

/*--- Menu Container ---*/
#menu-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 10px;
    background: #343741f2;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 200;}
#menu-banner.collapsed {padding: 4px 10px 0;}
#menu-banner .menu-content {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: stretch;
    gap: 5px;
    transition: opacity 0.3s ease, max-height 0.4s ease;}
#menu-banner.collapsed .menu-content {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;}
.menu-panel {
    display: flex;
    flex-direction: row;
    gap: 6px;
    padding: 10px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: inherit;
    flex: 1 1 0;
    min-width: 140px;}
.menu-panel.label-panel {flex: 0 0 1%;}

/*--- Menu Collapse Button ---*/
#master-menu-toggle {
    position: absolute;
    height:40px;
    bottom: -30px;
    right: 10px;
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    font-weight: 700;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #fff;
    background: #343741f2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;}
#master-menu-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.55);}
#master-menu-toggle:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;}
#master-menu-toggle::after {
    content: '▲';
    margin-left: 0.4rem;
    font-size: 0.7rem;
    display: inline-block;
    transition: transform 0.3s ease;}
#master-menu-toggle.is-collapsed::after {transform: rotate(-180deg);}

/*--- Menu Labels ---*/
.label-master-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;}
.label-master-control label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    font-size: 0.85rem;}
.label-icon{
    width: 20px;
    height: 20px;
    padding-right: 5px;
    color:#fff}
.label-master-control input {
    width: 18px;
    height: 18px;
    accent-color: #b2d33e;}

/*--- Menu Section Sizing ---*/
.menu-panel.floor-panel {flex: 1 1 40%;}
.menu-panel.search-panel {flex: 1 1 100%;}
.menu-panel.accordion-panel{flex: 1 1 60%;}
.menu-panel label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    cursor: pointer;}
.menu-panel label input {
    width: 20px;
    height: 20px;
    accent-color: #b2d33e;}

/*--- Accordion Menu ---*/
.label-master-accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;}
.label-master-accordion {
    width: 100%;
    border-radius: 12px;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;}
.label-master-accordion summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 600;
    border-radius: 8px;
    transition: background 0.2s ease;}
.label-master-accordion summary small {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;}
.label-master-accordion summary::-webkit-details-marker {display: none;}
.label-master-accordion summary::after {
    content: '▾';
    transition: transform 0.2s ease;
    font-size: 0.85rem;
    margin-left: 0.25rem;}
.label-master-accordion[open] summary::after {transform: rotate(180deg);}
.summary-heading {
    display: flex;
    align-items: center;
    gap: 0.25rem;}
.summary-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;}
.summary-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    cursor: pointer;}
.summary-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #b2d33e;}

/*--- Accordion Menu OPENED ---*/
.label-master-accordion[open] #map-list-wrapper {
    display: block;}
.accordion-panel {
    height: auto;
    flex: 2 1 360px;
    min-width: 260px;
    position: relative;}
#map-list-wrapper {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    max-height: 800px;
    overflow-y: auto;
    width: 100%;
    background: #343741f2;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    z-index: 1;
    display: none;}
.map-list-container {
    max-height: 100%;
    overflow-y: auto;
    background: rgba(222, 222, 222, 0.95);
    padding: 10px;
    border-radius: 6px;
    color: #343741;
    font-family: Arial, sans-serif;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);}
.map-list-container h3 {
    margin: 10px 0 5px 0;
    color: #00703c;
    cursor: pointer;
    user-select: none;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;}
.map-list-container h3:hover {
    background-color: #00703c;
    color: white;}
.map-list-container h3::before {
    content: '▼ ';
    font-size: 0.8em;
    margin-right: 5px;}
.map-list-container h3.collapsed::before {
    content: '▶ ';}
.map-category {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;}
.map-category.collapsed {
    max-height: 0;}
.map-list-item {
    margin: 5px 0 5px 20px;}
.map-list-item:hover {
    cursor: pointer;}
.map-list-item.active {
    background-color: #343741;
    color:white;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: bold;}
.map-nav-text {
    margin-top: 10px;
    font-size: 14px;
    color: #343741;
    text-shadow: rgba(0, 0, 0, 0.8);}

/*--- Floor Selector ---*/
#fl-nav {font-weight: 600;}
#fl-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;}
#fl-nav ul li {
    text-decoration: none;
    color: #b2d33e;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;}
#fl-nav ul li.active {
    background: linear-gradient(145deg, #b2d33e, #6f9d1a);
    color: #fff;
    border-color: transparent;}
#fl-nav ul li:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;}

/*--- Search Bar ---*/
#floor-text-search {
    width: min(320px, 100%);
    position: absolute;
    height:40px;
    bottom: -60px;
    left: 0px;
    padding: 10px 10px;}
#floor-text-search-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #343741;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);}
#floor-text-search-input:focus {
    outline: 2px solid #b2d33e;}
#floor-text-results {
    margin-top: 4px;
    max-height: 220px;
    overflow-y: auto;
    color:#00703c;
    background: rgba(222, 222, 222, 0.95);
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: none;}
#floor-text-results.visible {
    display: block;}
.floor-search-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    cursor: pointer;
    font-family: inherit;
    color: inherit;}
.floor-search-item:hover { background: rgba(0, 112, 60, 0.1);}
.floor-search-item.active {background: rgba(0, 112, 60, 0.25);}
.floor-search-item span {font-weight: 600;}
.floor-search-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;}
.floor-search-meta {
    font-size: 0.75em;
    color: #4b4b4b;
    line-height: 1.2;}
.floor-search-empty {
    margin: 0;
    font-size: 0.85em;
    color: #555;}

/*--- Responsive Styles ---*/
@media (max-width: 1200px) {
    #menu-banner {padding-bottom: 20px;}
    #menu-banner .menu-content {flex-direction: column; gap: 12px;}
    .menu-panel {width: 95%;}
    .floor-panel {order: 2;}
    .accordion-panel {order: 3; max-width: 100%; max-height: 280px;}
    .search-panel {order: 4;}
    #fl-nav ul {justify-content: flex-start; gap: 8px;}
    #master-menu-toggle {right: 12px;}}

@media (max-width: 600px) {
    #menu-banner {gap: 12px; padding: 12px 12px 20px;}
    #menu-banner .menu-content {gap: 12px;}
    #fl-nav ul li {padding: 5px 10px;}
    #floor-text-search {width: 75%;}
    #master-menu-toggle {right: 12px; bottom: -30px;}}


