/* --- 既存のPC用スタイル --- */
* {
    box-sizing: border-box;
}
/* フォント設定 */
body {
    margin: 0;
    background-color: #f0f4f8;
    color: #333;
}

/* 全体レイアウト */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 左サイドバー */
.sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    padding-top: 60px;
    flex-shrink: 0;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    text-decoration: none;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}
.menu-item:hover {
    background-color: #f5f9fc;
    color: #0066cc;
}

.menu-item.active {
    background-color: #e6f0fa;
    color: #0066cc;
    border-right: 3px solid #0066cc;
}
.menu-item .icon {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* メインコンテンツ */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ヘッダー */
.top-header {
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    position: sticky;
    top: 0; z-index: 10;
}
.top-header h1 {
    font-size: 20px;
    margin: 0;
    font-weight: 700;
}

/* スクロールエリア */
.content-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding: 32px;
}
.section-header h2 {
    font-size: 24px;
    margin-bottom: 24px;
    color: #222;
}

/* ホームページURLなどのリンクホバー設定 */
.display-text a {
transition: color 0.2s; /* 色の変化を滑らかに */
}
.display-text a:hover {
color: #0008ff; /* ホバー時の色（例：オレンジ） */
text-decoration: underline; /* 下線を表示 */
text-decoration: none; /* ホバー時に下線を消す（お好みで） */
}

/* フォームカード */
.form-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e1e4e8;
}
.card-title {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}
.error_message {
    color: red;
}

/* フォーム要素 */
.form-group {
    display: flex;
    margin-bottom: 24px;
    align-items: flex-start;
}
.form-group label {
    width: 200px; font-weight: 600; font-size: 14px;
    padding-top: 8px; color: #333; flex-shrink: 0;
}
.input-wrapper {
    flex-grow: 1;
    max-width: 600px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none; border-color: #0066cc; box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}
textarea.form-control { resize: vertical; min-height: 80px; }
.form-control-sm {
    width: auto; display: inline-block; padding: 4px 8px;
    margin-left: 8px; height: 32px;
}
.form-control-immutable {
    border: none;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding-top: 8px;
}
.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    font-size: 15px;
}
.radio-label input[type="radio"], .radio-label input[type="checkbox"] {
    margin-right: 6px;
    transform: scale(1.1);
}
.inline-input {
    display: flex;
    align-items: center;
}

.error_message {
    color: #d32f2f;
    font-size: 13px;
    margin: 6px 0 0 0;
    font-weight: bold;
}
.w-100 {
    width: 100%;
}

.save {
    background-color: #0066cc;
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}
.delete {
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}
.delete:hover {
    opacity: 1;
}
/* ボタンの親要素を中央寄せにする */
.button-group {
    display: flex;
    justify-content: center; /* 水平方向の中央 */
    gap: 12px;               /* ボタン同士の間隔 */
    margin-top: 32px;        /* フォームとの間の余白 */
    margin-bottom: 80px;     /* モバイルの固定ボタン用スペース */
    width: 100%;             /* 全幅を確保 */
}

/* Hamburger menu button (mobile only) */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger-menu span {
    width: 28px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.image-preview-item {
margin: 5px 0;
}

/* 画像を選択するinput要素や、選択された画像を表示するimg要素のコンテナ */
.images_input_container {
    border: 1px solid #cccccc;
    border-radius: 4px;
    background-color: #ffffff;
}

/* 画像を選択するinput要素 */
#images_input {
    display: none;
}

/* 画像を選択するinput要素のボタン */
.image_submit_btn {
    text-align: center;
    background-color: #0066cc;
    color: #ffffff;
    max-width: 200px;
    height: 25px;
    line-height: 25px;
    margin: 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

/* 画像を1枚だけ選択するためのinput要素 */
.image_input {
    display: none;
}

/* 選択された画像を表示するimg要素のコンテナ */
.image_container {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    height: auto;
    margin: 10px 0;
    justify-content: center;
    align-items: center;
}

/* 選択された画像と削除ボタンのコンテナ */
.selected_image_container {
    margin: 5px;
}

/* 画像の種類を選択するリストボックス */
.image_kind_list {
    font-size: 14px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    margin-bottom: 5px;
}

/* 選択された画像を表示するimg要素のボーダー */
.selected_image_border {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    border: 1px solid #e0e0e0;
    cursor: pointer;
}

/* 選択された画像を表示するimg要素 */
.selected_image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    border: none;
}

/* 選択された画像を表示するimg要素(表示状態) */
.selected_image_display {
    opacity: 1;  /* 表示 */
}

