/**
 * メインスタイルシート
 * Greenベースのシンプルなデザイン
 */

:root {
    --primary-color: #2E7D32;
    --secondary-color: #4CAF50;
    --accent-color: #66BB6A;
    --bg-color: #F1F8F4;
    --text-color: #212121;
    --error-color: #D32F2F;
    --success-color: #388E3C;
    --white: #FFFFFF;
    --light-gray: #E0E0E0;
    --gray: #9E9E9E;
    --dark-gray: #424242;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

/* ヘッダー */
.header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-shrink: 0;
    min-width: 0;
}

.header-brand .logo {
    margin: 0;
}

.header-search-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--white);
    line-height: 0;
    transition: opacity 0.3s;
}

.header-search-link:hover {
    opacity: 0.85;
}

.header-search-link:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 4px;
    border-radius: 4px;
}

.header-search-link svg {
    width: 1.5rem;
    height: 1.5rem;
}

.logo a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-list a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-list a:hover {
    opacity: 0.8;
}

.user-menu {
    position: relative;
}

.username {
    color: var(--white);
    font-weight: 500;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--white);
    color: var(--text-color);
    list-style: none;
    margin-top: 0.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 150px;
    z-index: 1000;
}

.user-menu:hover .dropdown {
    display: block;
}

.dropdown li {
    border-bottom: 1px solid var(--light-gray);
}

.dropdown li:last-child {
    border-bottom: none;
}

.dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
}

.dropdown a:hover {
    background-color: var(--bg-color);
}

/* メインコンテンツ */
.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* フラッシュメッセージ */
.flash-message {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.flash-success {
    background-color: var(--success-color);
    color: var(--white);
}

.flash-error {
    background-color: var(--error-color);
    color: var(--white);
}

.flash-info {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #1B5E20;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #388E3C;
}

.btn-danger {
    background-color: var(--error-color);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #B71C1C;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* カード */
.card {
    background-color: var(--white);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-color);
}

.card-title {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* フォーム */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-gray);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    cursor: pointer;
}

/* パスワード入力（表示・非表示トグル付き） */
.input-with-toggle {
    position: relative;
}

.input-with-toggle .form-control {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--gray);
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
}

.password-toggle:hover {
    color: var(--dark-gray);
}

/* ログインページ専用レイアウト */
.auth-page {
    max-width: 480px;
    margin: 3rem auto;
}

.auth-page .page-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* 設定タブ */
.tabs {
    margin-top: 1rem;
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 1rem;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.tab-nav-button {
    padding: 0.5rem 1rem;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--gray);
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.tab-nav-button:hover {
    color: var(--primary-color);
    background-color: #f5f5f5;
}

.tab-nav-button.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    background-color: #f5f5f5;
}

