/* =============================================
   LAKEMAP.CSS – FULL REPLACEMENT (200px SIDEBAR + MMORPG BARS + AUDIO)
   ============================================= */

body {
    margin: 0;
    padding: 10px;
    background-color: #000;
}

#left-sidebar {
    width: 325px;
    height: 100vh;
    background-color: #222;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    transition: transform 0.3s ease;
    transform: translateX(-100%);
    z-index: 1000;
}

#right-sidebar {
    width: 200px;
    height: 100vh;
    background-color: #222;
    color: #fff;
    position: fixed;
    top: 0;
    right: 0px;
    overflow: hidden;
    transition: transform 0.3s ease;
    transform: translateX(100%);
    z-index: 1000;
}

/* =============================================
   SPECIAL THANKS (Bottom of Right Sidebar)
============================================= */

.special-thanks {
    position: sticky;
    bottom: 0;
    margin-top: 10%;
    padding-top: 3px;
    padding-bottom: 1px;
    border-top: 1px solid #444;
    background-color: #1a1a1a;
    z-index: 5;
}

.special-thanks-content {
    padding: 0 6px 6px 6px;
}

.special-thanks-title {
    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: bold;
    color: #aaa;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.special-thanks-text {
    font-family: Arial, sans-serif;
    font-size: 9px;
    color: #888;
    margin: 0;
    line-height: 1.4;
    text-align: center;
}

#left-sidebar:not(.hidden),
#right-sidebar:not(.hidden) {
    transform: translateX(0);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
}

.close-btn {
    position: absolute;
    top: 6px;
    width: 20px;
    height: 20px;
    background-color: #555;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 17px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

#left-sidebar .close-btn {
    right: 5px;
}

#right-sidebar .close-btn {
    right: 5px;
}

.close-btn:hover {
    background-color: #777;
}

#left-sidebar .reset-btn {
    position: absolute;
    top: 6px;
    right: 52px;
    width: 20px;
    height: 20px;
    background-color: #555;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 17px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

#left-sidebar .reset-btn:hover {
    background-color: #777;
}

#left-sidebar .reset-label {
    position: absolute;
    top: 9px;
    right: 77px;
    font-size: 12px;
    color: #fff;
    font-family: Arial, sans-serif;
    text-transform: lowercase;
    cursor: default;
}

#right-sidebar .sidebar-content ul {
    padding-left: 0;
    margin: 3px 0 0 0;
    list-style: none;
}

#right-sidebar .sidebar-content > ul {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 12px
}

#right-sidebar .sidebar-content ul > li {
    margin-bottom: 1px;
}

#right-sidebar .sidebar-content ul > li > .category-container {
    display: flex;
    align-items: center;
    background-color: #c2c2c2;
    color: #000;
    padding: 6px 8px;
    border-radius: 0;
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.3;
    transition: background-color 0.3s ease;
}

#right-sidebar .sidebar-content ul > li > .category-container:hover {
    background-color: #696969;
}

#right-sidebar .sidebar-content ul > li > .category-container .checkbox-label {
    margin-right: 5px;
    cursor: pointer;
}

#right-sidebar .sidebar-content ul > li > .category-container .infocard-trigger {
    flex-grow: 1;
    color: #000;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#right-sidebar .sidebar-content ul > li > .category-container .infocard-trigger:hover {
    text-decoration: underline;
}

#right-sidebar .sidebar-content ul > li > .category-container .dropdown-toggle {
    margin-left: 5px;
    cursor: pointer;
    font-size: 13px;
}

#right-sidebar .sidebar-content ul ul.sub-layers {
    padding-left: 12px;
    margin-top: 2px;
    display: none;
}

#right-sidebar .sidebar-content ul ul.sub-layers li .subcategory-container {
    display: flex;
    align-items: center;
    background-color: #a9a9a9;
    color: #000;
    padding: 4px 8px;
    border-radius: 0;
    font-family: Arial, sans-serif;
    font-size: 13px;
    margin-bottom: 2px;
    transition: background-color 0.3s ease;
}

#right-sidebar .sidebar-content ul ul.sub-layers li .subcategory-container:hover {
    background-color: #808080;
}

#right-sidebar .sidebar-content ul ul.sub-layers li .subcategory-container .checkbox-label {
    margin-right: 5px;
    cursor: pointer;
}

#right-sidebar .sidebar-content ul ul.sub-layers li .subcategory-container .infocard-trigger {
    flex-grow: 1;
    color: #000;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#right-sidebar .sidebar-content ul ul.sub-layers li .subcategory-container .infocard-trigger:hover {
    text-decoration: underline;
}

#map-wrapper {
    margin-left: 0;
    margin-right: 0;
    min-height: 92vh;
    transition: margin 0.25s ease;
}

#map-wrapper.with-left-sidebar {
    margin-left: 325px;
}

#map-wrapper.with-right-sidebar {
    margin-right: 200px;
}

