/* 基本的なリセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ページ全体の設定 */
html, body {
    height: 100%;
    width: 100%;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    position: fixed;
    -webkit-text-size-adjust: 100%;
}

/* 地図コンテナ */
#map {
    width: 100%;
    height: 100vh;
    height: 100dvh; /* 動的ビューポート高さ（モダンブラウザ用）*/
    position: absolute;
    top: 0;
    left: 0;
    touch-action: none; /* タッチ操作を地図に渡す */
}

/* MapLibre GL JSのコントロール調整 */
.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right {
    z-index: 1000;
}

/* モバイル用のコントロール調整 */
@media (max-width: 768px) {
    .maplibregl-ctrl-top-right {
        top: 10px;
        right: 10px;
    }
    
    .maplibregl-ctrl-bottom-right {
        bottom: 10px;
        right: 10px;
    }
    
    /* ナビゲーションコントロールのボタンを大きく */
    .maplibregl-ctrl-group button {
        width: 36px !important;
        height: 36px !important;
    }
}

/* 地図の読み込み中表示 */
.maplibregl-canvas-container {
    cursor: default;
}

/* 凡例のスタイル */
.legend {
    position: absolute;
    bottom: 30px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    min-width: 180px;
    z-index: 1000;
}

.legend h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.legend-subtitle {
    margin: 0 0 10px 0;
    font-size: 12px;
    font-weight: normal;
    color: #666;
    text-align: center;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    display: inline-block;
    width: 20px;
    height: 16px;
    border: 1px solid #333;
    margin-right: 8px;
    flex-shrink: 0;
}

.legend-label {
    font-size: 11px;
    color: #444;
    line-height: 1.2;
}

/* モバイル用の凡例調整 */
@media (max-width: 768px) {
    .legend {
        bottom: 60px;
        right: 5px;
        left: 5px;
        max-width: calc(100% - 10px);
        font-size: 11px;
        padding: 10px;
    }
    
    .legend h3 {
        font-size: 13px;
    }
    
    .legend-subtitle {
        font-size: 11px;
    }
    
    .legend-label {
        font-size: 10px;
    }
}

/* 横向き表示の調整 */
@media (max-width: 768px) and (orientation: landscape) {
    .legend {
        bottom: 10px;
        right: 5px;
        left: auto;
        max-height: 150px;
        overflow-y: auto;
    }
}
