@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/roboto-v51-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 800;
    src: url('fonts/roboto-v51-latin-800.woff2') format('woff2');
}
@font-face {
    font-family: 'Tilt Warp';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/tilt-warp-v18-latin-regular.woff2') format('woff2');
}

/* ==========================================================================
   1. UNIFIED TYPOGRAPHY & BASE RESET
   ========================================================================== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; 
    position: fixed; 
    width: 100%;
}

.roboto-<uniquifier> {
  font-family: "Roboto", sans-serif;
  font-optical-sizing: auto;
  font-weight: 800;
  font-style: normal;
  font-variation-settings:
    "wdth" 100;
}

.tilt-warp-<uniquifier> {
  font-family: "Tilt Warp", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings:
    "XROT" 9,
    "YROT" 0;
}


html, body, button, input, select, textarea {
    font-family: 'Roboto', Tahoma, Geneva, Verdana, sans-serif;
    color: #333333;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Base header styles */
h2 {
    font-size: 18px;
    font-weight: 800;
    color: #2c2c2c; /* High contrast charcoal dark text */
    margin-top: 0;
    margin-bottom: 12px;
}

hr {
    border: 0;
    border-top: 1px solid #D0AFB7;
    margin: 15px 0;
}

/* ==========================================================================
   2. MAP CONFIGURATION
   ========================================================================== */
#map {
    height: 100%;
    width: 100%;
    touch-action: none; 
}

/* Force Leaflet elements to use our custom font */
.leaflet-container {
    font-family: 'Roboto', Tahoma, Geneva, Verdana, sans-serif !important;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #D0AFB7; 
    z-index: 20000; 
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.loader-content {
    text-align: center;
}

#loading-logo {
    width: 100%; 
    margin-bottom: 20px;
    animation: pulse 2s infinite ease-in-out;
}

#loading-text {
    color: #333333;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* ==========================================================================
   3. MAIN MENU DASHBOARD (MINIMALIST OFF-WHITE & SUBTLE PINK)
   ========================================================================== */
#unified-menu-dashboard {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 10001;
    background: #D0AFB7; /* Your preferred dusky pink */
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); /* Slightly deeper shadow for depth */
    border: 1px solid rgba(255, 255, 255, 0.3); /* Soft white transparent border */
    width: 350px;
    height: 44px;
    overflow: hidden;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), height 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

#unified-menu-header {
    position: fixed;
    top: 10px;
    left: 50px;
    z-index: 10002;
    background: transparent; /* Your preferred dusky pink */
    padding: 0;
    border-radius: 12px;
    
    width: 300px;
    height: 44px;
    overflow: hidden;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), height 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;

}
#menu-header-text {
    font-family: "Tilt Warp";
    width: 300px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #444444; /* Dark grey text color */
    font-weight: bold;
   
}

/* State when menu is expanded */
#unified-menu-dashboard.open {
    width: 350px;
    height: auto;
    padding: 6px;
    overflow: hidden;
}

#menu-trigger-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #444444; /* Dark grey text color */
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

#menu-collapsible-panel {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
    width: 100%;
}

#unified-menu-dashboard.open #menu-collapsible-panel {
    display: flex;
}

/* Minimalist Language Selector Segment Track */
.dashboard-lang-row {
    display: flex;
    gap: 4px;
    width: 100%;
    background: rgba(0, 0, 0, 0.08); /* Darkens the track background relative to the pink */
    padding: 3px;
    border-radius: 8px;
    box-sizing: border-box;
}
.dashboard-lang-row button, .sort-tab {
    flex: 1;
    height: 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #4a4a4a; /* Muted dark gray text */
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: all 0.15s ease;
}
/* Active State: The active pill pops out crisply */
.dashboard-lang-row button.active-lang, 
.sort-tab.active {
    background: #fcecef !important; /* Pure white active pill card */
    color: #333333 !important;      /* Accent color for text */
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
/* Subtle pink highlight for active language or hover states */
.dashboard-lang-row button.active-lang, 
.dashboard-lang-row button:hover {
    background: #fcecef; /* Beautiful soft pink highlight */
    color: #333333;      /* Crisp dark grey text */
    font-weight: bold;
}

/* Clean, Non-intrusive View Toggle Button */
.dashboard-view-toggle {
    width: 100%;
    height: 24px;
    border: 1px solid #D0AFB7;
    border-radius: 6px;
    background: #D0AFB7; /* Matches menu card off-white */
    color: #444444;      /* Dark grey text */
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s ease;
    margin-top: 2px;
}

.dashboard-view-toggle:hover {
    background: #fcecef; /* Subtle pink hover background match */
    border-color: #D0AFB7;
}

.menu-divider, hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.4); /* Crisp, clean semi-transparent white separator */
    margin: 8px 0;
}

#checkbox-list {
    width: 100%;
    display: block;
}

/* ==========================================================================
   4. DYNAMIC MENU CONTENT (TONED DOWN & SEGMENTED)
   ========================================================================== */
.menu-loading-text {
    padding: 10px;
    font-style: italic;
    color: #888;
}

/* Segmented Control Pill Bar for Sorting Tabs */
.sort-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: #D0AFB7; /* Pill track styling matching the language track */
    padding: 2px;
    border-radius: 6px;
    white-space: nowrap;
}

.sort-tab {
    flex: 1;
    padding: 5px 2px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #666666; /* Subdued dark grey text */
    text-align: center;
    transition: all 0.15s ease;
}

/* Active Sorting Filter becomes a clean white active card node */
.sort-tab.active {
    background: #D0AFB7;
    color: #333333;
    font-weight: bold;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

/* Stripped-Down Category Headers (Removes the yellow blocker badge background) */
.category-header-container {
    padding: 12px 0 4px 2px;
    margin-top: 6px;
    
}

.category-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 8px; /* Restored clean padding since it has a background again */
    border-radius: 4px;
}

