:root {
    --accent: #f5c400;
    --glass: rgba(255, 255, 255, 0.85);
    --border: rgba(0, 0, 0, 0.1);
    --text: #1a1a1a;
    --text-dim: rgba(0, 0, 0, 0.5);
}

body,
html,
#map {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    background: #fff;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    overflow: hidden;
    color: var(--text);
}

.krizl-glass {
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* Lighter border for clean edge */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    /* Soft, deep shadow */
}

#menu-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2000;
    padding: 12px 18px;
    cursor: pointer;
    border-radius: 12px;
    transition: 0.3s;
    background: var(--accent);
    /* Yellow accent */
    border: none;
    /* Remove border for cleaner look */
    color: #fff;
    /* White icon */
    box-shadow: 0 4px 15px rgba(245, 196, 0, 0.4);
    /* Glow effect */
}

#menu-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(245, 196, 0, 0.6);
}

#menu-overlay {
    position: fixed;
    top: 0;
    /* width (280) + padding (30*2) = 340px total width. Hide fully with -340px */
    left: -340px;
    width: 280px;
    height: 100%;
    z-index: 3000;
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    padding: 80px 30px;
}

#menu-overlay.active {
    transform: translateX(340px);
}

#menu-scrim,
#modal-scrim {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2999;
}

#menu-scrim.active,
#modal-scrim.active {
    display: block;
    background: rgba(255, 255, 255, 0.4);
}

.lang-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.lang-link {
    cursor: pointer;
    opacity: 0.3;
    font-size: 12px;
    font-weight: bold;
    transition: 0.3s;
    color: var(--text);
}

.lang-link.active {
    opacity: 1;
    color: var(--accent);
}

.menu-item {
    position: relative;
    margin: 15px 0;
    cursor: pointer;
    opacity: 0.8;
    text-transform: uppercase;
    font-size: 16px;
    transition: 0.3s;
    display: inline-block;
}

.menu-item:hover {
    color: var(--accent);
    opacity: 1;
}

/* ... existing code ... */

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 850px;
    padding: 40px;
    border-radius: 24px;
    z-index: 4000;
    max-height: 85vh;
    overflow-y: auto;
    /* Enhanced Modal Shadow */
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ... existing code ... */

/* Counter Styles */
#counter-container {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: rgba(245, 196, 0, 0.1);
    /* Very light accent bg */
    border-radius: 12px;
    border: 1px solid rgba(245, 196, 0, 0.3);
}

#counter-number {
    display: block;
    font-size: 48px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

#counter-label {
    display: block;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.7;
    margin-top: 5px;
}

/* ... existing code ... */

/* Global Gallery Grid (v0.4.0 - Große Darstellung für alle) */
.gallery-grid {
    display: grid;
    gap: 20px;
    /* Increased gap for better spacing */
    margin: 25px 0;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* New Gallery Item Styles */
.gallery-item {
    width: 100%;
    border-radius: 12px;
    cursor: zoom-in;
    /* Indicates Lightbox */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: center;
}

.gallery-item:hover {
    transform: scale(1.03) translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    filter: brightness(1.05);
    z-index: 10;
}

#ui-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(30, 30, 30, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(245, 196, 0, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* Tour Dropdown */
#tour-select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(245, 196, 0, 0.3);
    border-radius: 20px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #f0f0f0;
    cursor: pointer;
    outline: none;
    transition: 0.3s;
    max-width: 200px;
}

#tour-select option {
    background: #2a2a2a;
    color: #f0f0f0;
}

#tour-select:focus {
    border-color: #f5c400;
    box-shadow: 0 0 0 2px rgba(245, 196, 0, 0.3);
}

#tour-text {
    color: #f5c400;
    font-size: 13px;
}

.tour-btn {
    background: rgba(245, 196, 0, 0.15);
    border: 1px solid rgba(245, 196, 0, 0.4);
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #f5c400;
    border-radius: 50%;
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: none;
}

.tour-btn:hover {
    background: rgba(245, 196, 0, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(245, 196, 0, 0.3);
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 5000;
    /* Higher than modal (4000) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

#lightbox-caption {
    margin-top: 10px;
    color: #ccc;
    font-size: 14px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 5001;
    transition: 0.3s;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--accent);
}

.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    z-index: 5001;
    background-color: rgba(0, 0, 0, 0.3);
}

.lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--accent);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Selection Mode Styles */
#selection-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 6000;
    pointer-events: none;
}

/* Entry animation for overlay */
#selection-overlay.active {
    display: block;
    animation: selectionFadeIn 0.4s ease-out;
}

@keyframes selectionFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#selection-box {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
    border-radius: 4px;

    pointer-events: auto;
    background: rgba(255, 255, 255, 0.05);

    resize: both;
    overflow: hidden;
    min-width: 100px;
    min-height: 100px;
    max-width: 90vw;
    max-height: 80vh;

    /* Pulsing border on load */
    animation: selectionPulse 1.5s ease-in-out 2;
}

/* Pulsing glow on the border */
@keyframes selectionPulse {

    0%,
    100% {
        border-color: var(--accent);
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
    }

    50% {
        border-color: #fff;
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7), 0 0 20px 4px rgba(245, 196, 0, 0.6);
    }
}

/* Custom visible resize handle */
#selection-box::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 28px 28px;
    border-color: transparent transparent var(--accent) transparent;
    cursor: se-resize;
    opacity: 0.9;
    transition: opacity 0.3s;
}

#selection-box:hover::after {
    opacity: 1;
}

/* Resize grip icon lines inside the triangle */
#selection-box::before {
    content: '⤡';
    position: absolute;
    bottom: 2px;
    right: 4px;
    color: #fff;
    font-size: 14px;
    z-index: 1;
    pointer-events: none;
}

#selection-controls {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    text-align: center;
    z-index: 6001;
}

#out-select-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(245, 196, 0, 0.4);
}

/* ── Glassmorphic Hotspot Popups ── */
.hotspot-popup .leaflet-popup-content-wrapper {
    background: rgba(30, 30, 30, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(245, 196, 0, 0.25);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    color: #f0f0f0;
    padding: 0;
    overflow: hidden;
    animation: popupFadeIn 0.3s ease-out;
}

.hotspot-popup .leaflet-popup-content {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

.hotspot-popup .leaflet-popup-tip {
    background: rgba(30, 30, 30, 0.75);
    border: none;
    box-shadow: none;
}

.hotspot-popup .leaflet-popup-close-button {
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    top: 6px;
    right: 8px;
    z-index: 10;
    transition: color 0.2s;
}

.hotspot-popup .leaflet-popup-close-button:hover {
    color: #f5c400;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Card content */
.hotspot-card {
    padding: 14px;
}

.hotspot-title {
    font-weight: 700;
    font-size: 14px;
    color: #f5c400;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.hotspot-thumb {
    position: relative;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    transition: transform 0.2s ease;
}

.hotspot-thumb:hover {
    transform: scale(1.02);
}

.hotspot-thumb img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

.hotspot-zoom-hint {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.5);
    padding: 3px 7px;
    border-radius: 8px;
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
    pointer-events: none;
}

.hotspot-thumb:hover .hotspot-zoom-hint {
    opacity: 1;
}

.hotspot-desc {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(240, 240, 240, 0.85);
    margin: 0;
}