:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #81C784;
    --background-color: #f1f1f1;
    --border-radius-sm: 5px;
    --border-radius-lg: 8px;
    --border-radius-full: 50%;
    --shadow-default: 0 0 5px rgba(0, 0, 0, 0.2);
    --transition-default: 0.3s ease;

    /* Responsive sizing variables */
    --icon-size-small: 40px;
    --icon-size-default: 50px;
    --panel-padding: 10px;
    --font-size-small: 14px;
    --font-size-default: 16px;
    --font-size-large: 18px;
}

html,
body {
    margin: 0px;
    padding: 0px;
    height: 100%;
}

#map {
    height: 100dvh;
    width: 100%;
    z-index: 0;

}

#checkbox {
    position: absolute;
    top: 20px;
    right: 0;
    z-index: 2;
    display: none;
    width: calc(100% - 45px);
    /* Slightly more space on small screens */
    max-width: 400px;
    max-height: 93dvh;
    background-color: var(--background-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-default);
    padding: var(--panel-padding);
    margin: 0 15px;
    /* Reduced from 20px */
    overflow: hidden;
}

.icon-base {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--icon-size-small);
    /* Smaller by default */
    height: var(--icon-size-small);
    /* Smaller by default */
    border-radius: var(--border-radius-full);
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: var(--transition-default);
}

#menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--icon-size-small);
    /* Smaller on mobile */
    height: var(--icon-size-small);
    /* Smaller on mobile */
    border-radius: var(--border-radius-full);
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: var(--transition-default);
    position: absolute;
    top: 35px;
    right: 15px;
    z-index: 2;
    font-size: 22px;
}

#icon:hover {
    background-color: #45a049;
    transform: scale(1.1);
    /* 少し大きくなる効果 */
}

#icon-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #4CAF50;
    cursor: pointer;
    font-size: 24px;
    color: white;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.color-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

details {
    box-sizing: border-box;
    display: block;
    margin: 0;
    padding: 0;

}

.details-sub {
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    padding: 1px;
    margin-bottom: 10px;
}

.details-main summary {
    background-color: #66BB6A;
    color: #FFFFFF;
    padding: 8px;
    border-radius: 5px;
    font-weight: bold;
    margin: 3.5px 0 0 0;
    font-size: var(--font-size-default);
    max-width: 100%;
}

.details-sub summary {
    background-color: #f1f1f1;
    border-bottom: 2.5px solid #81C784;
    color: #000000;
    padding: 8px;
    font-weight: bold;
    margin: 6px;
    font-size: var(--font-size-default);
    max-width: 95%;
}

.details-sub-sub summary {
    border-bottom: 2px dashed #81C784;
    padding: 8px;
    font-weight: bold;
    margin: 6px;
    font-size: var(--font-size-default);
    max-width: 90%;
}

#detail-box {
    margin: 10px 10px 20px 10px;
    font-size: 14px;
    padding: 0.1px;
}

#selects {
    flex-direction: column;
    margin-bottom: 20px;
}