/* Scrollable location list */
.scroll-wrapper {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 2px;

    
}
.scroll-wrapper::-webkit-scrollbar {
    width: 6px;
}
.scroll-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.scroll-wrapper::-webkit-scrollbar-thumb {
    background: #d0afb7;
    border-radius: 10px;
}
.scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #bc6f3c;
}

/* Category Sub-Headers */
.category-header-container {
    padding: 8px 0 4px 0;
    margin-top: 4px;
   
}

.category-badge {
    display: inline-block;
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* Individual Location Item Rows */
.menu-location-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 4px;
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
    transition: background 0.1s ease;
}

.menu-location-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.menu-location-item.active {
    background-color: rgba(188, 111, 60, 0.15);
    font-weight: bold;
}

.menu-location-item.active:hover {
    background-color: rgba(188, 111, 60, 0.15);
}

.item-content-wrapper {
    display: flex;
    align-items: flex-start;
    width: 100%;
    text-align: left;
}

.category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    margin-top: 4px;
}

.number-column {
    width: 24px;
    font-weight: bold;
    color: #333333;
    flex-shrink: 0;
    display: inline-block;
}

/* Individual Location Text Row */
.item-text {
    display: inline-block;
    flex: 1;
    white-space: nowrap;  /* <-- Change this to nowrap to stabilize during animation */
    overflow: hidden;     /* <-- Prevents extra-long names from leaking */
    text-overflow: ellipsis; /* <-- Adds clean trailing dots (...) if a location name is too long for the 310px box */
    line-height: 1.3;
    color: #333;
}

/* Manual "Om kartan" Link Footer inside menu */
.manual-footer-container {
    border-top: 1px solid #ddd;
    margin-top: 10px;
    padding-top: 10px;
    text-align: center;
}

.btn-manual-text {
    background: none;
    border: none;
    color: #333333;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
}

.btn-manual-text:hover {
    text-decoration: underline;
}

/* ==========================================================================
   5. MODALS & POPUPS
   ========================================================================== */
#infoModal,
#welcomeModal,
#manualModal {
    display: none;
    position: fixed;
    z-index: 20005;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px); 
    cursor: pointer; /* Allows clicking outside to close */
}

.modal-card {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 650px;
    position: relative;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 4px solid #d0afb7;
    cursor: default; /* Stops closing when clicking inside the card */
    max-height: 80vh;
    overflow-y: auto;
    box-sizing: border-box;
}

#closeModal,
#closeWelcome,
#closeManual {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}

#closeModal:hover,
#closeWelcome:hover,
#closeManual:hover {
    color: #bc6f3c;
}

/* Formatting for the text fetched from CSV inside Modals */
.lang-section {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 15px;
}

.cookie-text {
    font-size: 0.85em;
    color: #666;
}

.address-text {
    font-style: italic;
    margin-top: 10px;
}

/* Custom Leaflet Marker Popups */
.custom-popup {
    text-align: center;
    padding: 5px;
}

.custom-popup strong {
    font-size: 14px;
    font-weight: 600;
}

.leaflet-popup-content-wrapper {
    border: 1px solid #bc6f3c;
    border-radius: 8px;
}

/* ==========================================================================
   6. BUTTONS & UTILITIES
   ========================================================================== */
.popup-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background-color: #bc6f3c;
    color: white !important;
    border: none; 
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer; 
    transition: background 0.2s;
}

.popup-btn:hover {
    background-color: #9c5b31;
}

.website-link {
    display: inline-block;
    padding: 10px;
    background-color: #BC6F3C;
    color: white !important;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 15px;
    transition: background 0.2s;
}

.website-link:hover {
    background-color: #9c5b31;
}

/* Cookie Consent Buttons */
.cookie-buttons-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-cookie-accept {
    flex: 1;
    padding: 12px;
    background: #bc6f3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-cookie-accept:hover {
    background: #9c5b31;
}

.btn-cookie-reject {
    flex: 1;
    padding: 12px;
    background: #eee;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
}

.btn-cookie-reject:hover {
    background: #ddd;
}

/* ==========================================================================
   LOCATION POPUP MODAL EXTENSIONS
   ========================================================================== */

/* 1. Address Text & Web Links Layout */
.modal-address-text {
    font-style: italic;
    margin-top: 10px;
}

.modal-web-container {
    margin-top: 15px;
}

.modal-web-btn {
    display: inline-block;
    padding: 10px;
    background: #BC6F3C;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.2s;
}

.modal-web-btn:hover {
    background: #9c5b31;
}

/* 2. Gallery Wrapper Deck Context */
.modal-gallery-container {
    position: relative;
    width: 100%;
    height: auto;        /* Let the container expand naturally */
    margin-bottom: 15px;
    background-color: #f7f7f7;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 3. Sliding Images Structure */
.gallery-slide {
    width: 100%;
    height: auto;        /* Complete flexibility for natural aspect ratios */
    max-height: 75vh;    /* SAFETY CAP: Never lets an image take up more than 75% of the screen height */
    object-fit: contain; /* Keeps the entire photo uncropped and fully visible */
    display: none; 
}

.gallery-slide.active {
    display: block; 
}



/* 4. Overlay Navigation Arrow Anchors */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    font-size: 18px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    transition: background 0.2s;
    z-index: 10;
}

.gallery-nav:hover {
    background: rgba(188, 111, 60, 0.9);
}

.gallery-nav.prev {
    left: 10px;
}

.gallery-nav.next {
    right: 10px;
}

/* 5. Pagination Slide Counter Badge */
.gallery-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 20px;
    letter-spacing: 0.5px;
    z-index: 10;
}