.tab-content {
    margin-top: 0.5rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 汎用レイアウトユーティリティ（インラインスタイル置き換え用） */
.card-narrow-sm {
    max-width: 500px;
    margin: 0 auto;
}

.card-narrow-md {
    max-width: 100%;
    margin: 0 auto;
}

.btn-full {
    width: 100%;
}

.text-danger {
    color: var(--error-color);
}

.text-muted {
    color: #666;
    font-size: 0.9rem;
}

.border-box-muted {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

.link-primary {
    color: #1976D2;
    text-decoration: underline;
}

/* 法的文書ページ（特商法・プライバシーポリシー・会員規約など） */
.legal-text {
    font-size: 0.95rem;
    text-align: left;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* テーブル */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

.table th {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

.table tr:hover {
    background-color: var(--bg-color);
}

.table tr:last-child td {
    border-bottom: none;
}

/* テーブル横スクロール（共通）
 * campsites/list・reservations/list・reservations/detail・admin/* 等、
 * `.table` を包む場合はこのラッパーで統一する。 */
.table-scroll-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
}

.table-scroll-wrap .table {
    width: max-content;
    min-width: 100%;
    margin-bottom: 0;
}

/* キャンプサイト管理一覧：操作列（複数ボタン）を上揃え */
.campsite-list-table .campsite-list-actions-cell {
    vertical-align: top;
}

.campsite-list-actions {
    max-width: 100%;
}

/* 予約一覧：予約番号+サイト名、ステータス列に操作ボタン */
.reservation-list-table .reservation-list-identity-cell,
.reservation-list-table .reservation-list-status-cell {
    vertical-align: top;
}

.reservation-list-number {
    margin-bottom: 0.25rem;
}

.reservation-status-label {
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.reservation-status-actions {
    margin-top: 0.15rem;
}

/* 予約プレビュー（preview.php の予約詳細） */
.card-narrow {
    max-width: 600px;
    margin: 0 auto;
}

.card-header-primary {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0;
}

.reservation-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--bg-color);
}

.reservation-section-title {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.reservation-detail-table,
.reservation-price-table,
.reservation-guest-table {
    width: 100%;
    border-collapse: collapse;
}

.reservation-detail-table td,
.reservation-price-table td,
.reservation-guest-table td {
    padding: 0.5rem 0.25rem;
    vertical-align: top;
}

.reservation-detail-table td:first-child,
.reservation-price-table td:first-child,
.reservation-guest-table td:first-child {
    font-weight: 600;
    width: 40%;
    color: var(--dark-gray);
}

.reservation-price-total-row {
    border-top: 1px solid var(--bg-color);
}

.reservation-price-total-label {
    font-weight: 600;
    font-size: 1.1rem;
}

.reservation-price-total-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: right;
}

/* グリッド */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ダッシュボード：統計棒グラフ */
.dashboard-charts-section {
    margin-bottom: 2rem;
}

.dashboard-charts-intro {
    margin-bottom: 1rem;
}

.dashboard-charts-heading {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--dark-gray);
}

.dashboard-charts-note {
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

.dashboard-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.dashboard-chart-card .dashboard-chart-title {
    font-size: 1rem;
}

.dashboard-chart-wrap {
    position: relative;
    height: 260px;
    padding: 0 0.75rem 0.75rem;
    box-sizing: border-box;
}

/* パンくずリスト */
.breadcrumb-nav {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--gray);
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ' › ';
    margin-right: 0.25rem;
    color: var(--gray);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item span[aria-current="page"] {
    color: var(--text-color);
    font-weight: 500;
}

/* キャンプサイトカード */
.campsite-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.campsite-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.campsite-image {
    width: 100%;
    /* 4:3 のアスペクト比で統一 */
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.campsite-info {
    padding: 10px;
}

.campsite-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.campsite-location {
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.campsite-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-top: 1rem;
}

/* 検索フォーム */
.search-form {
    background-color: var(--white);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-form .grid {
    margin-bottom: 1rem;
}

/* ページヘッダー */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.page-title .page-title-edit-link {
    color: inherit;
    text-decoration: none;
}

.page-title .page-title-edit-link:hover {
    text-decoration: underline;
}

.page-subtitle {
    color: var(--gray);
}

/* アラート */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #E8F5E9;
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background-color: #FFEBEE;
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

.alert-info {
    background-color: #E3F2FD;
    color: #1976D2;
    border-left: 4px solid #1976D2;
}

/* フッター */
.footer {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-text1 {
    margin-bottom: 0.5rem;
}

.footer-text1 a,
.footer-text2 a {
    color: var(--white);
    text-decoration: none;
}

.footer-text1 a:hover,
.footer-text2 a:hover {
    opacity: 0.8;
    text-decoration: none;
}

.footer-text2 {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-close:hover {
    color: var(--text-color);
}

/* 画像ギャラリー */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.gallery-image {
    width: 100%;
    /* 4:3 のアスペクト比で統一 */
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-image:hover {
    transform: scale(1.05);
}

/* キャンプサイト：管理権限（オーナー移譲）画面 */
.campsite-transfer-owner-wrap {
    padding: 1.5rem 1.25rem 2rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* キャンプサイト詳細：基本情報＋右カラム（注意・予約実績・設備） */
.campsite-detail-main-grid {
    align-items: start;
}

.campsite-detail-aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.campsite-detail-vehicle-notice {
    margin: 0;
    padding: 1rem 1.125rem;
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.12) 0%, rgba(76, 175, 80, 0.18) 100%);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.15);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.campsite-detail-vehicle-notice__icon {
    font-size: 1.35rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.campsite-detail-vehicle-notice__text {
    flex: 1;
}

.campsite-detail-popularity {
    background-color: var(--white);
    padding: 1rem 1.125rem;
    border-radius: 8px;
    border: 1px solid rgba(46, 125, 50, 0.2);
}

.campsite-detail-popularity__title {
    font-size: 1rem;
    color: var(--primary-color);
    margin: 0 0 0.5rem;
    font-weight: 700;
}

.campsite-detail-popularity__line {
    margin: 0.25rem 0;
    font-size: 0.95rem;
}

.campsite-detail-popularity__highlight {
    color: var(--success-color);
    font-weight: 600;
}

.campsite-detail-facilities-card {
    margin-top: 0;
}

/* キャンプサイト詳細：画像カルーセル + 全画面ライトボックス */
.campsite-detail-gallery-card {
    padding: 0;
    overflow: hidden;
}

.campsite-carousel {
    position: relative;
}

.campsite-carousel figure {
    margin: 0;
}

/* 画像表示エリアは常に 4:3（高さ上限時は幅も縮んで比率を維持） */
.campsite-carousel__viewport {
    overflow: hidden;
    width: min(100%, calc(min(70vh, 560px) * 4 / 3));
    max-width: 100%;
    margin-inline: auto;
    border-radius: 4px;
    aspect-ratio: 4 / 3;
    max-height: min(70vh, 560px);
    background: #1a1a1a;
}

.campsite-carousel__track {
    display: flex;
    height: 100%;
    transition: transform 0.38s ease;
    will-change: transform;
}

.campsite-carousel__slide {
    flex: 0 0 100%;
    min-width: 0;
    margin: 0;
    height: 100%;
}

.campsite-carousel__open {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    position: relative;
}

.campsite-carousel__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.campsite-carousel__zoom-hint {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    pointer-events: none;
}

.campsite-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.campsite-carousel__arrow:hover {
    background: rgba(0, 0, 0, 0.72);
}

.campsite-carousel__arrow--prev {
    left: 0.5rem;
}

.campsite-carousel__arrow--next {
    right: 0.5rem;
}

.campsite-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 0.5rem 0.75rem;
    flex-wrap: wrap;
}

.campsite-carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: #ccc;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.campsite-carousel__dot.is-active {
    background: var(--primary-color, #1976d2);
    transform: scale(1.15);
}

body.campsite-lightbox-open {
    overflow: hidden;
}

.campsite-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.campsite-lightbox[hidden] {
    display: none !important;
}

.campsite-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    border: none;
    padding: 0;
    cursor: zoom-out;
}

.campsite-lightbox__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.campsite-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.campsite-lightbox__stage {
    position: relative;
    z-index: 1;
    max-width: 100vw;
    max-height: 100vh;
    padding: 3rem 3.5rem;
    box-sizing: border-box;
    pointer-events: none;
}

.campsite-lightbox__img {
    max-width: 100%;
    max-height: calc(100vh - 6rem);
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: none;
}

.campsite-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.campsite-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.campsite-lightbox__nav--prev {
    left: 0.5rem;
}

.campsite-lightbox__nav--next {
    right: 0.5rem;
}

.campsite-lightbox__counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.9rem;
}

.image-gallery-item {
    position: relative;
}

.image-delete-label {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(211, 47, 47, 0.9);
    color: white;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    z-index: 1;
}

.image-delete-label:hover {
    background: rgba(183, 28, 28, 1);
}

/* キャンプサイト編集：画像並び替え（D&D） */
.campsite-image-gallery-sortable .image-gallery-item--sortable {
    position: relative;
}

.campsite-image-gallery-sortable .image-drag-handle {
    position: absolute;
    left: 0.35rem;
    top: 0.35rem;
    z-index: 2;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 4px;
    cursor: grab;
    font-size: 1rem;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
}

.campsite-image-gallery-sortable .image-drag-handle:active {
    cursor: grabbing;
}

.campsite-image-gallery-sortable .image-gallery-item--dragging {
    opacity: 0.65;
    outline: 2px dashed var(--primary-color, #1976d2);
    border-radius: 4px;
}

.campsite-image-gallery-sortable .image-gallery-item--sortable .gallery-image {
    cursor: default;
}

.campsite-image-gallery-sortable .image-gallery-item--sortable .gallery-image:hover {
    transform: none;
}

.image-delete-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* 空き状況カレンダー */
.calendar {
    background-color: var(--white);
    border-radius: 8px;
    /* padding: 1.5rem; */
    /* margin-bottom: 1.5rem; */
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day-header {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 4px;
}

.calendar-day {
    padding: 0.75rem;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.calendar-day.available {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.calendar-day.available:hover {
    background-color: var(--accent-color);
    color: var(--white);
}

.calendar-day.booked {
    background-color: var(--light-gray);
    color: var(--gray);
    cursor: not-allowed;
    position: relative;
    opacity: 0.6;
    /*text-decoration: line-through;*/
}

.calendar-day.booked:hover {
    background-color: var(--light-gray);
    color: var(--gray);
    opacity: 0.6;
}

/* 予約済みだがチェックアウト日として選択可能な境界日 */
.calendar-day.checkout-boundary {
    cursor: pointer;
    opacity: 0.75;
}
.calendar-day.checkout-boundary:hover {
    opacity: 1;
    background-color: #d0e8ff;
    color: #333;
}

.calendar-day.selected {
    background-color: var(--primary-color);
    color: var(--white);
}

.calendar-day.today {
    border: 2px solid var(--secondary-color);
}

/* 統計カード */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray);
    font-size: 0.875rem;
}

/* バーガーメニュー */
.burger-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.burger-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--white);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.burger-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.burger-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .burger-menu-toggle {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--primary-color);
        transition: right 0.3s ease;
        z-index: 1000;
        padding: 4rem 1.5rem 1.5rem;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
    }

    .nav.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
    }

    .nav-list li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-list li:last-child {
        border-bottom: none;
    }

    .nav-list a,
    .nav-list .username {
        display: block;
        padding: 1rem 0;
        width: 100%;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }

    .modal-content {
        width: 95%;
        padding: 1rem;
    }

    .calendar-grid {
        gap: 0.25rem;
    }

    .calendar-day {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    /* スマホ表示時のみ予約一覧のカレンダーを非表示 */
    #date-range-calendar {
        display: none;
    }
}

/* ユーティリティ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ランディングページスタイル */
/* ヒーローセクション */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
}

.hero-search-form {
    background-color: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 2rem;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.search-field {
    display: flex;
    flex-direction: column;
}

.search-submit-field {
    display: flex;
    align-items: flex-end;
}

.search-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--light-gray);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
    width: 100%;
}

