/* Frontend CSS */
.chb-booking-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.chb-form-step {
    padding: 20px 0;
}

.chb-form-group {
    margin-bottom: 20px;
}

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

.chb-form-group input,
.chb-form-group select,
.chb-form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.required {
    color: red;
}

.chb-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.chb-btn-primary {
    background: #2271b1;
    color: #fff;
}

.chb-btn-primary:hover {
    background: #135e96;
}

.chb-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#chb-calendar {
    margin: 20px 0;
    min-height: 500px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* カレンダーのヘッダー */
.fc .fc-toolbar-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
}

.fc .fc-button {
    background: #2271b1;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    color: #fff;
}

.fc .fc-button:hover {
    background: #135e96;
}

.fc .fc-button:active {
    background: #135e96;
}

/* FullCalendarのセルをカスタマイズ */
.fc-daygrid-day-frame {
    min-height: 70px;
    padding: 4px;
}

.fc-daygrid-day:hover {
    background: #f5f5f5;
    cursor: pointer;
}

.fc-day-today {
    background: #fff3cd !important;
}

.fc-daygrid-day-top {
    justify-content: flex-start;
    margin-bottom: 3px;
}

.fc-daygrid-day-number {
    padding: 4px 6px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.fc-day-today .fc-daygrid-day-number {
    background: #ffc107;
    color: #000;
    border-radius: 3px;
    font-weight: 700;
}

/* 予約可能状況の表示 */
.chb-availability-info {
    margin-top: 3px;
    width: 100%;
}

.chb-availability-bar-container {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 3px;
}

.chb-availability-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.chb-availability-bar.chb-status-full {
    background: #28a745;
}

.chb-availability-bar.chb-status-partial {
    background: #ffc107;
}

.chb-availability-bar.chb-status-none {
    background: #dc3545;
}

.chb-availability-text {
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1.2;
}

.chb-availability-text.chb-status-full {
    background: #d4edda;
    color: #155724;
}

.chb-availability-text.chb-status-partial {
    background: #fff3cd;
    color: #856404;
}

.chb-availability-text.chb-status-none {
    background: #f8d7da;
    color: #721c24;
}

.chb-availability-text.chb-status-closed {
    background: #e9ecef;
    color: #6c757d;
    font-size: 9px;
}

/* 予約情報の表示 */
.chb-booking-info {
    margin-top: 3px;
    font-size: 8px;
    text-align: center;
    line-height: 1.2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
}

.chb-room-badge {
    display: inline-block;
    padding: 2px 5px;
    background: #2271b1;
    color: #fff;
    border-radius: 8px;
    font-size: 8px;
    font-weight: 600;
}

/* 選択された日付のハイライト */
.fc-day-selected {
    background: #e7f3ff !important;
}

.fc-day-selected .fc-daygrid-day-frame {
    border: 2px solid #2271b1;
}

/* 曜日ヘッダー */
.fc .fc-col-header-cell {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 10px 0;
    border: 1px solid #dee2e6;
}

/* グリッド線 */
.fc .fc-scrollgrid {
    border-color: #e9ecef;
}

.fc .fc-scrollgrid td {
    border-color: #e9ecef;
}

/* 予約できない日を半透明にする */
.chb-unavailable-date {
    opacity: 0.4;
    pointer-events: none;
}

.chb-unavailable-date .fc-daygrid-day-number {
    color: #999;
}

.chb-unavailable-date:hover {
    background: transparent !important;
    cursor: default !important;
}

.chb-time-slots {
    margin-top: 20px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.chb-time-slots-title {
    font-size: 18px;
    font-weight: bold;
    color: #212529;
    margin: 0 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #2271b1;
}

.chb-slots-instruction {
    font-size: 14px;
    color: #495057;
    margin: 10px 0 15px 0;
    padding: 10px 15px;
    background: #fff3cd;
    border-radius: 5px;
    border-left: 4px solid #ffc107;
    text-align: center;
}

.chb-no-slots-message {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 15px;
}

#chb-slots-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.chb-time-slot {
    min-height: 55px;
    padding: 12px 8px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chb-time-label {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    display: block;
    text-align: center;
    line-height: 1.4;
}

.chb-time-slot:hover {
    background: #e7f3ff;
    border-color: #2271b1;
    box-shadow: 0 2px 4px rgba(34, 113, 177, 0.2);
}

.chb-time-slot:hover .chb-time-label {
    color: #2271b1;
}

.chb-time-slot.selected {
    background: #2271b1;
    border-color: #2271b1;
    box-shadow: 0 2px 4px rgba(34, 113, 177, 0.3);
}

.chb-time-slot.selected .chb-time-label {
    color: #fff;
    font-weight: 700;
}

.chb-time-slot.selected:hover {
    background: #135e96;
    border-color: #135e96;
}

.chb-form-message {
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.chb-form-message.success {
    background: #d4edda;
    color: #155724;
}

.chb-form-message.error {
    background: #f8d7da;
    color: #721c24;
}

.chb-room-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.chb-room-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    background: #fff;
}

/* Loading spinner */
.chb-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.chb-loading-overlay.active {
    display: flex;
}

.chb-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #2271b1;
    border-radius: 50%;
    animation: chb-spin 1s linear infinite;
}

@keyframes chb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chb-loading-text {
    position: absolute;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-top: 90px;
}