#map-wrapper.with-both-sidebars {
    margin-left: 325px;
    margin-right: 200px;
}

.controls {
    margin-bottom: 10px;
    text-align: center;
}

.controls label {
    margin: 0 5px;
    color: #fff;
    font-family: Arial, sans-serif;
    vertical-align: middle;
}

.controls button {
    margin: 0 10px;
    padding: 5px 7px;
    background-color: #333;
    color: #fff;
    border: 1px solid #a8a8a8;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    vertical-align: middle;
}

.controls button:hover {
    background-color: #555;
    border-color: #ccc;
}

#map-container {
    width: 100%;
    height: 92vh;
    overflow: hidden;
    border: 1px solid #ccc;
    background-color: #000;
}

#map {
    width: 100%;
    height: 100%;
    display: block;
}

#legend-svg {
    width: 100%;
    height: auto;
    max-height: 48vh;
    display: block;
}

#description-box {
    background-color: #f3dbb5;
    color: #000;
    padding: 10px;
    margin-top: 10px;
    border-radius: 0 0 3px 3px;
    overflow-y: visible;
    max-height: none;
    line-height: 1.5;
}

#description-box p {
    margin: 0;
    font-size: 15px;
    line-height: 1.4;
}

.infocard-title {
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    margin-bottom: 5px;
    padding: 5px;
    background-color: #1a2a3a;
    border-radius: 3px 3px 0 0;
}

.infocard-subtitle {
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #93ddb5;
    text-align: center;
    margin-bottom: 10px;
    padding: 2px;
    font-style: italic;
}

/* STAT BARS – DARK SILVER FRAME WITH SIMPLE TRIANGLE CORNERS */
.stat-bars-wrapper {
    margin: 5px 0 3px 0px;
    padding: 8px;
    background: transparent;
    border: 1px solid #a0a0a0;
    border-radius: 4px;
    position: relative;
    max-width: 309px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    box-shadow: 0 0 4px rgba(0,0,0,0.2);
}

/* Simple triangle corners */
.stat-bars-wrapper::before,
.stat-bars-wrapper::after,
.stat-bars-wrapper .corner {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    z-index: 2;
}

/* Top-left */
.stat-bars-wrapper::before {
    top: -1px; left: -1px;
    border-left-color: #a0a0a0;
    border-top-color: #a0a0a0;
}

/* Top-right */
.stat-bars-wrapper::after {
    top: -1px; right: -1px;
    border-right-color: #a0a0a0;
    border-top-color: #a0a0a0;
}

/* Bottom-left */
.stat-bars-wrapper .corner:nth-child(1) {
    bottom: -1px; left: -1px;
    border-left-color: #a0a0a0;
    border-bottom-color: #a0a0a0;
}

/* Bottom-right */
.stat-bars-wrapper .corner:nth-child(2) {
    bottom: -1px; right: -1px;
    border-right-color: #a0a0a0;
    border-bottom-color: #a0a0a0;
}

/* Individual bar row */
.stat-bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    justify-content: flex-start;
}

/* 3D BEVELED STAT BARS */
.stat-bar {
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(to bottom, #3b3b3b, #05000e);
    position: relative;
    overflow: hidden;
    flex: 1;
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,0.1),
        inset 0 -1px 0 rgba(0,0,0,0.3),
        0 1px 2px rgba(0,0,0,0.4);
    border: 1px solid #0f141a;
    min-width: 120px;
}

.stat-bar::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: var(--fill, 0%);
    border-radius: 1px;
    background: linear-gradient(to bottom, #66BB6A, #4CAF50);
    box-shadow: 
        inset 0 1px 0 rgba(255, 187, 0, 0.2),
        inset 0 -1px 0 rgba(255, 251, 0, 0.3);
    transition: width 0.5s ease;
    z-index: 1;
}

.stat-bar.color-1::before { 
    background: linear-gradient(to bottom, #FFB300, #FFC107); 
}

.stat-bar.color-2::before { 
    background: linear-gradient(to bottom, #C2185B, #E91E63); 
}

.stat-bar.color-3::before { 
    background: linear-gradient(to bottom, #00BCD4, #0097A7); 
}

.stat-label {
    flex-shrink: 0;
    width: 80px;
    font-weight: 780;
    color: #fff;
    font-size: 12px;
    text-align: right;
    padding-right: 4px;
}

.stat-value {
    color: #e0e0e0;
    font-weight: 500;
    font-size: 12px;
    white-space: nowrap;
    min-width: 50px;
    text-align: right;
}

/* AUDIO PLAYER */
.audio-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 12px 0 8px;
}

.play-btn {
    background: #20c3d8;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    width: 120px;
    transition: 0.3s;
}

.play-btn:hover {
    background: #93ddb5;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1px;
    font-size: 11px;
    color: #aaa;
    width: 120px;
    justify-content: space-between;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #20c3d8;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.progress-time {
    min-width: 50px;
    text-align: right;
    font-size: 10px;
}

/* SEARCH BAR */
#search-container {
    position: sticky;
    top: 0;
    width: 100%;
    background: #222;
    padding: 10px 0;
    border-bottom: 1px solid #333;
    z-index: 10;
    display: flex;
    gap: 6px;
    box-sizing: border-box;
}

#search-input {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #2a2a2a;
    color: #fff;
    outline: none;
    min-width: 0;
}

