/* ===================================================
   休日保育予約システム - フロントエンドCSS
   とりやまこども園 ブランドカラー適用版
   =================================================== */

:root {
  --hb-blue:         #10b7ee;
  --hb-green-dark:   #007f49;
  --hb-red:          #ee1035;
  --hb-red-light:    #fcc0c8;
  --hb-blue-light:   #d6f2fc;
  --hb-blue-pale:    #edf9fe;
  --hb-orange:       #f7b146;
  --hb-orange-light: #fde8c0;
  --hb-orange-pale:  #fff8ec;
  --hb-green:        #00a05c;
  --hb-green-light:  #b3e6d2;
  --hb-green-pale:   #e6f7f0;
  --hb-pale-orange:  #fff796;
  --hb-red:          #ee1035;
  --hb-red-light:    #fcc0c8;
  --hb-yellow:       #eebc10;
  --hb-ink:          #1a2a22;
  --hb-muted:        #6a8070;
  --hb-border:       #c8ddd6;
  --hb-bg:           #f7fdf9;
  --hb-radius:       10px;
  --hb-shadow:       0 3px 16px rgba(0,160,92,.10);
}

/* ── カレンダー全体 ─────────────────────────────────── */
#hb-calendar-wrap {
    max-width: 640px;
    margin: 0 auto 32px;
    font-family: sans-serif;
}

.hb-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.hb-calendar-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: var(--hb-ink);
}
/* ナビボタンは inline-styles.php の #hb-cal-prev / #hb-cal-next で定義済み */

.hb-nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--hb-green-pale);
    border: 1.5px solid var(--hb-green-light);
    border-radius: 6px;
    color: var(--hb-green);
    font-size: 1.1em;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background .15s;
}
.hb-nav-btn:hover { background: var(--hb-green-light); }

/* ローディング表示 */
.hb-cal-loading {
    text-align: center;
    padding: 10px 0 6px;
    font-size: .85em;
    color: var(--hb-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.hb-cal-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--hb-green-light);
    border-top-color: var(--hb-green);
    border-radius: 50%;
    animation: hb-spin .7s linear infinite;
}
@keyframes hb-spin { to { transform: rotate(360deg); } }

/* カレンダーグリッドの月切り替え時フェード */
#hb-calendar-grid {
    transition: opacity .2s ease;
}

.hb-calendar-note {
    font-size: .85em;
    color: var(--hb-muted);
    margin-bottom: 10px;
}

/* ── カレンダーグリッド ─────────────────────────────── */
.hb-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.hb-dow {
    text-align: center;
    font-size: .78em;
    font-weight: 700;
    padding: 5px 0;
    color: var(--hb-muted);
}
.hb-dow.sun { color: var(--hb-red); }
.hb-dow.sat { color: var(--hb-blue); }

