/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* RDR2 Color Palette */
    --bg-dark: #000000;
    --bg-darker: #0d0d0d;
    --bg-card: #1a1a1a;
    --text-primary: #eee;
    --text-secondary: #a0a0a0;
    --accent-orange: #ff8c42;
    --accent-red: #cc0000;
    --accent-blue: #56a8d3;
    --accent-green: #5cb85c;
    --accent-yellow: #fef390;
    --border-color: #3a3a3a;
    --wanted-divider: #7a0e1d;
    
    /* RDR2 Fonts */
    --default-content-font: Hapna;
    --default-title-font: RDRLino;
    --content-font: var(--default-content-font), serif;
    --title-font: var(--default-title-font), serif;
    --button-font: RDRCatalogueBold, var(--content-font), serif;
    --ctrl-meta-key: 'Ctrl';
}

/* Custom RDR2 Fonts (optional - load from web or local files) */
@font-face {
    font-family: 'RDRLino';
    src: url('assets/fonts/RDRLino-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Hapna';
    src: url('assets/fonts/hapna.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: var(--content-font);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 100%;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header - OSG Style */
#main-logo {
    max-height: 130px;
    height: auto;
    width: auto;
    object-fit: contain;
    background: transparent;
    position: absolute;
    left: 10px;
    top: 45%;
    transform: translateY(-50%);
    z-index: 10;
}

#main-header::after {
    clear: both;
}

#main-header-center {
    flex-grow: 1;
    flex-shrink: 1;
    width: auto;
    max-width: 360px;
    height: auto;
    background-image: url(assets/images/header_bg_center.png);
    background-repeat: repeat-x;
    background-size: auto 100%;
    padding: 20px 10px 60px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#main-header-center>span {
    font-family: var(--title-font);
    font-weight: normal;
    text-rendering: optimizeLegibility;
    font-size: 28px;
}

#main-header-left-sidebar {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -khtml-user-select: none;
    user-select: none;
    height: 140px;
    width: auto;
    max-width: 20px;
    display: block;
    margin: 0;
    padding: 0;
}

#main-header-right {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -khtml-user-select: none;
    user-select: none;
    height: 140px;
    width: auto;
    max-width: 20px;
    display: block;
    margin: 0;
    padding: 0;
}

#sub-header {
    font-family: var(--title-font);
    font-weight: 400;
    font-size: 16px;
    color: #cacaca;
    padding-top: 10px;
}

#sub-header .cycle-date,
#sub-header .collectables-counter {
    position: relative;
    background-image: url(assets/images/divider_dark_vertical.png);
    background-position: right 5px center;
    background-repeat: no-repeat;
    padding: 2px 18px 0 0;
}

#sub-header .cycle-date:hover::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 18px;
    height: 2px;
    background-image: url(assets/images/wanted_location_divider.png);
    background-repeat: repeat-x;
    background-size: cover;
}

.scroller {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0;
    background-color: var(--bg-darker);
    width: 400px;
    overflow: hidden;
}

.scroller-grow {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
}

.scroller-grow img {
    height: 20px;
    width: auto;
}

.scroller-stat {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 250px;
}

.scroller-line-tp {
    height: 20px;
    width: auto;
}

/* Top Navigation Links */
.top-nav {
    position: fixed;
    top: 180px;
    left: 0;
    width: 400px;
    z-index: 1001;
    background-color: var(--bg-darker);
}

.top-nav .header-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem 0.5rem 2rem;
}

.top-nav .header-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.top-nav .header-links a:hover {
    color: var(--accent-yellow);
}

/* Controls - RDR2 Themed */
.controls {
    padding: 1rem 1rem;
    background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)), #000;
    background-image: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)), 
                      url('assets/images/bgMain_slice.png');
    background-repeat: repeat;
    border-bottom: 2px solid var(--wanted-divider);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
    position: fixed;
    top: 280px;
    left: 0;
    z-index: 999;
    width: 400px;
}

.search-box {
    flex: 1 1 auto;
    min-width: 200px;
    max-width: 310px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
}

.input-search-hotkeys {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: opacity .3s;
    z-index: 1;
}