/* 選択された画像を表示するimg要素(非表示状態) */
.selected_image_hidden {
    opacity: 0;  /* 非表示 */
}

/* 選択された画像を削除するためのボタン */
.image_delete_btn {
    text-align: center;
    background-color: #0066cc;
    color: #ffffff;
    height: 25px;
    line-height: 25px;
    margin: 5px 0 0 0;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

/* 幅150pxの入力欄用 */
.form-control-short {
    width: 150px;
}

/* 単位（年、人）の左余白用 */
.unit-label {
    margin-left: 8px;
}

/* 非表示用（削除フォームなどで使用） */
.d-none {
    display: none;
}

.mobile-map-back {
    display: none;
}

/* スマホ表示の調整 */
@media screen and (max-width: 768px) {
    .form-control-short {
        width: calc(100% - 40px) !important; /* スマホでは幅を広げる */
        max-width: 150px;
    }
    .mobile-map-back {
        display: block;
        padding: 16px;
        margin-top: auto;
        text-align: center;
    }

    .mobile-map-back .menu-item {
        justify-content: center;
        border: 1px solid #0066cc;
        border-radius: 4px;
        color: #0066cc;
        font-weight: bold;
    }
}
/* =========================================
    RESPONSIVE DESIGN - ALL SCREEN SIZES
   ========================================= */

/* Extra Small Mobile (≤374px) - iPhone SE */
@media screen and (max-width: 374px) {
    .app-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .hamburger-menu {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s;
        padding-top: 20px;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-menu {
        flex-direction: column;
        padding: 20px 0;
    }

    .menu-item {
        padding: 14px 20px;
        border-bottom: 1px solid #e0e0e0;
    }

    .main-content {
        width: 100%;
    }

    .top-header {
        height: 50px;
        padding: 0 12px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .top-header h1 {
        font-size: 16px;
        flex: 1;
    }

    .content-scroll {
        padding: 12px;
        padding-bottom: 100px;
    }

    .form-card {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 6px;
    }

    .card-title {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .form-group {
        flex-direction: column;
        margin-bottom: 20px;
    }

    .form-group label {
        width: 100%;
        padding-top: 0;
        margin-bottom: 6px;
        font-size: 13px;
    }

    .input-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .form-control {
        min-height: 44px;
        padding: 10px;
        font-size: 15px;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .radio-label {
        width: 100%;
        min-height: 44px;
        padding: 8px 0;
    }

    .button-group {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 12px;
        margin: 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 100;
        gap: 10px;
    }

    .save, .delete {
        flex: 1;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px;
    }

    .selected_image_border {
        width: 80px;
        height: 80px;
    }
}

/* Small Mobile (375px - 480px) - Most phones portrait */
@media screen and (min-width: 375px) and (max-width: 480px) {
    .app-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .hamburger-menu {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 75%;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s;
        border-right: 1px solid #e0e0e0;
        padding-top: 0;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-menu {
        flex-direction: column;
        padding: 20px 0;
    }

    .menu-item {
        padding: 14px 20px;
        border-bottom: 1px solid #e0e0e0;
    }

    .menu-item.active {
        border-right: none;
        border-left: 4px solid #0066cc;
    }

    .menu-item .icon {
        margin-right: 8px;
        font-size: 16px;
    }

    .top-header {
        height: 54px;
        padding: 0 16px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .top-header h1 {
        font-size: 18px;
        flex: 1;
    }

    .content-scroll {
        padding: 16px;
        padding-bottom: 100px;
    }

    .form-card {
        padding: 20px;
        margin-bottom: 18px;
    }

    .card-title {
        font-size: 17px;
    }

    .form-group {
        flex-direction: column;
        margin-bottom: 22px;
    }

    .form-group label {
        width: 100%;
        padding-top: 0;
        margin-bottom: 8px;
        font-size: 14px;
    }

    .input-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .form-control {
        min-height: 46px;
        padding: 11px;
        font-size: 16px;
    }

    .button-group {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 14px 16px;
        margin: 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 100;
        gap: 12px;
    }

    .save, .delete {
        flex: 1;
        min-height: 50px;
        padding: 14px 20px;
        font-size: 16px;
    }

    body.sidebar-open {
        overflow: hidden;
    }


    .selected_image_border {
        width: 80px;
        height: 80px;
    }
}
@media screen and (max-width: 375px) {
    .google-map-iframe{
        height: 280px !important;
    }
}


/* Mobile Large (481px - 767px) - Phones landscape */
@media screen and (min-width: 481px) and (max-width: 767px) {
    .app-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .hamburger-menu {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s;
        border-right: 1px solid #e0e0e0;
        padding-top: 0;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-menu {
        flex-direction: column;
        padding: 20px 0;
    }

    .menu-item {
        padding: 14px 20px;
        border-bottom: 1px solid #e0e0e0;
    }

    .menu-item.active {
        border-right: none;
        border-left: 4px solid #0066cc;
    }

    .top-header {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .top-header h1 {
        flex: 1;
    }

    .content-scroll {
        padding: 20px;
        padding-bottom: 100px;
    }

    .form-card {
        padding: 24px;
    }

    .form-group {
        flex-direction: column;
        margin-bottom: 24px;
    }

    .form-group label {
        width: 100%;
        padding-top: 0;
        margin-bottom: 10px;
    }

    .input-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .form-control {
        min-height: 48px;
    }

    .button-group {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 16px;
        margin: 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 100;
        flex-direction: row;
        gap: 16px;
    }

    .save, .delete {
        flex: 1;
        min-height: 52px;
    }

    .selected_image_border {
        width: 80px;
        height: 80px;
    }
}

/* Tablet Portrait (768px - 1024px) - iPad */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .menu-item {
        padding: 10px 16px;
        font-size: 13px;
    }

    .menu-item .icon {
        font-size: 16px;
        width: 20px;
    }

    .top-header {
        padding: 0 24px;
    }

    .top-header h1 {
        font-size: 18px;
    }

    .content-scroll {
        padding: 24px;
    }

    .form-card {
        padding: 28px;
    }

    .form-group {
        flex-direction: row;
        align-items: flex-start;
    }

    .form-group label {
        width: 180px;
        padding-top: 10px;
    }

    .input-wrapper {
        flex-grow: 1;
        max-width: 500px;
    }

    .form-control {
        min-height: 42px;
    }

    .button-group {
        margin-top: 28px;
    }
}

/* Tablet Landscape & Small Desktop (1025px - 1279px) */
@media screen and (min-width: 1025px) and (max-width: 1279px) {
    .sidebar {
        width: 220px;
    }

    .content-scroll {
        padding: 28px;
    }

    .form-card {
        padding: 30px;
    }

    .form-group label {
        width: 190px;
    }

    .input-wrapper {
        max-width: 550px;
    }
}

/* Desktop (1280px - 1919px) - Standard HD */
@media screen and (min-width: 1280px) and (max-width: 1919px) {
    .sidebar {
        width: 260px;
    }

    .content-scroll {
        padding: 32px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .form-card {
        padding: 32px;
    }

    .form-group label {
        width: 200px;
    }

    .input-wrapper {
        max-width: 600px;
    }
}

/* Large Desktop (≥1920px) - Full HD+ */
@media screen and (min-width: 1920px) {
    .sidebar {
        width: 280px;
    }

    .menu-item {
        padding: 14px 28px;
        font-size: 15px;
    }

    .top-header h1 {
        font-size: 22px;
    }

    .content-scroll {
        padding: 40px;
        max-width: 1400px;
        margin: 0 auto;
    }

    .form-card {
        padding: 40px;
    }

    .card-title {
        font-size: 20px;
    }

    .form-group label {
        width: 220px;
        font-size: 15px;
    }

    .input-wrapper {
        max-width: 700px;
    }

    .form-control {
        padding: 12px 14px;
        font-size: 17px;
    }
}

/* Landscape orientation for small devices */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .top-header {
        height: 48px;
    }

    .content-scroll {
        padding: 16px;
    }

    .form-card {
        padding: 20px;
        margin-bottom: 16px;
    }

    .form-group {
        margin-bottom: 16px;
    }
}

/* Touch optimization for all touch devices */
@media (hover: none) and (pointer: coarse) {
    .menu-item {
        min-height: 44px;
        touch-action: manipulation;
    }

    .form-control, select.form-control {
        min-height: 44px;
        touch-action: manipulation;
    }

    .save, .delete {
        min-height: 48px;
        touch-action: manipulation;
    }

    .save:active {
        background-color: #0052a3;
        transform: scale(0.98);
    }

    .delete:active {
        background-color: #bd2130;
        transform: scale(0.98);
    }

    .radio-label, input[type="checkbox"] + label {
        min-height: 44px;
        padding: 10px 0;
    }
}

/* Hover effects for desktop only */
@media (hover: hover) and (pointer: fine) {
    .save:hover {
        background-color: #0052a3;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
    }

    .delete:hover {
        background-color: #c82333;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
    }

    .menu-item:hover {
        transform: translateX(2px);
    }
}



/* 必須マークのスタイル */
.required-mark {
    color: #ff0000; /* 赤色 */
    margin-left: 4px;
    font-size: 0.9em;
    font-weight: bold;
}