/**
 * おもちゃ買取 予約システム カスタムCSS
 * シンプルで使いやすいデザイン
 * Version: 2.0.0
 */

/* ========================================
 * 配色定義（統一）
 * ======================================== */
:root {
    --primary-color: #2c5aa0;      /* メインカラー（青） */
    --primary-dark: #1e3a6f;       /* 濃い青 */
    --success-color: #4caf50;      /* 成功・予約可能（緑） */
    --warning-color: #ff9800;      /* 警告・予約済み（オレンジ） */
    --error-color: #e53935;        /* エラー・必須（赤） */
    --text-color: #333;            /* テキスト */
    --text-light: #666;            /* 薄いテキスト */
    --border-color: #ddd;          /* ボーダー */
    --bg-gray: #f5f5f5;            /* 背景グレー */
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.08);  /* 統一した影 */
}

/* ========================================
 * 月カレンダー
 * ======================================== */

.monthly-calendar {
    max-width: 900px;
    margin: 0 auto 30px;
    padding: 20px;
    background: white;
    border-radius: 6px;
    box-shadow: var(--shadow);
}

/* 年月表示 */
.calendar-caption {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary-color);
    padding: 12px 0;
    text-align: center;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--primary-color);
}

/* カレンダーテーブル */
.monthly-calendar table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
}

/* 曜日ヘッダー */
.monthly-calendar .week-title {
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    background: var(--bg-gray);
    border-radius: 3px;
}

.monthly-calendar .week-title.sat {
    color: #1976d2;
}

.monthly-calendar .week-title.sun {
    color: #d32f2f;
}

/* 日付セル */
.monthly-calendar .day-box {
    min-height: 75px;
    padding: 8px;
    text-align: center;
    vertical-align: top;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    transition: all 0.2s ease;
}

.monthly-calendar .day-number {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 6px;
}

/* 空セル */
.monthly-calendar .day-box.no-day {
    background: #fafafa;
    border: none;
}

/* 予約不可 */
.monthly-calendar .day-box.disable {
    background: #fafafa;
    opacity: 0.6;
}

.monthly-calendar .day-box.disable .day-number {
    color: #999;
}

.monthly-calendar .day-box.disable .calendar-mark {
    color: #999;
    font-size: 14px;
}

/* 予約可能 */
.monthly-calendar .day-box.vacant {
    background: #f1f8f1;
    border-color: var(--success-color);
    cursor: pointer;
}

.monthly-calendar .day-box.vacant:hover {
    background: #e8f5e9;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.monthly-calendar .day-box.vacant .calendar-mark a {
    color: var(--success-color);
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
    display: block;
    padding: 6px;
    transition: transform 0.2s ease;
}

.monthly-calendar .day-box.vacant .calendar-mark a:hover {
    transform: scale(1.1);
}

/* 予約済み */
.monthly-calendar .day-box.booked {
    background: #fff8e1;
    border-color: var(--warning-color);
}

.monthly-calendar .day-box.booked .calendar-mark a {
    color: var(--warning-color);
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
    display: block;
    padding: 6px;
}

/* 満員 */
.monthly-calendar .day-box.full {
    background: #fce4ec;
    border-color: #e57373;
}

.monthly-calendar .day-box.full .calendar-mark {
    color: #e57373;
    font-size: 20px;
    font-weight: bold;
}

/* 今日 */
.monthly-calendar .day-box.today {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 8px rgba(44, 90, 160, 0.2);
}

.monthly-calendar .day-box.today .day-number {
    color: var(--primary-color);
}

/* 土日の色 */
.monthly-calendar .day-box.sat .day-number {
    color: #1976d2;
}

.monthly-calendar .day-box.sun .day-number {
    color: #d32f2f;
}

/* 前月・翌月リンク */
.monthly-prev-next {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
}

.monthly-prev {
    text-align: left;
}

.monthly-next {
    text-align: right;
}