/* 日付セル共通 */
.hb-cell {
    border-radius: var(--hb-radius);
    padding: 6px 3px;
    min-height: 64px;
    font-size: .80em;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.hb-day-num {
    font-size: 1.1em;
    font-weight: 700;
    line-height: 1;
}

/* 保育なし・空白 */
.hb-cell--none  { background: #f4f4f4; color: #ccc; }
.hb-cell--empty { background: transparent; }

/* ── 予約可能日（グリーン） ── */
.hb-cell--available {
    background: var(--hb-green-pale);
    border: 2px solid var(--hb-green-light);
    cursor: pointer;
    transition: transform .12s, box-shadow .12s;
}
.hb-cell--available:hover {
    background: var(--hb-green-light);
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(0,160,92,.25);
}
.hb-badge { font-size: .68em; color: var(--hb-green); line-height: 1.3; }

/* ── 満員（オレンジ） ── */
.hb-cell--available.hb-cell--full {
    background: var(--hb-orange-pale);
    border-color: var(--hb-orange-light);
}
.hb-cell--available.hb-cell--full:hover {
    background: var(--hb-orange-light);
    box-shadow: 0 4px 14px rgba(247,177,70,.30);
}
.hb-cell--full .hb-badge { color: var(--hb-orange); }

/* ── 選択済み（ブルー） ── */
.hb-cell--available.hb-selected {
    background: var(--hb-blue) !important;
    border-color: var(--hb-blue) !important;
    color: #fff;
    transform: scale(1.06);
    box-shadow: 0 4px 16px rgba(16,183,238,.35);
}
.hb-cell--available.hb-selected .hb-day-num { color: #fff; }
.hb-cell--available.hb-selected .hb-badge   { color: rgba(255,255,255,.85); }
.hb-cell--available.hb-selected .hb-date-note { background: rgba(255,255,255,.2); color: #fff; }

/* ── 過去・受付前 ── */
.hb-cell--past, .hb-cell--not-open {
    opacity: .45; cursor: default; pointer-events: none;
}

/* 曜日カラー */
.hb-cell.sun .hb-day-num { color: var(--hb-red); }
.hb-cell.sat .hb-day-num { color: var(--hb-blue); }
.hb-cell.hb-selected .hb-day-num { color: #fff !important; }
.hb-cell--none.sun .hb-day-num { color: #e8a0aa; }
.hb-cell--none.sat .hb-day-num { color: #a0d4ef; }

/* メモバッジ */
.hb-date-note {
    font-size: .64em;
    color: #795548;
    background: var(--hb-pale-orange);
    border-radius: 3px;
    padding: 1px 5px;
    line-height: 1.4;
}

/* ── 選択サマリー ─────────────────────────────────── */
#hb-selected-summary {
    margin-top: 16px;
    padding: 13px 18px;
    background: var(--hb-blue-pale);
    border: 1.5px solid var(--hb-blue-light);
    border-radius: var(--hb-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
#hb-selected-summary strong { color: var(--hb-blue); }

/* ── 予約フォーム ────────────────────────────────── */
#hb-booking-form-wrap {
    max-width: 600px;
    margin: 0 auto;
}
#hb-booking-form-wrap h3 {
    color: var(--hb-green);
    border-left: 4px solid var(--hb-green);
    padding-left: 10px;
    margin-bottom: 8px;
}
#hb-selected-dates-label {
    color: var(--hb-blue);
    font-size: .9em;
    font-weight: 600;
    margin-bottom: 14px;
}

.hb-form-table { width: 100%; border-collapse: collapse; }
.hb-form-table th {
    width: 140px;
    padding: 10px 12px 10px 0;
    vertical-align: top;
    font-size: .88em;
    color: var(--hb-ink);
    font-weight: 700;
    white-space: nowrap;
}
.hb-form-table td { padding: 8px 0; }

/* フォームinput → inline-styles.php で定義済み */

.hb-required {
    background: var(--hb-red);
    color: #fff;
    font-size: .68em;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 4px;
}
.hb-note { font-size: .78em; color: var(--hb-muted); margin: 4px 0 0; }

/* 園児追加 */
.hb-child-row { display: flex; gap: 8px; margin-bottom: 6px; }
.hb-child-row input { flex: 1; }
.hb-child-remove {
    background: none;
    border: 1.5px solid var(--hb-red-light);
    border-radius: 7px;
    color: var(--hb-red);
    font-size: 1em;
    cursor: pointer;
    padding: 0 8px;
    transition: background .1s;
}
.hb-child-remove:hover { background: var(--hb-red-light); }

/* ── ボタン（Cocoonテーマ競合対策済み専用クラス） ──────
   all: unset でCocoonの button{} グローバルスタイルをリセット。
   IDスコープ (#hb-calendar-wrap 等) で詳細度を確保。
───────────────────────────────────────────────────── */

/* ベースリセット：すべての hb-front-btn に適用 */
#hb-calendar-wrap .hb-front-btn,
#hb-booking-form-wrap .hb-front-btn,
#hb-mypage-wrap .hb-front-btn {
    all: unset;                   /* Cocoonの button{} を完全リセット */
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    font-size: 1em;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .03em;
    cursor: pointer;
    box-sizing: border-box;
    transition: background .15s, transform .12s, box-shadow .15s, color .12s;
}
#hb-calendar-wrap .hb-front-btn:focus-visible,
#hb-booking-form-wrap .hb-front-btn:focus-visible,
#hb-mypage-wrap .hb-front-btn:focus-visible {
    outline: 3px solid var(--hb-blue);
    outline-offset: 2px;
}

/* プライマリ：この日程で予約する・予約する・予約を確認する */
#hb-calendar-wrap .hb-front-btn--primary,
#hb-booking-form-wrap .hb-front-btn--primary,
#hb-mypage-wrap .hb-front-btn--primary {
    background: var(--hb-green);
    color: #fff;
    padding: 11px 28px;
    border-radius: 8px;
    box-shadow: 0 2px 0 #007040;
    text-decoration: none;
}
#hb-calendar-wrap .hb-front-btn--primary:hover,
#hb-booking-form-wrap .hb-front-btn--primary:hover,
#hb-mypage-wrap .hb-front-btn--primary:hover {
    background: #008a4f;
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0,160,92,.35);
    color: #fff;
}
#hb-calendar-wrap .hb-front-btn--primary:active,
#hb-booking-form-wrap .hb-front-btn--primary:active,
#hb-mypage-wrap .hb-front-btn--primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 0 #007040;
}
#hb-calendar-wrap .hb-front-btn--primary:disabled,
#hb-booking-form-wrap .hb-front-btn--primary:disabled {
    background: #8cbfaa;
    cursor: default;
    transform: none;
    box-shadow: none;
}

