/* ========================================
   グローバルスタイル
======================================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #004f4f;
    --primary-light: #006666;
    --primary-dark: #003838;
    --primary-shadow: rgba(0, 79, 79, 0.3);
}

* {
    font-family: 'Noto Sans JP', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

html,
body,
#mapcontainer {
    width: 100%;
    height: 100%;
    z-index: 0;
}

.maplibregl-popup-content {
    font-family: 'Noto Sans JP', sans-serif;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* attribution の位置を凡例にかぶらないように変更 */
.maplibregl-ctrl-bottom-right {
    right: 150px;
    bottom: 10px;
}

/* ========================================
   絞り込みフィルターパネル
======================================== */
#kukanControl {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 20px;
    left: 20px;
    padding: 16px 24px;
    background: var(--primary-color);
    box-shadow: 0 4px 15px var(--primary-shadow);
    border-radius: 12px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    color: white;
}

#kukanControl:hover {
    transform: translateY(-2px);
    background: var(--primary-light);
    box-shadow: 0 6px 20px var(--primary-shadow);
}

#kukanControl p {
    margin: 0;
    color: white;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Offcanvas フィルターパネル */
.offcanvas-start {
    width: 360px !important;
    border-right: none;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

/* PC版ではデフォルト表示 */
@media (min-width: 769px) {
    #featureFilteringOffcanvas {
        display: flex !important;
    }
}

.offcanvas-header {
    background: var(--primary-color);
    color: white;
    padding: 20px 24px;
    border-bottom: none;
}

.offcanvas-title {
    font-weight: 700;
    font-size: 18px;
}

.offcanvas-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.offcanvas-header .btn-close:hover {
    opacity: 1;
}

.offcanvas-body {
    padding: 24px;
    background: #f8f9fa;
}

/* アコーディオン */
.accordion {
    --bs-accordion-border-color: #e0e0e0;
    --bs-accordion-btn-focus-box-shadow: none;
}

.accordion-button {
    background: white;
    font-weight: 600;
    color: #333;
    padding: 16px 20px;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.accordion-button:not(.collapsed) {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px var(--primary-shadow);
}

.accordion-button::after {
    filter: brightness(0);
}

.accordion-button:not(.collapsed)::after {
    filter: brightness(0) invert(1);
}

.accordion-body {
    padding: 20px;
    background: white;
}

.accordion-item {
    border: none;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* フォーム要素 */
.form-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
    font-size: 14px;
}

.form-check {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    background: #f8f9fa;
}

.form-check:hover {
    background: #e9ecef;
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin-top: 0.1em;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.form-control {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 79, 79, 0.15);
}

.icon-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.env-icon {
    width: 24px;
    height: 24px;
}

hr {
    margin: 20px 0;
    opacity: 0.2;
}

/* ========================================
   ポップアップウィンドウ
======================================== */
#basemap-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 420px;
    height: 100%;
    background: white;
    border-left: none;
    overflow-y: auto;
    z-index: 999;
    display: none;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);

    /*3D活用イメージモデルボタン*/
    .badge.videoBtn {
        cursor: pointer;
        background-color: #0DCAF0;
        color: #000000;
    }
    /*ホバー*/
    .badge.videoBtn:hover {
        background-color: #0DD7FF;
    }
}

.control-panel {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

#basemap-panel-close {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#basemap-panel-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

#basemap-panel-close i {
    font-size: 18px;
    color: #333;
    text-shadow: 0 0 3px white, 0 0 6px white;
}

/*.control-body {
    padding: 20px;
}*/

/* カルーセル */
.carousel-inner {
    /*border-radius: 12px;*/
    overflow: hidden;
}

.carousel-control-prev,
.carousel-control-next {
    width: 40px;
}

.carousel-indicators button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 4px;
}

/* カード */
.card {
    border: none;
    border-radius: 12px;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-weight: 700;
    color: #333;
    font-size: 20px;
}

.card-text h6 {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
    margin-bottom: 12px;
}

.small.text-muted {
    font-size: 12px;
    color: #888 !important;
    margin-bottom: 4px;
}

.badge {
    padding: 6px 12px;
    font-weight: 500;
    font-size: 12px;
}

.list-group-item {
    border: none;
    padding: 8px 0;
    font-size: 14px;
}

/* カードフッター */
.card-footer {
    padding: 16px 20px;
    position: sticky;
    bottom: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

/* ========================================
   凡例パネル
======================================== */
.legend-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 500;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 200px;
    transition: opacity 0.3s ease;
}

.legend-panel.hidden {
    display: none;
}

.legend-panel .card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legend-panel .card-body {
    padding: 0;
}

.legend-panel .card-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.legend-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.legend-name {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

/* 凡例閉じるボタン */
.legend-close-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.legend-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.legend-close-btn i {
    font-size: 14px;
    color: #666;
}

/* 凡例表示ボタン */
.legend-toggle-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    /*z-index: 500;*/
    display: none;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 4px 15px var(--primary-shadow);
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
}

