/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&display=swap');

/* Basic Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent body scroll */
    font-family: 'MedievalSharp', cursive;
    color: #2b231d; /* Dark brown for text */
    background-image: url('../img/background-map.png'); /* 背景画像 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.page-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    /* 背景色を半透明に変更し、背景画像が透けて見えるようにする */
    background-color: rgba(210, 180, 140, 0.7); /* Tan with transparency */
    padding: 10px; /* explorer_map_style.cssと合わせる */
    overflow-y: auto; /* Allow scrolling for the entire page container */
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #2b231d;
}

.status-bar {
    font-size: 1.2em;
    font-weight: bold;
}

/* Back Button */
.back-button {
    display: flex;
    align-items: center;
    font-size: 1.1em;
    color: #2b231d;
    text-decoration: none;
    font-weight: bold;
}

.back-button:hover {
    color: #f0e68c;
}

.back-button img {
    width: 40px;
    height: 40px;
    cursor: pointer;
}

/* Main Content (Map) */
.main-content {
    flex-grow: 1;
    position: relative;
    border: 4px solid #2b231d;
    border-radius: 10px;
    overflow: hidden; /* Ensures map stays within borders */
}

#map {
    width: 100%;
    height: 100%;
    background-color: #a2d4ad; /* Light green like the image */
}

.compass {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 500; /* Above map tiles */
}

.compass img {
    width: 50px;
    height: 50px;
    opacity: 0.8;
}

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    position: relative; /* 重ね合わせコンテキストを作成 */
    z-index: 1000;      /* マップより前面に表示するための高いz-index値を設定 */
}

.footer-icon-link img {
    width: 100px;
    height: 100px;
    cursor: pointer;
}

.info-board {
    flex-grow: 1;
    background-color: #2b231d;
    color: #f5deb3;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin: 0 15px;
    font-size: 1.1em;
    text-shadow: 1px 1px 2px #000;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    background-color: #2b231d;
    color: #f5deb3;
    border: 2px solid #d2b48c;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.7);
}

.leaflet-popup-content {
    font-family: 'MedievalSharp', cursive;
}

.leaflet-popup-content a {
    color: #f0e68c;
}

.leaflet-popup-tip {
    background-color: #2b231d;
}

/* Custom popup style for the user's own posts */
.my-post-popup .leaflet-popup-content-wrapper {
    background-color: #4b6928; /* Green for user's own posts */
    border-color: #a3c182;
}

.my-post-popup .leaflet-popup-tip {
    background-color: #4b6928;
}

.popup-image {
    max-width: 150px;
    border-radius: 5px;
    margin: 5px 0;
}

/* =================================================== */
/* 吹き出し（ツールチップ）のスタイル                      */
/* =================================================== */

.footer-icon-link {
    position: relative; /* 吹き出しを配置する基準点にする */
}

/* 吹き出し本体のスタイル */
[data-tooltip]::after {
    content: attr(data-tooltip); /* data-tooltip属性の値をテキストとして表示 */
    position: absolute;
    bottom: 125%; /* アイコンの上部に配置 */
    left: 50%;
    transform: translateX(-50%); /* 中央揃え */
    
    background-color: #2b231d; /* 背景色（ダークブラウン） */
    color: #f0e6d2; /* テキストの色（クリーム色） */
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9em;
    
    /* テキストの改行設定 */
    white-space: normal;
    width: 100px;
    word-break: break-all;
    text-align: center;
    
    /* 最初は非表示 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease; /* アニメーション */
    z-index: 10;
}

/* 吹き出しの矢印（三角形） */
[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(28px); /* 吹き出し本体の下に配置 */

    border-width: 6px;
    border-style: solid;
    border-color: #2b231d transparent transparent transparent; /* 上向きの三角形 */
    
    /* 最初は非表示 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
}

/* ホバー時に吹き出しを表示 */
[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}


/* =================================================== */
/* レスポンシブデザイン (タブレット以上) */
/* =================================================== */
@media (min-width: 768px) {
    .main-logo {
        width: 180px; /* ロゴを少し大きく */
    }

    .game-title {
        font-size: 4.5em;
    }

    .tagline {
        font-size: 1.5em;
    }

    .nav-button-text {
        font-size: 1.1em; /* ボタンテキストのサイズ */
    }

    .section-title {
        font-size: 2.5em;
    }

    .preview-icon {
        width: 150px; /* プレビューアイコンを少し大きく */
        height: 150px;
    }
}

/* =================================================== */
/* レスポンシブデザイン (PCサイズ以上) */
/* =================================================== */
@media (min-width: 1024px) {
    .main-logo {
        width: 200px; /* ロゴをさらに大きく */
    }

    .game-title {
        font-size: 5.5em;
    }

    .tagline {
        font-size: 1.8em;
    }

    .nav-button-text {
        font-size: 1.2em;
    }

    .section-title {
        font-size: 3em;
    }

    .preview-icon {
        width: 180px; /* プレビューアイコンをさらに大きく */
        height: 180px;
    }
}