.hotkey {
    display: inline-block;
    color: rgba(123, 102, 175, .8);
    font-family: var(--title-font);
    font-size: 12px;
    font-weight: 700;
    margin-right: 2px;
    padding: 2px 4px;
    background-color: rgba(123, 102, 175, .2);
    border: 2px solid rgba(123, 102, 175, .8);
    border-radius: 3px;
}

.input-search-hotkeys .hotkey:first-child:after {
    content: var(--ctrl-meta-key);
    letter-spacing: normal;
}

.input-action-copy,
.input-action-clear {
    display: inline-block;
    width: 30px;
    height: 30px;
    background-size: auto 20px;
    background-repeat: no-repeat;
    background-position: center;
    margin-left: 0;
    cursor: pointer;
    vertical-align: middle;
    flex-shrink: 0;
}

.input-action-copy {
    background-image: url(assets/images/action_indicator_copy.png);
    cursor: copy;
    margin-left: 2px;
}

.input-action-clear {
    background-image: url(assets/images/action_indicator_clear.png);
    cursor: pointer;
    margin-left: auto;
    margin-right: -10px;
}

/* Query Suggestions Dropdown */
.query-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background-color: rgba(0, 0, 0, 0.95);
    background-image: url('assets/images/bgTextDark_2.png');
    background-size: cover;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.query-suggestions-hotkeys {
    display: block;
    padding: 8px 12px;
    font-size: 11px;
    color: rgba(123, 102, 175, 0.9);
    background-color: rgba(123, 102, 175, 0.1);
    border-bottom: 1px solid rgba(123, 102, 175, 0.3);
    font-family: var(--content-font);
}

.query-suggestions-hotkeys .hotkey {
    padding: 1px 3px;
    font-size: 10px;
    margin: 0 2px;
}

.query-suggestion {
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: var(--content-font);
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s, color 0.2s;
}

.query-suggestion:last-child {
    border-bottom: none;
}

.query-suggestion:hover,
.query-suggestion.selected {
    background-color: rgba(123, 102, 175, 0.3);
    color: #fff;
}

.query-suggestion small {
    font-size: 11px;
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background-color: rgba(0, 0, 0, 0.6);
    background-image: url('assets/images/bgTextDark_2.png');
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background-color: rgba(0, 0, 0, 0.8);
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

/* RDR2 Button Styles */
.btn-filter {
    padding: 0.75rem 1.5rem;
    background-image: url('assets/images/menu_option.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s;
    user-select: none;
}

.btn-filter:hover {
    background-image: url('assets/images/menu_highlight.png');
    filter: brightness(1.2);
}

.btn-filter.active {
    background-image: url('assets/images/menu_highlight.png');
    color: var(--accent-yellow);
}

/* Content Wrapper */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 200px;
}

.content-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
    margin-top: 0;
    height: calc(100vh - 340px);
}

/* Sidebar - RDR2 Themed */
.sidebar {
    width: 400px;
    background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)), #000;
    background-image: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)), 
                      url('assets/images/bgMain_slice.png');
    background-repeat: repeat;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 2px solid var(--wanted-divider);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 390px;
    left: 0;
    bottom: 56px;
    z-index: 998;
    color: var(--text-primary);
    user-select: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-darker);
    padding: 10px 5px 20px 5px;
    width: 400px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    overflow: hidden;
}

/* Custom Scrollbar - RDR2 Style */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background-color: #aaa;
    background: url('assets/images/bgTextDark.png') repeat;
}

.sidebar::-webkit-scrollbar-track:hover {
    background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)), 
                url('assets/images/bgMain_slice.png') repeat;
}

.location-groups {
    overflow-y: auto;
    height: 100%;
    padding: 45px 10px 10px 10px;
}

.location-group {
    margin-bottom: 0px;
}

/* Group Header - RDR2 Collapsible Style */
.group-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    cursor: pointer;
    line-height: 36px;
    user-select: none;
    transition: all 0.2s;
}

.group-header:hover {
    background-image: url('assets/images/menu_highlight.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.group-header span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    padding-left: 12px;
}

.group-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -4px 0 -3px 2px;
}

.group-icon img,
.group-icon-img {
    width: 35px;
    height: 35px;
    object-fit: contain;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.8));
}