.legend-toggle-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-shadow);
}

/* 凡例が非表示の時はボタンを表示 */
.legend-panel.hidden~.legend-toggle-btn {
    display: block;
}

/* ========================================
   管理機能ボタン
======================================== */
.managementBtn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.manageBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 15px var(--primary-shadow);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.manageBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-shadow);
    background: var(--primary-light);
}

/* ========================================
   管理パネル (Offcanvas)
======================================== */
.offcanvas-end {
    width: 500px !important;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.offcanvas-end .offcanvas-header {
    background: var(--primary-color);
    padding: 20px 24px;
}

.offcanvas-end .offcanvas-body {
    padding: 24px;
    background: #f8f9fa;
}

/* 管理機能テーブル */
.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table thead {
    background: var(--primary-color);
    color: white;
}

.table thead th {
    border: none;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 14px;
}

.table tbody tr {
    transition: all 0.2s;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: #f0f0f0;
}

/* ボタン */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    box-shadow: 0 2px 8px var(--primary-shadow);
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 12px var(--primary-shadow);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-info {
    background: #17a2b8;
    border: none;
}

.btn-danger {
    background: #dc3545;
    border: none;
}

.btn-success {
    background: #28a745;
    border: none;
}

/* タブ */
.nav-tabs {
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.nav-tabs .nav-link {
    border: none;
    color: #666;
    font-weight: 600;
    padding: 12px 20px;
    transition: all 0.2s;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border-bottom: 3px solid var(--primary-color);
}

/* モーダル */
.modal-dialog {
    position: fixed;
    margin: 0;
    padding: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 500px;
}

.modal-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
}

/* 口コミ投稿モーダル - 中央配置 */
#reviewModal .modal-dialog {
    position: relative;
    margin: auto;
    width: auto;
    max-width: 500px;
    top: auto;
    bottom: auto;
    right: auto;
}

#reviewModal .modal-content {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: none;
}

/* 口コミ管理モーダル - 画面中央に大きく表示 */
#reviewManagementModal .modal-dialog {
    position: relative;
    margin: auto;
    width: 90vw;
    max-width: 1400px;
    top: auto;
    bottom: auto;
    right: auto;
}

#reviewManagementModal .modal-content {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 85vh;
    border-radius: 12px;
    border: none;
}

/* 口コミ詳細モーダル - 中央配置 */
#reviewDetailModal .modal-dialog {
    position: relative;
    margin: auto;
    width: auto;
    max-width: 600px;
    top: auto;
    bottom: auto;
    right: auto;
}

#reviewDetailModal .modal-content {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: none;
}

.managementForm {
    padding: 0;
}

.managementForm .accordion {
    margin: 20px 0;
}

#joinUrl {
    display: none;
}

/* ========================================
   レスポンシブデザイン
======================================== */
@media (max-width: 768px) {
    .offcanvas-start {
        width: 300px !important;
    }

    .offcanvas-end {
        width: 100% !important;
    }

    #basemap-panel {
        width: 100%;
        left: 0;
        right: 0;
    }

    .fixedTitle {
        width: 100%;
    }

    /* スマホ時は絞り込みフィルターをデフォルト非表示 */
    #featureFilteringOffcanvas {
        display: none;
    }

    #featureFilteringOffcanvas.show {
        display: flex;
    }

    /* スマホ時は凡例をデフォルト非表示 */
    .legend-panel {
        display: none;
    }

    /* スマホ時、凡例が非表示でない場合は表示 */
    .legend-panel:not(.hidden) {
        display: block;
    }

    /* スマホ時は凡例ボタンをデフォルト表示 */
    .legend-toggle-btn {
        display: block !important;
    }

    /* スマホ時、凡例が表示されている場合はボタンを非表示 */
    .legend-panel:not(.hidden)~.legend-toggle-btn {
        display: none !important;
    }

    /* 絞り込みフィルターボタンのサイズを統一 */
    #kukanControl {
        padding: 12px 20px;
        font-size: 14px;
    }

    #kukanControl p {
        margin: 0;
        font-size: 14px;
    }

    #kukanControl,
    .managementBtn {
        top: 10px;
    }

    #kukanControl {
        left: 10px;
    }

    .managementBtn {
        right: 10px;
    }

    .manageBtn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .fs-small-mobile {
        font-size: 0.8rem;
    }
}

/* ========================================
   アニメーション
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* ========================================
   スクロールバー
======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}


/*3D動画ポップアップ*/
.video-conts {/*全体*/
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);/*背景黒*/
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.video-conts.active {
    display: flex;
}

.video-wrap {/*動画・閉じるボタン*/
    position: relative;/*親*/
    max-width: 800px;
    width: 90%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-wrap video {/*動画本体*/
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.video-close {/*閉じるボタン*/
    position: absolute;/*子*/
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: none;
}
.video-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/*PDF表示*/
#pdfjs_view canvas {
    width: 100%;
    display: block;
    border-color: #000000;
  }