/* 地図埋め込み専用スタイル */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100vh;
    position: relative;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #007cba;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* マップコントロール */
.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.control-button {
    display: block;
    width: 100%;
    margin: 4px 0;
    padding: 8px 12px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 80px;
}

.control-button:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.control-button:active {
    transform: translateY(0);
}

/* ポップアップカスタマイズ */
.maplibre-popup {
    max-width: 300px;
}

.maplibre-popup-content {
    padding: 16px;
    font-size: 14px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.popup-title {
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
}

.popup-coords {
    color: #666;
    font-size: 12px;
    font-family: monospace;
    line-height: 1.4;
}

.popup-desc {
    color: #555;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 6px;
}

/* エラー表示 */
.error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #dc3545;
    color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    text-align: center;
    font-size: 14px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .map-controls {
        top: 5px;
        right: 5px;
        padding: 6px;
    }
    
    .control-button {
        padding: 6px 10px;
        font-size: 11px;
        min-width: 70px;
    }
    
    .maplibre-popup-content {
        padding: 12px;
        font-size: 13px;
    }
}

/* アニメーション */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Google Map風操作メッセージ */
.map-activation-message {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1001;
    animation: slideInDown 0.3s ease-out;
    pointer-events: none;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 文化財マーカー */
.heritage-marker {
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 2px solid #fff;
}

.heritage-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.heritage-marker:active {
    transform: scale(0.95);
}

/* 地図のタッチ操作改善 */
#map {
    touch-action: pan-x pan-y;
}

/* iframeでの表示時の調整 */
body.iframe-mode {
    overflow: hidden;
}

body.iframe-mode #map {
    cursor: grab;
}

body.iframe-mode #map:active {
    cursor: grabbing;
}

/* スクロール無効化時のヒント */
.scroll-hint {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scroll-hint.show {
    opacity: 1;
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .map-controls {
        background: white;
        border: 2px solid #000;
    }

    .control-button {
        background: #000;
        border: 1px solid #000;
    }

    .heritage-marker {
        background: white;
        border: 3px solid #000;
    }

    .map-activation-message {
        background: #000;
        border: 2px solid #fff;
    }
}

/* 基図切り替えセレクター */
.style-selector {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    padding: 6px 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.style-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.style-toggle {
    display: block;
    width: 100%;
    padding: 5px 12px;
    background: transparent;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.15s ease;
    text-align: center;
    white-space: nowrap;
}

.style-toggle:hover {
    background: #e8f4e8;
    border-color: #5a7a3a;
}

.style-toggle.active {
    background: #5a7a3a;
    color: white;
    border-color: #5a7a3a;
}

/* 宿場マーカー */
.shukuba-marker {
    cursor: pointer;
    transition: transform 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border: 2px solid #000000;
    overflow: hidden;
}

.shukuba-marker img {
    width: 56px;
    height: auto;
    display: block;
}

.shukuba-marker:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 14px rgba(192,57,43,0.4);
}

.shukuba-marker:active {
    transform: scale(0.95);
}

@media (prefers-contrast: high) {
    .shukuba-marker {
        background: white;
        border: 2px solid #000;
    }

    .style-selector {
        background: white;
        border: 2px solid #000;
    }

    .style-toggle {
        border: 1px solid #000;
    }

    .style-toggle.active {
        background: #000;
        color: white;
    }
} 