.icon-valentine { background-color: var(--accent-red); border-radius: 50%; }
.icon-blackwater { background-color: var(--accent-blue); border-radius: 50%; }
.icon-strawberry { background-color: #ff69b4; border-radius: 50%; }
.icon-rhodes { background-color: #8b4513; border-radius: 50%; }
.icon-tumbleweed { background-color: #800080; border-radius: 50%; }
.icon-macfarlanes-ranch { background-color: #696969; border-radius: 50%; }
.icon-saintdenis { background-color: #800080; border-radius: 50%; }
.icon-annesburg { background-color: #696969; border-radius: 50%; }
.icon-vanhorn { background-color: #20b2aa; border-radius: 50%; }
.icon-others { background-color: var(--accent-green); border-radius: 50%; }

.group-title {
    flex: 1;
    font-size: 15px;
    font-weight: normal;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Arrow for collapsible groups */
.group-header::after {
    content: '';
    min-width: 42px;
    height: 38px;
    background: url('assets/images/arrow.png') center no-repeat;
    background-size: 21px 21px;
    margin: auto 0 auto 5px;
    padding: 0 5px 0 0;
    filter: brightness(0.825);
    transition: transform 0.2s ease-in-out;
}

.group-header.collapsed::after {
    transform: rotate(180deg);
}

/* Collection Value Dividers - RDR2 Wanted Poster Style */
.collection-value {
    position: relative;
    height: 34.45px;
    text-align: center;
    padding: 5px 0;
    display: flex;
    justify-content: space-around;
    margin: 6px 0;
}

.collection-value::before,
.collection-value::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: url('assets/images/wanted_location_divider.png') repeat;
    background-size: contain;
}

.collection-value::before {
    top: 0;
}

.collection-value::after {
    bottom: 0;
}

/* Location List - Hidden/Collapsed by default */
.location-list {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 250ms ease-out;
    margin: 0 -10px;
    padding: 0 10px;
}

.location-list.opened {
    max-height: 2000px;
    transition: max-height 400ms linear;
}

.location-item {
    position: relative;
    padding: 6px 12px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.location-item:hover {
    background-image: url('assets/images/menu_highlight.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.location-item.active {
    background-image: url('assets/images/menu_highlight.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    color: var(--accent-yellow);
}

.location-item .collectible-icon {
    width: 24px;
    height: 24px;
    margin-right: 6px;
    flex-shrink: 0;
}

.location-item .collectible-text {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.location-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-available { background-color: var(--accent-green); }
.status-unavailable { background-color: var(--text-secondary); }
.status-new { background-color: var(--accent-blue); }

/* Map Container - RDR2 Themed */
.map-container {
    flex: 1;
    position: fixed;
    top: 0;
    left: 400px;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background-color: #d2b790;
}

#map {
    width: 100%;
    height: 100%;
    background-color: #d2b790;
}

/* Leaflet Controls - RDR2 Style */
.leaflet-control-zoom a,
.leaflet-bar a {
    background-color: rgba(0, 0, 0, 0.8) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.leaflet-control-zoom a:hover,
.leaflet-bar a:hover {
    background-color: rgba(0, 0, 0, 0.9) !important;
    filter: brightness(1.2);
}

.leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.8) !important;
    color: var(--text-primary) !important;
    border-radius: 3px;
}

.leaflet-control-attribution a {
    color: var(--accent-blue) !important;
}

/* Leaflet Marker Customization */
.leaflet-marker-icon {
    border: none !important;
    background: transparent !important;
}

.custom-marker {
    width: 35px;
    height: 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.marker-pin {
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, var(--accent-orange), #d97036);
    border-radius: 50% 50% 50% 0;
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-icon {
    transform: rotate(45deg);
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
}

/* Leaflet Popup Customization - RDR2 Style */
.leaflet-popup-content-wrapper {
    background-color: #1a1a1a;
    background-image: url('assets/images/bgTextDark_2.png'), url('assets/images/mask_1.png');
    background-size: cover, cover;
    background-position: center, center;
    color: var(--text-primary);
    border-radius: 0;
    border: 2px solid var(--wanted-divider);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.8);
    padding: 10px 1px 1px 1px;
}

.leaflet-popup-content {
    margin: 15px;
    width: 501px;
}

.leaflet-popup-tip {
    background: rgba(0, 0, 0, 0.95) !important;
    border: 2px solid var(--wanted-divider);
    border-top: none;
    border-right: none;
}

/* OSG-style popup */
.handover-wrapper-with-no-influence h1 {
    margin: 0 0 20px 0;
    color: var(--accent-yellow);
    font-size: 1.3rem;
    border-bottom: 1px solid var(--wanted-divider);
    padding-bottom: 12px;
    font-weight: 600;
    font-family: var(--title-font);
}

.marker-content-wrapper {
    display: block;
    margin-bottom: 15px;
}

.primary-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 10px 0;
    text-transform: capitalize;
}

.secondary-description {
    margin: 15px 0;
}

.secondary-description img {
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

.video-link-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.video-link-button {
    display: inline-block;
    padding: 10px 30px;
    background-color: rgba(0, 0, 0, 0.6);
    background-image: url('assets/images/bgTextDark_2.png');
    background-size: cover;
    border: 2px solid var(--accent-blue);
    border-radius: 6px;
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.video-link-button:hover {
    background-color: var(--accent-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(86, 168, 211, 0.4);
}

.tebex-button {
    width: 100%;
    padding: 12px 20px;
    background-color: #d64d00;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.tebex-button:hover {
    background-color: #e65c00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(214, 77, 0, 0.4);
}

.leaflet-container a.leaflet-popup-close-button {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 14px;
    background-color: transparent;
    background: url('assets/images/close_button_popup.png') no-repeat center center;
    background-size: 100% 100%;
    border: none;
    filter: brightness(0.75);
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: transparent;
    opacity: 0.8;
}

/* Footer - RDR2 Themed */
footer {
    background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)), #000;
    background-image: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)), 
                      url('assets/images/bgMain_slice.png');
    background-repeat: repeat;
    padding: 1rem 2rem;
    border-top: 2px solid var(--wanted-divider);
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 400px;
    z-index: 1000;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0 !important;
}

/* Scrollbar Styling - RDR2 Theme */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: #aaa;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(200, 199, 199, .4);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2000;
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--wanted-divider);
    border-radius: 6px;
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.mobile-menu-toggle:hover {
    background-color: var(--accent-orange);
    border-color: var(--accent-orange);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar,
    .top-nav,
    .controls,
    footer {
        width: 350px;
    }
    
    .map-container {
        left: 350px;
    }
    
    .sidebar-header {
        width: 350px;
    }
    
    .sidebar {
        top: 410px;
    }
    
    .scroller {
        width: 350px;
        max-width: 350px;
    }
    
    .scroller-grow img {
        height: 18px;
        max-width: 14px;
    }
    
    .scroller-stat {
        max-width: 220px;
    }
    
    .scroller-line-tp {
        height: 18px;
    }
}

@media (max-width: 767px) {
    /* Adjust popup card size for mobile */
    .leaflet-popup-content-wrapper {
        padding: 8px 1px 1px 1px;
    }
    
    .leaflet-popup-content {
        margin: 12px;
        width: 280px !important;
        max-width: calc(100vw - 40px);
    }
    
    .handover-wrapper-with-no-influence h1 {
        font-size: 1.1rem;
        margin: 0 0 12px 0;
        padding-bottom: 8px;
    }
    
    .primary-description {
        font-size: 0.85rem;
        margin: 8px 0;
    }
    
    .secondary-description {
        margin: 12px 0;
    }
    
    .secondary-description img {
        width: 100%;
        height: auto;
        max-width: 100%;
    }
    
    .video-link-container {
        margin: 15px 0;
    }
    
    .video-link-button {
        padding: 8px 20px;
        font-size: 0.85rem;
    }
    
    .tebex-button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Hide sidebar by default on mobile */
    .sidebar,
    .sidebar-header,
    .top-nav,
    .controls,
    footer {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    
    /* Show sidebar when active */
    body.mobile-menu-open .sidebar,
    body.mobile-menu-open .sidebar-header,
    body.mobile-menu-open .top-nav,
    body.mobile-menu-open .controls,
    body.mobile-menu-open footer {
        transform: translateX(0);
    }
    
    /* Overlay for mobile menu */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 1500;
    }
    
    body.mobile-menu-open .mobile-overlay {
        display: block;
    }
    
    /* Adjust sidebar for mobile */
    .sidebar-header {
        width: 100%;
        max-width: 400px;
        padding: 10px 5px 10px 5px;
        height: auto;
        min-height: 80px;
    }
    
    #main-logo,
    #main-header-left-sidebar,
    #main-header-right {
        display: none;
    }
    
    #main-header-center {
        max-width: 100%;
    }
    
    #main-header-center > span {
        font-size: 18px;
    }
    
    #sub-header {
        font-size: 12px;
        padding-top: 5px;
    }
    
    .scroller {
        display: none;
    }
    
    .sidebar,
    .top-nav,
    .controls,
    footer {
        width: 100%;
        max-width: 400px;
        position: fixed;
        z-index: 1600;
    }
    
    .sidebar {
        top: 250px;
        bottom: 56px;
    }
    
    .top-nav {
        top: 110px;
        padding-bottom: 0;
    }
    
    .controls {
        top: 155px;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
        width: 100%;
        max-width: 400px;
        box-sizing: border-box;
    }
    
    footer {
        width: 100%;
        max-width: 400px;
    }
    
    .map-container {
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
    }
    
    .search-box {
        min-width: auto;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        position: relative;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .search-box input {
        width: calc(100% - 75px);
        box-sizing: border-box;
        padding-right: 10px;
        flex: 1 1 auto;
        min-width: 0;
    }
    
    .input-action-copy,
    .input-action-clear {
        position: relative;
        right: auto;
        flex-shrink: 0;
        margin: 0;
        width: 30px;
        height: 30px;
    }
    
    .input-action-clear {
        right: auto;
        order: 2;
    }
    
    .input-action-copy {
        order: 3;
    }
    
    .input-search-hotkeys {
        display: none !important;
    }
    
    .filter-buttons {
        flex-wrap: nowrap;
        width: 100%;
        gap: 0.25rem;
        box-sizing: border-box;
    }
    
    .btn-filter {
        flex: 1 1 auto;
        min-width: 70px;
        padding: 0.5rem 0.4rem;
        font-size: 10px;
        white-space: nowrap;
        box-sizing: border-box;
    }
    
    .header-links {
        gap: 0.75rem !important;
        padding: 0.75rem 1rem 0.5rem 1rem !important;
        flex-wrap: wrap;
    }
    
    .header-links a {
        font-size: 12px !important;
    }
    
    .top-nav {
        padding-bottom: 0;
    }
    
    .scroller {
        width: 100%;
        max-width: 400px;
        padding: 0.2rem 0.5rem;
        margin-bottom: 0;
    }
    
    .scroller-grow img {
        height: 16px;
        max-width: 15px;
    }
    
    .scroller-stat {
        max-width: 200px;
    }
    
    .scroller-line-tp {
        height: 16px;
    }
}

@media (max-width: 480px) {
    /* Further reduce popup size for small phones */
    .leaflet-popup-content {
        width: 260px !important;
        max-width: calc(100vw - 30px);
        margin: 10px;
    }
    
    .handover-wrapper-with-no-influence h1 {
        font-size: 1rem;
        margin: 0 0 10px 0;
        padding-bottom: 6px;
    }
    
    .primary-description {
        font-size: 0.8rem;
        margin: 6px 0;
    }
    
    .secondary-description {
        margin: 10px 0;
    }
    
    .video-link-container {
        margin: 12px 0;
    }
    
    .video-link-button {
        padding: 7px 16px;
        font-size: 0.8rem;
    }
    
    .tebex-button {
        padding: 9px 14px;
        font-size: 0.85rem;
    }
    
    #main-logo {
        max-height: 60px;
    }
    
    #main-header-center > span {
        font-size: 18px;
    }
    
    #sub-header {
        font-size: 12px;
    }
    
    .btn-filter {
        font-size: 11px;
        padding: 0.5rem 0.75rem;
    }
    
    .header-links a {
        font-size: 11px !important;
    }
    
    .scroller {
        max-width: 280px;
        padding: 0.2rem 0.25rem;
    }
    
    .scroller-grow img {
        height: 14px;
        max-width: 12px;
    }
    
    .scroller-stat {
        max-width: 180px;
    }
    
    .scroller-line-tp {
        height: 14px;
    }
}

/* Hidden state */
.hidden {
    display: none !important;
}