/* 横並びにするためのクラス */
.select-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.select-container {
    flex-basis: 48%;
    /* 横並びで並べる */
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.select-container label {
    margin-bottom: 5px;
}

select {
    padding: 10px;
    font-size: var(--font-size-default);
    border-radius: 8px;
    border: 1px solid #ccc;
    transition: border-color 0.3s ease;
    margin: 10px;
}

select:focus {
    border-color: #4CAF50;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: var(--font-size-default);
    margin: 20px;
    transition: transform 0.2s ease;
}

/* チェックボックス本体のスタイル（非表示） */
.checkbox-container input[type="checkbox"] {
    display: none;
    /* デフォルトのチェックボックスを非表示 */
}

/* カスタムチェックボックス（丸型） */
.checkmark {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #4CAF50;
    background-color: white;
    margin-right: 12px;
    position: relative;
    transition: background-color 0.3s, border-color 0.3s, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

/* チェックボックスが選択されたとき */
.checkbox-container input[type="checkbox"]:checked+span {
    background-color: #4CAF50;
    border-color: #4CAF50;
    transform: scale(0.95);
    /* 少し縮む効果 */
}

/* チェックマークの表示 */
.checkbox-container input[type="checkbox"]:checked+span::after {
    content: '\2713';
    /* チェックマーク */
    font-size: 22px;
    color: white;
    position: absolute;
}

/* チェックボックスにホバーした時 */
.checkbox-container:hover span {
    border-color: #388E3C;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.checkbox-container:hover {
    transform: scale(1.05);
    /* 少し大きくする */
}

/* チェックボックスのラベル（テキスト）のスタイル */
.checkbox-container span+span {
    font-size: 16px;
    color: #333;
    transition: color 0.3s ease;
}

/* チェックボックスがホバーされた時 */
.checkbox-container:hover span+span {
    color: #388E3C;
}

.panel {
    width: 100%;
    max-width: 100%;
    height: fit-content;
    max-height: calc(85vh - 80px);
    /* Better handling of small screens */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 3px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

#infopanel {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    max-width: 450px;
    z-index: 1;
}

#infoheader {
    background-color: #f1f1f1;
    padding: 5px;
    box-sizing: border-box;
    max-width: 30%;
    font-size: 18px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    cursor: pointer;
    display: flex;
    justify-content: center;
    /* 横方向の中央揃え */
    align-items: center;
    max-height: 50px;
}

#infoheader i {
    transform: rotate(0deg);
    font-size: 22px;
}

#infobord {
    display: none;
    background-color: var(--background-color);
    padding: 12px;
    height: auto;
    max-height: 50vh;
    overflow: auto;
    word-break: break-all;
    ;
}

#infobord th {
    white-space: nowrap;
}

#count {
    display: inline-block;
    visibility: hidden;
    padding: 5px 10px;
    border-radius: 50%;
    font-size: 18px;
    min-width: 24px;
    text-align: center;
    line-height: 24px;
    background-color: #4CAF50;
    color: white;
    margin: 6px;
}

.tag {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px;
    border: 2px solid #4CAF50;
    background-color: rgb(255, 191, 179);
    color: #000000;
    font-size: 14px;
    border-radius: 12px;
    font-weight: bold;
}

.card {
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.note {
    display: block;
    margin-top: 0.25em;
    font-size: 0.8em;
    color: #666;
}

@media screen and (min-width: 375px) {
    #menu-icon {
        top: 40px;
        /* Slightly larger than smallest screens */
        right: 15px;
    }

    .panel {
        max-width: 330px;
        max-height: 80dvh;
    }

    #infobord {
        max-height: 45vh;
    }

    .checkmark {
        width: 35px;
        /* Mid-size */
        height: 35px;
        /* Mid-size */
    }
}

@media screen and (min-width: 425px) {

    #menu-icon,
    .icon-base {
        width: var(--icon-size-default);
        /* Back to original size */
        height: var(--icon-size-default);
        /* Back to original size */
    }

    .panel {
        max-width: 380px;
        max-height: 75dvh;
    }

    #infobord {
        max-height: 45vh;
    }

    .checkmark {
        width: 40px;
        /* Original size */
        height: 40px;
        /* Original size */
    }

    .details-main summary {
        font-size: var(--font-size-large);
        /* Back to original 18px */
    }

    .details-sub summary {
        font-size: var(--font-size-default);
        /* Back to original 16px */
    }
}

@media screen and (min-width: 768px) {
    #checkbox {
        padding: var(--panel-padding);
        margin: 0 15px;
        /* Back to original */
    }

    .panel {
        max-height: 85vh;
    }

    #infopanel {
        display: flex;
        flex-direction: row-reverse;
        justify-content: flex-start;
        top: 0;
        left: 0;
        transform: none;
        width: auto;
        height: 90dvh;
        transition: var(--transition-default);
        /* Add transition for smoother layout change */
    }

    #infoheader {
        max-width: 50px;
        position: relative;
        max-height: 90dvh;
        flex-direction: column;
    }

    #infoheader i {
        transform: rotate(90deg);
    }

    #count {
        margin-top: 10px;
    }

    #infobord {
        max-height: 90dvh;
        width: 450px;
    }
}