:root {
    /* Light mode colors */
    --tooltip-bg: rgba(255, 255, 255, 0.95);
    --tooltip-text: rgba(0, 0, 0, 0.9);
    --coord-tooltip-bg: rgba(255, 0, 255, 0.9);
    --coord-marker: #ff00ff;
    --journey-path: var(--location-color-dark);
    --journey-dot: var(--location-color-dark);
    --journey-dot-stroke: white;
    --event-point: #e74c3c;
    --event-point-stroke: white;
    --highlight-stroke: #ca8815;
    --icon-bg: white;
}

html,
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    max-width: none;
}

/* Make body a flex container for map pages */
body {
    display: flex;
    flex-direction: column;
}

/* Override fixed header positioning for map pages */
body .site-header {
    position: static;
    flex-shrink: 0;
}

#map-container {
    flex: 1;
    width: 100%;
    background: var(--bg-primary);
    cursor: grab;
    overflow: hidden;
}

#map-container svg {
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#map-container:active {
    cursor: grabbing;
}

.map-point {
    cursor: pointer;
    transition: r 0.02s ease;
}

.map-point.journey,
.journey-dot {
    fill: var(--journey-dot);
    stroke: var(--journey-dot-stroke);
}

.map-point.journey.has-notes {
    stroke: var(--accent-blue-dark, #124f8c);
}

.map-point.event {
    fill: var(--event-point);
    stroke: var(--event-point-stroke);
}

.map-image {
    opacity: 0.8;
    /* filter: contrast(10); */
    filter: var(--map-filter);
}

/* Override map filter for light mode toggle */
:root[data-theme="light"] .map-image {
    filter: none;
}

.tooltip {
    position: absolute;
    padding: 8px 12px;
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
    max-width: 300px;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip .notes-text {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-style: italic;
}

.tooltip .muted {
    color: var(--text-tertiary);
    opacity: 0.7;
}

.coord-marker {
    fill: var(--coord-marker);
    stroke: var(--journey-dot-stroke);
    stroke-width: 2;
    opacity: 0.8;
    pointer-events: none;
}

.coord-tooltip {
    position: absolute;
    padding: 8px 12px;
    background: var(--coord-tooltip-bg);
    color: var(--tooltip-text);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    pointer-events: none;
    z-index: 1001;
    white-space: pre;
}

/* Context menu styling */
.context-menu {
    position: absolute;
    background: var(--container-bg);
    border: 2px solid var(--text-primary);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    z-index: 1002;
    min-width: 180px;
    display: none;
}

.context-menu.visible {
    display: block;
}

.context-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--text-primary);
    font-size: 14px;
    transition: background-color 0.1s;
}

.context-menu-item:last-child {
    border-bottom: none;
}

.context-menu-item:hover {
    background: var(--card-hover);
}

.context-menu-divider {
    height: 0;
    border-top: 1px solid var(--text-primary);
    margin: 0;
}

a.context-menu-item {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Journey path styling */
.journey-path {
    fill: none;
    stroke: var(--journey-path);
    stroke-dasharray: 8, 4;
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
    opacity: 1;
}

/* Event point styling */
.event-point {
    fill: var(--event-point);
    stroke: var(--event-point-stroke);
}

.journey-dot {
    fill: var(--journey-dot);
    stroke: var(--journey-dot-stroke);
}

/* Highlight marker styling */
.highlight-marker {
    fill: none;
    stroke: var(--highlight-stroke);
    pointer-events: none;
}

/* Journey icon background - radial gradient from white to transparent */
.icon-background {
    /* background: radial-gradient(circle, rgb(255, 255, 255) 0%, rgba(255, 255, 255, 0.151) 100%); */
    background: var(--icon-bg);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--icon-shadow);
    border: 2px solid var(--location-color-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-background.has-notes {
    border-color: var(--accent-blue-dark, #124f8c);
}

.icon-background iconify-icon,
.icon-background .icon {
    color: var(--location-color-dark);
}

/* Location icon background - slightly different styling */
.location-icon-bg {
    background: var(--icon-bg);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--icon-shadow);
    border: 2px solid #000000;
    /* opacity: 0.9; */
    display: flex;
    align-items: center;
    justify-content: center;
}

.location-icon-bg iconify-icon,
.location-icon-bg .icon {
    color: #000000;
}

.map-foreign-object {
    cursor: pointer;
    overflow: visible;
}

/* Calendar widget positioning for map pages */
#calendar-widget {
    position: fixed;
    top: 88px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
}

#calendar-toggle {
    /* position: fixed;
    top: 11px;
    right: 80px;
    z-index: 1001;
    background: white;
    border: 0px;
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-primary);
    transition: color 0.2s ease; */
}

#calendar-toggle iconify-icon {
    color: inherit;
}

#calendar-toggle:hover {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    #calendar-widget {
        display: none;
        top: 140px;
    }

    #calendar-widget.visible {
        display: block;
    }
}