/* 基本スタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.sub-label {
    font-size: 0.9em;
    font-weight: normal;
    color: #666;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
}

/* ボタン */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn:disabled {
    background-color: #ccc;
    color: #888;
    cursor: not-allowed;
}

.btn:disabled:hover {
    background-color: #ccc;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

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

.btn-warning {
    background-color: #fd7e14;
    color: white;
}

.btn-warning:hover {
    background-color: #e96b00;
}

.btn-large {
    padding: 15px 30px;
    font-size: 18px;
    width: 100%;
    margin-bottom: 10px;
}

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
}

.btn-icon {
    padding: 5px 8px;
    line-height: 1;
}

.btn-icon i {
    font-size: 14px;
}

/* 電話番号入力画面 */
.phone-input-form {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.phone-input-form h1 {
    margin-bottom: 30px;
    color: #333;
}

/* メニュー画面 */
.menu {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.menu h1 {
    margin-bottom: 10px;
}

.greeting {
    margin-bottom: 30px;
    color: #666;
}

.menu-buttons {
    margin-bottom: 30px;
}

.menu-divider {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: 25px 0;
}

.menu-section {
    text-align: left;
    margin-bottom: 25px;
}

.menu-section-title {
    font-size: 1em;
    color: #495057;
    margin-bottom: 15px;
}

.menu-section .menu-buttons {
    margin-bottom: 0;
}

.menu-hint {
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 10px;
    line-height: 1.5;
}

.btn-disabled {
    background-color: #adb5bd;
    color: white;
    cursor: not-allowed;
    pointer-events: none;
}

.reservation-scope-label {
    font-size: 1.1em;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 10px;
}

/* 予約画面 */
.reservation-form {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dates-list {
    margin: 20px 0;
}

.date-item {
    padding: 15px;
    margin: 10px 0;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.date-header {
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.date-classes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.class-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.class-option:hover {
    background: #f0f0f0;
}

.class-option input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.class-option.full {
    opacity: 0.6;
    cursor: not-allowed;
}

.date-item.locked {
    background: #e9ecef;
    color: #6c757d;
    opacity: 0.6;
}

.date-item.has-reservation {
    opacity: 0.6;
    background: #e9ecef;
    color: #6c757d;
    pointer-events: none;
}

.date-item.has-reservation .reservation-info {
    padding: 10px;
    font-size: 0.9em;
    color: #495057;
    font-style: italic;
}

.lock-badge {
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-left: 10px;
}

.selected-reservations {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
}

.selected-reservations h3 {
    margin-bottom: 15px;
}

.selected-reservations-list {
    margin: 15px 0;
}

.selected-reservation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.classes-selection {
    margin: 20px 0;
}

.class-item {
    padding: 10px;
    margin: 5px 0;
    background: white;
    border-radius: 4px;
}

.class-item.full {
    opacity: 0.6;
}

/* 週単位のグループ表示 */
.week-group {
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #007bff;
    color: white;
    cursor: pointer;
    font-weight: bold;
    user-select: none;
    transition: background-color 0.2s;
}

.week-header:hover {
    background: #0056b3;
}

.week-header.disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.week-header.disabled:hover {
    background: #6c757d;
}

.week-group.disabled-week {
    opacity: 0.6;
    background: #e9ecef;
}

.month-divider.disabled-month {
    opacity: 0.6;
}

.month-divider .disabled-note {
    font-size: 0.8em;
    color: #dc3545;
    font-weight: normal;
    margin-left: 10px;
}

.date-item.disabled-date {
    background: #e9ecef;
    color: #6c757d;
    opacity: 0.6;
    pointer-events: none;
}

.date-item.disabled-date .disabled-message {
    padding: 10px;
    font-size: 0.9em;
    color: #495057;
    font-style: italic;
    text-align: center;
}

.next-month-adjusting-message {
    padding: 15px;
    font-size: 0.9em;
    color: #495057;
    text-align: center;
}

.adjusting-message-link {
    color: #fd7e14;
    font-weight: bold;
    font-style: normal;
    text-decoration: underline;
    /* 親要素 .disabled-date が pointer-events: none のため、リンクだけ復帰させる */
    pointer-events: auto;
}

.week-title {
    flex: 1;
    font-size: 1.1em;
}

.week-toggle {
    font-size: 0.9em;
    transition: transform 0.2s;
    margin-left: 10px;
}

.week-content {
    padding: 10px;
    background: white;
}

.loading-indicator {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.week-content .error-message {
    padding: 20px;
    text-align: center;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px;
}

.week-content .error-message button {
    margin-top: 10px;
}

.week-content .date-item {
    margin: 8px 0;
}

/* 予約一覧 */
.reservations-list,
.my-reservations {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .reservations-list,
    .my-reservations {
        padding: 20px;
    }
}

.reservation-item {
    padding: 8px 12px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.reservation-item.pending {
    border-left: 4px solid #ffc107;
}

.reservation-item.confirmed {
    border-left: 4px solid #28a745;
}

.reservation-item.cancelled {
    border-left: 4px solid #dc3545;
    opacity: 0.6;
}

.reservation-line1 {
    font-size: 1em;
    margin-bottom: 3px;
    line-height: 1.4;
}

.reservation-line2 {
    font-size: 0.85em;
    color: #666;
    margin-top: 3px;
    line-height: 1.4;
}

@media (max-width: 767px) {
    .menu {
        padding: 24px 20px;
    }
    .btn-large {
        padding: 14px 16px;
        font-size: 16px;
    }
    .reservation-line1 {
        font-size: 0.9em;
    }
    .reservation-date-large {
        font-size: 1.1em;
    }
    .reservation-line2 {
        font-size: 0.8em;
    }
    .reservation-item {
        padding: 6px 10px;
        margin: 4px 0;
    }
}

.reservation-date {
    font-weight: bold;
    font-size: 1.1em;
}

.reservation-class {
    color: #666;
    margin: 5px 0;
}

.reservation-date-large {
    font-weight: bold;
    font-size: 1.2em;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.9em;
    font-weight: bold;
}

.status-badge.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-confirmed {
    background: #28a745;
    color: white;
}

.status-badge.status-cancel_pending {
    background: #ff7043;
    color: white;
}

.status-badge.status-cancelled {
    background: #dc3545;
    color: white;
}

.reservation-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.9em;
    margin: 5px 0;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-confirmed {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.reservation-time {
    font-size: 0.9em;
    color: #666;
    margin: 5px 0;
}

.reservation-note {
    font-size: 0.9em;
    color: #ffc107;
    margin: 5px 0;
}

/* メッセージ */
.messages {
    margin-bottom: 20px;
}

.alert {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

/* リンク */
.back-link {
    margin-top: 30px;
    text-align: center;
}

.back-link a {
    color: #007bff;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* 新規予約・予約状況確認画面の戻るボタンは白字 */
.reservation-form .back-link a,
.my-reservations .back-link a {
    color: white !important;
    background-color: #6c757d !important;
    padding: 10px 20px;
    border-radius: 4px;
    display: inline-block;
}

.reservation-form .back-link a:hover,
.my-reservations .back-link a:hover {
    background-color: #545b62 !important;
    text-decoration: none;
    color: white !important;
}

/* 確認成功画面 */
.confirmation-success {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.reservation-details {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* エラーページ */
.error-page {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.error-message {
    color: #dc3545;
    font-size: 1.1em;
    margin: 20px 0;
}

/* 利用実績 */
.usage-records-table-wrap {
    overflow-x: auto;
    margin: 20px 0;
}

.usage-records-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.usage-records-table th,
.usage-records-table td {
    padding: 8px 12px;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
}

.usage-records-table thead th {
    background: #f8f9fa;
    font-weight: bold;
}

.usage-records-legend {
    font-size: 0.85em;
    color: #666;
    margin-top: 8px;
}

