/* Drive Map Specific Styles */
.map-wrapper {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
    background-color: #e2e8f0;
    overflow: hidden;
    margin-bottom: 2rem;
}

[data-theme="dark"] .map-wrapper {
    background-color: #1e293b;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
}

/* Side Peek (Drawer) */
.side-peek {
    position: absolute;
    top: 0;
    right: -400px;
    width: 350px;
    max-width: 90%;
    height: 100%;
    background-color: var(--bg-panel);
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.side-peek.open {
    right: 0;
}

.side-peek-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.side-peek-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
}

.side-peek-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.side-peek-content {
    padding: 1.5rem 1rem;
    flex: 1;
    overflow-y: auto;
}

.side-peek-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.spot-badge {
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.side-peek-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
}

/* Custom Marker styling */
.mapboxgl-marker {
    cursor: pointer;
}

.marker-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary);
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

@media (max-width: 600px) {
    .subpage-container.map-page-container {
        padding: 0;
        max-width: 100%;
    }

    .map-page-container .subpage-hero {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .map-wrapper {
        height: calc(100vh - 120px);
        border-radius: 0;
        margin-bottom: 0;
    }

    .side-peek {
        top: auto;
        bottom: -100%;
        right: 0;
        width: 100%;
        height: 60%;
        max-width: 100%;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
        transition: bottom 0.3s ease;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
    }

    .side-peek.open {
        bottom: 0;
    }
}

@media (min-width: 601px) {
    .subpage-container.map-page-container {
        max-width: 100%;
        width: 97%;
    }

    .map-wrapper {
        border-radius: 16px;
        box-shadow: var(--card-shadow);
        height: 70vh;
        min-height: 500px;
    }
}

/* ===== Modern Mapbox Controls ===== */
.mapboxgl-ctrl-group {
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-panel) !important;
    backdrop-filter: blur(8px);
}

.mapboxgl-ctrl-group > button {
    width: 40px !important;
    height: 40px !important;
    background-color: transparent !important;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-color) !important;
}

.mapboxgl-ctrl-group > button:last-child {
    border-bottom: none !important;
}

.mapboxgl-ctrl-group > button:hover {
    background-color: var(--bg-body) !important;
}

/* Adjust icon visibility to be crisp and high-contrast */
.mapboxgl-ctrl-group > button .mapboxgl-ctrl-icon {
    transition: opacity 0.2s ease;
}

.mapboxgl-ctrl-group > button:hover .mapboxgl-ctrl-icon {
    opacity: 1;
}

/* Light mode icons (ほぼ真っ黒に近い濃いグレー) */
:root[data-theme="light"] .mapboxgl-ctrl-icon {
    filter: brightness(0) invert(0.08) !important;
}

/* Dark mode icons (明るめのグレー) */
:root:not([data-theme="light"]) .mapboxgl-ctrl-icon {
    filter: brightness(0) invert(0.9) !important;
}