/* 特徴セクション */
.features-section {
    padding: 4rem 0;
    background-color: var(--white);
}

.section-title {
    font-size: 2rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 600;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* キャンプすがり3サイト用：3カラム固定 */
.sugari-sites-grid {
    grid-template-columns: repeat(3, 1fr);
}

.sugari-site-card {
    text-align: left;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.sugari-site-description {
    flex: 1;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.sugari-site-card .btn {
    margin-top: auto;
    align-self: flex-start;
}

@media (max-width: 900px) {
    .sugari-sites-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    text-align: center;
    padding: 10px;
    background-color: var(--bg-color);
    border-radius: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.feature-description {
    color: var(--gray);
    line-height: 1.6;
}

/* イベント告知セクション */
.events-section {
    padding: 4rem 0;
    background-color: var(--white);
}

/* ヘッダー直下のイベント告知（コンパクト） */
.events-section-top {
    padding: 1.25rem 0;
    background-color: var(--bg-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.events-section-top .events-list {
    gap: 0.75rem;
    max-width: 100%;
}

.events-section-top .event-card {
    padding: 0.75rem 1rem;
}

.events-section-top .event-card-image-wrap {
    flex: 0 0 25%;
    width: 25%;
    aspect-ratio: 4 / 3;
}

.events-section-top .event-card-image,
.events-section-top .event-card-image-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.events-section-top .event-card-content {
    padding: 0.25rem 0 0 1rem;
}

.events-section-top .event-title {
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .events-section-top .event-card-row {
        flex-direction: column;
    }
    .events-section-top .event-card-image-wrap {
        width: 100%;
        aspect-ratio: 4 / 3;
    }
    .events-section-top .event-card-image,
    .events-section-top .event-card-image-placeholder {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .events-section-top .event-card-content {
        padding: 0.5rem 0 0 0;
    }
}

.event-error-msg {
    color: #b71c1c;
    font-size: 0.875rem;
}

.event-error-msg code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.event-card {
    padding: 1.5rem;
    background-color: var(--bg-color);
    border-radius: 12px;
}

/* PC: 左1/4 画像（4:3固定）・右3/4 テキスト */
.event-card-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.event-card-row .event-card-image-wrap {
    flex: 0 0 25%;
    width: 25%;
    min-width: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.06);
}

.event-card-row .event-card-content {
    flex: 1;
    min-width: 0;
    padding: 0 0 0 1.25rem;
}

.event-card-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.event-card-image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #999);
    font-size: 0.875rem;
    background-color: rgba(0, 0, 0, 0.05);
}

@media (max-width: 640px) {
    .event-card-row {
        flex-direction: column;
    }
    .event-card-row .event-card-image-wrap {
        flex: none;
        width: 100%;
        aspect-ratio: 4 / 3;
    }
    .event-card-row .event-card-content {
        padding: 1rem 0 0 0;
    }
    .event-card-image,
    .event-card-image-placeholder {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.event-title {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.event-period {
    font-size: 0.875rem;
    color: var(--text-muted, #666);
    margin: -0.25rem 0 0.75rem 0;
}

.event-body {
    color: var(--text-color);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.event-link {
    display: inline-block;
    color: var(--secondary-color);
    font-weight: 500;
    text-decoration: none;
}

.event-link:hover {
    text-decoration: underline;
}

.event-empty-msg {
    text-align: center;
    color: var(--text-muted, #666);
    padding: 2rem;
}

/* 人気セクション */
.popular-section {
    padding: 4rem 0;
    background-color: var(--bg-color);
}

.campsites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* 使い方セクション */
.howto-section {
    padding: 4rem 0;
    background-color: var(--white);
}

.howto-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.howto-step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.step-title {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.step-description {
    color: var(--gray);
    line-height: 1.6;
}

/* CTAセクション */
.cta-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    margin-top: 3rem;
}

.cta-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cta-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.cta-description {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-section .btn-primary {
    background-color: var(--white);
    color: var(--primary-color);
    font-weight: 600;
}

.cta-section .btn-primary:hover {
    background-color: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* タグ入力スタイル */
.tag-input {
    position: relative;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    min-height: 2rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
    gap: 0.5rem;
    transition: all 0.3s;
}

.tag:hover {
    background-color: #1B5E20;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tag-remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.tag-remove:hover {
    opacity: 1;
}

.tag-container {
    display: flex;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-search-form {
        padding: 1.5rem;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }

    .search-submit-field {
        margin-top: 0.5rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .features-grid,
    .campsites-grid,
    .howto-steps {
        grid-template-columns: 1fr;
    }

    .cta-title {
        font-size: 1.75rem;
    }

    .hide-on-mobile {
        display: none !important;
    }
}