.monthly-prev a,
.monthly-next a {
    display: inline-block;
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.monthly-prev a:hover,
.monthly-next a:hover {
    background: var(--primary-dark);
}

.monthly-prev .no-link,
.monthly-next .no-link {
    display: inline-block;
    padding: 8px 20px;
    color: #999;
    font-weight: 600;
}

.schedule-note {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ========================================
 * 時間選択画面
 * ======================================== */

.day-calendar {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.mtssb-timetable-link {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* キャプション */
.mtssb-timetable-link caption {
    padding: 20px;
    background: var(--primary-color);
    color: white;
    text-align: center;
}

.mtssb-timetable-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.5;
}

.mtssb-timetable-date {
    font-size: 20px;
    font-weight: bold;
}

/* テーブルヘッダー */
.mtssb-timetable-link tr:first-child {
    background: var(--bg-gray);
}

.mtssb-timetable-link th {
    padding: 12px;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

/* 時間列 */
.mtssb-timetable-link .day-left {
    width: 30%;
    background: #fafafa;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

/* 予約状況列 */
.mtssb-timetable-link .day-right {
    width: 70%;
    text-align: center;
    padding: 10px;
}

/* 時間選択行 */
.mtssb-timetable-link tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.mtssb-timetable-link tbody tr:last-child {
    border-bottom: none;
}

.mtssb-timetable-link tbody tr:hover {
    background: #f8fbff;
}

/* 予約可能な○ボタン */
.mtssb-timetable-link .calendar-mark.vacant a {
    display: inline-block;
    width: 55px;
    height: 55px;
    line-height: 55px;
    background: var(--success-color);
    color: white;
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.mtssb-timetable-link .calendar-mark.vacant a:hover {
    background: #388e3c;
    transform: scale(1.05);
}

/* 予約済みの○ボタン */
.mtssb-timetable-link .calendar-mark.booked a {
    display: inline-block;
    width: 55px;
    height: 55px;
    line-height: 55px;
    background: var(--warning-color);
    color: white;
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.mtssb-timetable-link .calendar-mark.booked a:hover {
    background: #f57c00;
    transform: scale(1.05);
}

/* 満員・予約不可 */
.mtssb-timetable-link .calendar-mark.full,
.mtssb-timetable-link .calendar-mark.disable {
    color: #999;
    font-size: 20px;
}

/* 戻るボタン */
.mtssb-daily-action {
    margin-top: 20px;
    text-align: center;
}

.mtssb-daily-action button {
    padding: 12px 40px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mtssb-daily-action button:hover {
    background: var(--bg-gray);
    border-color: #999;
}

/* ========================================
 * 予約フォーム
 * ======================================== */

.content-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Fieldset */
fieldset {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

fieldset legend {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
}

/* テーブル */
fieldset table {
    width: 100%;
    border-collapse: collapse;
}

fieldset table tr {
    border-bottom: 1px solid #f0f0f0;
}

fieldset table tr:last-child {
    border-bottom: none;
}

fieldset table th {
    text-align: left;
    padding: 14px 10px;
    vertical-align: top;
    font-weight: 600;
    color: var(--text-color);
    width: 35%;
}

fieldset table td {
    padding: 14px 10px;
    vertical-align: top;
}

/* 必須マーク */
.required {
    color: var(--error-color);
    font-weight: bold;
    font-size: 15px;
}

/* 入力フィールド */
.content-text {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    line-height: 1.5;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.content-text:focus {
    border-color: var(--primary-color);
    outline: none;
}

textarea.content-text {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.content-text.small-medium {
    max-width: 180px;
}

.content-text.medium {
    max-width: 280px;
}

/* セレクトボックス */
select {
    padding: 9px 12px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* ラジオボタン・チェックボックス */
.content-radio,
.field-item {
    display: inline-block;
    margin-right: 16px;
    margin-bottom: 6px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.content-radio:hover,
.field-item:hover {
    background-color: #f5f5f5;
}

.content-radio input[type="radio"],
.field-item input[type="radio"],
.field-item input[type="checkbox"] {
    margin-right: 5px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ラベル */
label {
    cursor: pointer;
}

label.booking-seimei {
    display: inline-block;
    font-weight: 600;
    margin-right: 5px;
    color: var(--text-color);
}

/* エラーメッセージ */
.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 5px;
    padding: 8px 10px;
    background-color: #ffebee;
    border-left: 3px solid var(--error-color);
    border-radius: 3px;
}

/* カタカナエラーメッセージ */
.katakana-error {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 5px;
    padding: 8px 10px;
    background-color: #ffebee;
    border-left: 3px solid var(--error-color);
    border-radius: 3px;
    font-weight: 600;
}

/* エラーフィールドのボーダー */
.field-error {
    border-color: var(--error-color) !important;
    background-color: #fff5f5 !important;
}

/* 送信ボタン */
#action-button {
    text-align: center;
    margin-top: 25px;
    margin-bottom: 15px;
}

button[type="submit"] {
    background: var(--success-color);
    color: white;
    font-size: 17px;
    font-weight: bold;
    padding: 14px 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

button[type="submit"]:hover {
    background: #388e3c;
}

button[type="submit"]:active {
    transform: scale(0.98);
}

/* 人数選択 */
.input-number {
    display: inline-block;
    margin-right: 20px;
}

.input-number label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-color);
}

/* オプションテーブル */
#booking-option-table th {
    width: 40%;
}

#booking-option-table td {
    width: 60%;
}

/* 非表示項目 */
#booking-reservation-fieldset > table > tbody > tr.booking-form-people-number-row,
#booking-confirm-fieldset > table > tbody > tr.booking-form-people-number-row,
#booking-confirm-fieldset > table > tbody > tr:nth-child(3),
#booking-confirm-fieldset > table > tbody > tr:nth-child(8) {
    display: none;
}

#content input {
    margin: unset !important;
}

#content input[type="radio"] {
  margin-right: 10px !important;
}

/* ========================================
 * レスポンシブデザイン
 * ======================================== */

@media (max-width: 768px) {
    .monthly-calendar,
    .day-calendar,
    .content-form {
        padding: 12px;
    }
    
    .calendar-caption {
        font-size: 18px;
    }
    
    .monthly-calendar .week-title {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .monthly-calendar .day-box {
        min-height: 60px;
        padding: 4px;
    }
    
    .monthly-calendar .day-number {
        font-size: 14px;
    }
    
    .mtssb-timetable-name {
        font-size: 14px;
    }
    
    .mtssb-timetable-date {
        font-size: 18px;
    }
    
    .mtssb-timetable-link .calendar-mark.vacant a,
    .mtssb-timetable-link .calendar-mark.booked a {
        width: 48px;
        height: 48px;
        line-height: 48px;
        font-size: 24px;
    }
    
    fieldset {
        padding: 14px;
        margin-bottom: 14px;
    }
    
    fieldset legend {
        font-size: 15px;
        padding: 6px 12px;
    }
    
    /* テーブルを縦並びに */
    fieldset table th,
    fieldset table td {
        display: block;
        width: 100%;
        padding: 8px 0;
    }
    
    fieldset table tr {
        border-bottom: 1px solid #e0e0e0;
        padding: 10px 0;
    }
    
    .content-text.small-medium,
    .content-text.medium {
        max-width: 100%;
    }
    
    button[type="submit"] {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .content-radio,
    .field-item {
        display: block;
        margin-bottom: 10px;
    }
    
    .mtssb-daily-action button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .calendar-caption {
        font-size: 16px;
        padding: 10px 0;
    }
    
    .monthly-calendar .day-box {
        min-height: 50px;
    }
    
    .monthly-calendar .day-number {
        font-size: 13px;
    }
    
    .mtssb-timetable-name {
        font-size: 13px;
    }
    
    .mtssb-timetable-date {
        font-size: 16px;
    }
    
    .mtssb-timetable-link .day-left {
        font-size: 14px;
        width: 25%;
    }
    
    .mtssb-timetable-link .calendar-mark.vacant a,
    .mtssb-timetable-link .calendar-mark.booked a {
        width: 42px;
        height: 42px;
        line-height: 42px;
        font-size: 22px;
    }
    
    .content-text {
        font-size: 16px; /* iOSのズーム防止 */
    }
}

/* ========================================
 * アクセシビリティ
 * ======================================== */

/* フォーカス表示 */
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(44, 90, 160, 0.3);
    outline-offset: 1px;
}

button:focus {
    outline: 2px solid rgba(44, 90, 160, 0.5);
    outline-offset: 2px;
}

/* タッチデバイス */
@media (hover: none) and (pointer: coarse) {
    .content-radio,
    .field-item,
    label {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* 印刷 */
@media print {
    fieldset {
        page-break-inside: avoid;
        border: 1px solid #000;
    }
    
    button {
        display: none;
    }
    
    .monthly-prev-next {
        display: none;
    }
}