#search-input:focus {
    border-color: #4a9eff;
    box-shadow: 0 0 0 1px #4a9eff;
}

#clear-search {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    width: 30px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s;
}

#clear-search:hover {
    background: #444;
    color: #fff;
}

#clear-search.hidden {
    display: none;
}

.search-highlight {
    background: #4a9eff;
    color: white;
    padding: 0 2px;
    border-radius: 2px;
}

/* TROPHIC / STATUS / SPECIAL ICON ROW */
.icon-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 12px 0 8px;
    padding: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    flex-wrap: wrap;
}

.trophic-icon {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    border: 2px solid #a0a0a0;
    border-radius: 4px;
    background: #2a2a2a;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

.trophic-icon:hover {
    transform: scale(1.12);
    cursor: pointer;
}

#left-sidebar .back-btn {
    position: absolute;
    top: 6px;
    right: 115px;
    width: 20px;
    height: 20px;
    background-color: #555;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

#left-sidebar .back-btn:hover {
    background-color: #777;
}

#left-sidebar .back-label {
    position: absolute;
    top: 9px;
    right: 140px;
    font-size: 12px;
    color: #fff;
    font-family: Arial, sans-serif;
    text-transform: lowercase;
    cursor: default;
}

.icon-tooltip {
    background: #222;
    color: #fff;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    pointer-events: none;
    animation: fadeInTooltip 0.15s ease forwards;
}

@keyframes fadeInTooltip {
    from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* =============================================
   MOBILE RESPONSIVENESS – LAKEMAP PAGE
   ============================================= */

@media (max-width: 768px) {

  #left-sidebar {
    width: 85vw !important;
    max-width: 310px !important;
    height: auto !important;
    min-height: 100vh;
    touch-action: pan-y;
  }

  #right-sidebar {
    width: 70vw !important;
    max-width: 220px !important;
  }

  #map-wrapper.with-left-sidebar,
  #map-wrapper.with-right-sidebar,
  #map-wrapper.with-both-sidebars {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #left-sidebar .sidebar-content {
    height: auto !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-bottom: 4px !important;
  }

  #popup-content {
    max-height: calc(100dvh - 65px) !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px !important;
  }

  /* Center + smaller infocard photo */
  #infocard-image {
    display: block !important;
    margin: 0 auto !important;
    max-height: 190px !important;
    width: auto !important;
    object-fit: contain;
  }

  .infocard-title { 
    font-size: 13px !important; 
    padding: 3px !important; 
  }

  .infocard-subtitle { 
    font-size: 10px !important; 
  }

  .trophic-icon {
    width: 32px !important;
    height: 32px !important;
  }

  .icon-row {
    gap: 6px !important;
    padding: 3px !important;
  }

  .stat-bars-wrapper {
    max-width: 100% !important;
    padding: 3px !important;
  }

  .stat-bar-row {
    gap: 3px !important;
  }

  .stat-label {
    width: 58px !important;
    font-size: 9px !important;
    padding-right: 2px !important;
  }

  .stat-value {
    min-width: 38px !important;
    font-size: 9px !important;
  }

  .stat-bar {
    height: 11px !important;
    min-width: 85px !important;
  }

  .play-btn {
    width: 95px !important;
    font-size: 11px !important;
    padding: 3px 4px !important;
  }

  #description-box p {
    font-size: 11px !important;
  }

  /* Tooltip styling */
  .icon-tooltip {
    position: fixed !important;
    z-index: 10001 !important;
    background: #1f2a38 !important;
    color: #fff !important;
    font-size: 14px !important;
    padding: 8px 14px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
    pointer-events: none !important;
    max-width: 240px !important;
    text-align: center !important;
    line-height: 1.3 !important;
  }

  /* Special Thanks - normal flow */
  .special-thanks {
    position: static !important;
    margin-top: 8px !important;
    padding-top: 6px !important;
    background-color: transparent !important;
    border-top: 1px solid #444 !important;
  }

  .special-thanks-content {
    padding: 8px 0 !important;
  }

  /* =============================================
     TOPBAR CONTROLS – Tighter on mobile
     ============================================= */
  .controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
    margin-bottom: 8px;
    padding: 0 4px;
  }

  .controls label {
    margin: 0 !important;
    font-size: 13px;
    padding: 2px 4px;
    background: #222;
    border-radius: 4px;
  }

  .controls button {
    margin: 0 !important;
    padding: 4px 8px;
    font-size: 13px;
  }

  .controls input[type="checkbox"] {
    margin-right: 3px;
    vertical-align: middle;
  }
}