/* リンク風：お子さまを追加・日程を選び直す */
#hb-booking-form-wrap .hb-front-btn--link {
    background: none;
    color: var(--hb-blue);
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    font-size: .9em;
    box-shadow: none;
}
#hb-booking-form-wrap .hb-front-btn--link:hover {
    color: #0a9fd4;
    text-decoration-thickness: 2px;
    transform: none;
    box-shadow: none;
}

/* お子さまを追加ボタン */
#hb-booking-form-wrap .hb-front-btn--secondary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 16px;
    background: var(--hb-green-pale);
    color: var(--hb-green);
    border: 1.5px solid var(--hb-green-light);
    border-radius: 7px;
    font-size: .88em;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background .15s;
}
#hb-booking-form-wrap .hb-front-btn--secondary:hover { background: var(--hb-green-light); }

/* 日程を選び直すボタン */
#hb-booking-form-wrap .hb-front-btn--ghost {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 9px 20px;
    background: #fff;
    color: var(--hb-muted);
    border: 1.5px solid var(--hb-border);
    border-radius: 8px;
    font-size: .9em;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background .15s, border-color .15s, color .15s;
}
#hb-booking-form-wrap .hb-front-btn--ghost:hover {
    background: #f5f5f5;
    border-color: #aaa;
    color: var(--hb-ink);
}

/* 予約ボタン行（予約する + 日程を選び直す を横並び）*/
#hb-booking-form-wrap .hb-form-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* ── メッセージ ─────────────────────────────────── */
#hb-form-message, #hb-mypage-message {
    margin: 12px 0;
    padding: 11px 16px;
    border-radius: 8px;
    display: none;
    font-size: .9em;
}
.hb-msg-success {
    background: var(--hb-green-pale);
    color: #00623a;
    border: 1.5px solid var(--hb-green-light);
}
.hb-msg-error {
    background: #fff0f2;
    color: #990020;
    border: 1.5px solid var(--hb-red-light);
}

/* ── マイページ ─────────────────────────────────── */
#hb-mypage-wrap { max-width: 560px; margin: 0 auto; }
#hb-mypage-wrap h3 {
    color: var(--hb-green);
    border-left: 4px solid var(--hb-green);
    padding-left: 10px;
}

#hb-lookup-form { display: flex; gap: 8px; margin: 14px 0; }
/* lookup-email → inline-styles.php で定義済み */
#hb-mypage-wrap #hb-lookup-email { flex: 1; }

/* 予約グループカード */
.hb-group-card {
    border: 1.5px solid var(--hb-border);
    border-radius: 10px;
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: var(--hb-shadow);
}
.hb-group-header {
    background: var(--hb-green-pale);
    border-bottom: 1px solid var(--hb-green-light);
    padding: 10px 16px;
    font-size: .84em;
    color: var(--hb-muted);
}
.hb-group-header strong { color: var(--hb-ink); }

.hb-booking-row {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    border-top: 1px solid #f0f0f0;
    gap: 10px;
    flex-wrap: wrap;
}
.hb-booking-date { font-weight: 700; font-size: .92em; flex: 1; min-width: 140px; }

/* ステータスカラー */
.hb-status-confirmed { color: var(--hb-green);  font-weight: 700; font-size: .85em; }
.hb-status-waitlist  { color: var(--hb-orange);  font-weight: 700; font-size: .85em; }
.hb-status-cancelled { color: #aaa; font-size: .85em; }

/* 確定ボタン（キャンセル待ち繰り上がり後）*/
.hb-confirm-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: var(--hb-green);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: .85em;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    width: auto;
    height: auto;
    box-shadow: 0 2px 0 var(--hb-green-dark);
    -webkit-appearance: none;
    appearance: none;
    animation: hb-pulse 1.8s ease infinite;
}
.hb-confirm-btn:hover { background: var(--hb-green-dark); }
@keyframes hb-pulse {
    0%,100% { box-shadow: 0 2px 0 var(--hb-green-dark), 0 0 0 0 rgba(0,160,92,.4); }
    50%      { box-shadow: 0 2px 0 var(--hb-green-dark), 0 0 0 6px rgba(0,160,92,0); }
}

/* キャンセルボタン */
.hb-cancel-btn {
    background: #fff0f2;
    border: 1.5px solid var(--hb-red-light);
    color: var(--hb-red);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: .8em;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s;
}
.hb-cancel-btn:hover { background: var(--hb-red-light); }

/* ── レスポンシブ ───────────────────────────────── */
@media (max-width: 480px) {
    .hb-form-table th { width: 110px; font-size: .82em; }
    .hb-calendar-grid { gap: 3px; }
    .hb-cell { min-height: 54px; font-size: .74em; }
    .hb-day-num { font-size: 1em; }
}
