.mystic-map {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.mystic-map__container {
    position: relative;
    width: 100%;
    padding-bottom: var(--scene-ratio, 38%);
    min-height: 320px;
    overflow: hidden;
}

.mystic-map__viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.mystic-map__scene {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--scene-width, 2000px);
    height: var(--scene-height, 800px);
    transform-origin: top left;
    transform: translate(0, 0) scale(1);
    transition: transform 900ms cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

.mystic-map__bg,
.mystic-map__markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
}

.mystic-map__bg {
    width: 100%;
    height: 100%;
    user-select: none;
    pointer-events: none;
    display: block;
    object-fit: cover;
    object-position: center;
}

.mystic-map__markers {
    pointer-events: none;
}

/* POI Base Styles */

.mystic-map__poi {
    position: absolute;
    cursor: pointer;
    pointer-events: all;
    opacity: 0;
    transform: translate(-50%, -50%) translateY(20px) scale(0.8);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.mystic-map__poi--visible {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0) scale(1);
}

.mystic-map__poi:hover {
    z-index: 10;
}

/* Logo Styles */
.mystic-map__poi--logo {
    z-index: 5;
}

.mystic-map__logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.mystic-map__logo-image {
    width: 480px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.mystic-map__poi--logo:hover .mystic-map__logo-image {
    transform: scale(1.08);
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.25));
}

/* Label Styles */
.mystic-map__poi--label {
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 16px;
}

.mystic-map__label {
    position: relative;
    display: flex;
    align-items: stretch;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* POI Illustrations */
.mystic-map__poi-illustration {
    width: 320px;
    height: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.mystic-map__poi-illustration--left {
    order: -1;
}

.mystic-map__poi-illustration--right {
    order: 1;
}

.mystic-map__poi--label:hover .mystic-map__poi-illustration {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

/* Arrow pointing right (more dramatic) */
.mystic-map__label--arrow-right {
    clip-path: polygon(0 0, calc(100% - 48px) 0, 100% 50%, calc(100% - 48px) 100%, 0 100%, 0 0);
}

/* Arrow pointing left (more dramatic) */
.mystic-map__label--arrow-left {
    clip-path: polygon(48px 0, 100% 0, 100% 100%, 48px 100%, 0 50%);
}

.mystic-map__label::before {
    content: '';
    width: 7px;
    flex-shrink: 0;
    transition: width 0.3s ease;
}

/* Left border for right-pointing arrows */
.mystic-map__label--arrow-right::before {
    order: -1;
}

/* Right border for left-pointing arrows */
.mystic-map__label--arrow-left::before {
    order: 1;
}

.mystic-map__label--blue::before {
    background: #092D4F;
}

.mystic-map__label--orange::before {
    background: #FF8C42;
}

.mystic-map__label--red::before {
    background: #C1392B;
}

.mystic-map__poi--label:hover .mystic-map__label {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.mystic-map__label-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

/* Padding for right-pointing arrows */
.mystic-map__label--arrow-right .mystic-map__label-content {
    padding: 24px 62px 24px 34px;
}

/* Padding for left-pointing arrows */
.mystic-map__label--arrow-left .mystic-map__label-content {
    padding: 24px 34px 24px 62px;
}

.mystic-map__label-title {
    font-family: "The Seasons", serif;
    font-size: 54px;
    font-weight: 400;
    color: #092D4F;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.mystic-map__label-distance {
    font-family: 'Montserrat', sans-serif;
    font-size: 40px;
    font-weight: 400;
    color: #666;
    line-height: 1.3;
}

/* Active State */
.mystic-map__poi--active .mystic-map__logo-image {
    transform: scale(1.1);
    filter: drop-shadow(0 6px 20px rgba(9, 45, 79, 0.4));
}

.mystic-map__poi--active .mystic-map__label {
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .mystic-map__container {
        scroll-behavior: auto;
    }

    .mystic-map__poi {
        transition: none;
        opacity: 1;
        transform: translate(-50%, -50%);
    }

    .mystic-map__logo-image,
    .mystic-map__label {
        transition: none;
    }
}

/* Loading state */
.mystic-map:not(.mystic-map--loaded) .mystic-map__poi {
    pointer-events: none;
}

/* Focus styles for accessibility */
.mystic-map__poi:focus {
    outline: none;
}

.mystic-map__poi:focus .mystic-map__logo-image {
    filter: drop-shadow(0 0 0 3px rgba(52, 152, 219, 0.5)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.mystic-map__poi:focus .mystic-map__label {
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(52, 152, 219, 0.5);
}

/* ----------------------------------------------------------- */
/* ------------------- Waypoint Navigation ------------------- */
/* ----------------------------------------------------------- */
.mystic-map__waypoints {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.mystic-map__waypoint {
    position: absolute;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(0.9);
}

.mystic-map__waypoint--visible {
    opacity: 1;
    transform: scale(1);
}

/* Waypoint flag container - matches POI label style */
.mystic-map__waypoint-flag {
    position: relative;
    display: flex;
    align-items: stretch;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

button.mystic-map__waypoint {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    outline: none;
}

.mystic-map__waypoint:hover .mystic-map__waypoint-flag {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

/* Colored border */
.mystic-map__waypoint-flag::before {
    content: '';
    width: 3px;
    flex-shrink: 0;
    order: -1;
}

.mystic-map__waypoint-flag--blue::before {
    background: #092D4F;
}

.mystic-map__waypoint-flag--orange::before {
    background: #FF8C42;
}

.mystic-map__waypoint-flag--red::before {
    background: #C1392B;
}

/* Content area */
.mystic-map__waypoint-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    padding: 8px 14px;
}

.mystic-map__waypoint-name {
    font-family: "The Seasons", serif;
    font-size: 16px;
    font-weight: 400;
    color: #092D4F;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.mystic-map__waypoint-distance {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #666;
    line-height: 1.3;
}

/* Mobile Waypoint Styles */
@media (max-width: 768px) {
    .mystic-map__waypoint-flag {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    .mystic-map__waypoint:hover .mystic-map__waypoint-flag {
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    }

    .mystic-map__waypoint-flag::before {
        width: 2px;
    }

    .mystic-map__waypoint-content {
        padding: 5px 10px;
    }

    .mystic-map__waypoint-name {
        font-size: 12px;
    }

    .mystic-map__waypoint-distance {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .mystic-map__waypoint-content {
        padding: 4px 8px;
    }

    .mystic-map__waypoint-name {
        font-size: 10px;
    }

    .mystic-map__waypoint-distance {
        font-size: 8px;
    }
}