/**
 * Booking 予約システム - スタイルシート
 */

.booking-reservation-form.booking-box-box1 {
    padding: 20px !important;
    background: #f0fff0 !important;
    border: 1px solid #c3e6c3 !important;
    border-radius: 5px;
    margin: 20px 0;
}

.booking-reservation-form.booking-box-box2 {
    padding: 20px !important;
    background: #f0f8ff !important;
    border: 1px solid #b8d4f0 !important;
    border-radius: 5px;
    margin: 20px 0;
}

.booking-login-required {
    padding: 20px;
    text-align: center;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.booking-reservation-list {
    margin-bottom: 15px;
}

.booking-reservation-list h2.booking-list-title {
    font-size: 1.5em;
    margin-bottom: 15px;
}

/* スマホで予約一覧タイトルを非表示 */
@media (max-width: 768px) {
    .booking-reservation-list h2.booking-list-title {
        display: none;
    }
}

.booking-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.booking-table th,
.booking-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.booking-table th {
    background: #f5f5f5;
    font-weight: bold;
}

.booking-table th:first-child,
.booking-table td.booking-table-type {
    width: auto;
    min-width: 120px;
    white-space: nowrap;
}

.booking-table td.booking-table-datetime {
    white-space: normal;
}

.booking-datetime-date {
    font-weight: 500;
    margin-bottom: 4px;
}

.booking-datetime-time {
    color: #666;
    font-size: 0.95em;
}

.booking-table tbody tr:hover {
    background: #f9f9f9;
}

.booking-cancel-btn {
    padding: 8px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    width: 100%;
    white-space: nowrap;
}

.booking-cancel-btn:hover {
    background: #c82333;
}

.booking-reservation-form {
    margin-top: 15px;
}

.booking-reservation-form h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.booking-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

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

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

.booking-form-group {
    margin-bottom: 10px;
}

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

.booking-form-group select,
.booking-form-group input[type="text"],
.booking-form-group input[type="datetime-local"] {
    width: 100%;
    max-width: 400px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.booking-time-selection {
    margin-top: 15px;
}

.booking-24hour-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.booking-time-slot {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    text-align: center;
    font-size: 0.9em;
    min-width: 60px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.booking-time-slot.touching {
    background: #e0e0e0 !important;
    transform: scale(0.95);
}

.booking-time-slot:hover {
    background: #e9e9e9;
}

.booking-time-slot.available {
    background: white;
    color: #28a745;
    border-color: #28a745;
}

.booking-time-slot.available:hover {
    background: #f0f0f0;
    border-color: #218838;
}

.booking-time-slot.available::after {
    content: '●';
    color: #28a745;
    margin-left: 5px;
}

.booking-time-slot.moderate {
    background: #fff9c4;
    color: #f57f17;
    border-color: #fff59d;
}

.booking-time-slot.moderate:hover {
    background: #fff59d;
    border-color: #fff176;
}

.booking-time-slot.moderate::after {
    content: '△';
    margin-left: 5px;
}

.booking-time-slot.low {
    background: #ffcccc;
    color: #721c24;
    border-color: #ff9999;
}

.booking-time-slot.low:hover {
    background: #ffaaaa;
}

.booking-time-slot.low::after {
    content: '△';
    margin-left: 5px;
}

.booking-time-slot.light-blue {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #90caf9;
}

.booking-time-slot.light-blue:hover {
    background: #bbdefb;
    border-color: #64b5f6;
}

.booking-time-slot.light-blue::after {
    content: '○';
    margin-left: 5px;
}

.booking-time-slot.unavailable {
    background: #f44336;
    color: white;
    border-color: #d32f2f;
    cursor: not-allowed;
}

.booking-time-slot.unavailable:hover {
    background: #f44336;
}

.booking-time-slot.unavailable::after {
    content: '×';
    color: white;
    margin-left: 5px;
}

.booking-time-slot.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}

.booking-time-slot::after {
    content: '○';
    margin-left: 5px;
}

.booking-warning {
    padding: 10px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 3px;
    margin-top: 10px;
}

#booking-submit-btn {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

#booking-submit-btn:hover {
    background: #0056b3;
}

#booking-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.booking-fixed-btn {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px;
}

.booking-fixed-btn:hover {
    background: #218838;
}

.booking-fixed-duration-display {
    padding: 10px 20px;
    background: #e9ecef;
    border: 2px solid #28a745;
    border-radius: 5px;
    font-size: 1em;
    color: #28a745;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
}

/* 予約時間選択ボタン（開始時刻スロットと同じスタイル） */
.booking-duration-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.booking-duration-btn {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    text-align: center;
    font-size: 0.9em;
    min-width: 60px;
    transition: all 0.2s;
    background: white;
    color: #333;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.booking-duration-btn:hover {
    background: #e9e9e9;
}

.booking-duration-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}

.booking-duration-btn.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* 0時間の部分を背景色と同化させて見えなくする */
.booking-duration-btn .booking-duration-zero-hours {
    color: white;
}

.booking-duration-btn.active .booking-duration-zero-hours {
    color: #007bff;
}

.booking-duration-btn.active:hover .booking-duration-zero-hours {
    color: #0056b3;
}

.booking-box2-confirmation {
    padding: 15px;
    background: #d1ecf1;
    border: 2px solid #0c5460;
    border-radius: 5px;
    margin: 15px 0;
    text-align: center;
    font-size: 1.1em;
    color: #0c5460;
}

.booking-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 予約日カレンダー */
#booking-date-calendar-container {
    margin-top: 10px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

#booking-date-calendar,
#booking-date-calendar-current,
#booking-date-calendar-next {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.booking-calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.booking-calendar-nav-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    transition: all 0.2s;
}

.booking-calendar-nav-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.booking-calendar-month {
    flex: 1;
    text-align: center;
}

.booking-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.booking-calendar-weekday {
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #666;
    padding: 5px;
}

.booking-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.booking-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    font-size: 14px;
}

.booking-calendar-day:hover {
    background: #f0f0f0;
    border-color: #0073aa;
}

.booking-calendar-day.available {
    background: white;
    color: #333;
}

.booking-calendar-day.available:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.booking-calendar-day.selected {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    font-weight: bold;
}

.booking-calendar-day.unavailable {
    color: #ccc;
    background: #f9f9f9;
    cursor: not-allowed;
}

.booking-calendar-day.unavailable.full-day-closed {
    background: #dc3545 !important; /* 濃い赤背景 */
    color: white !important;
    border: 2px solid #c82333 !important;
    cursor: not-allowed !important;
    opacity: 0.8;
}

.booking-calendar-day.other-month {
    color: #ccc;
    background: #f9f9f9;
}

.booking-calendar-day.today {
    border: 2px solid #ff9800;
}

.booking-calendar-day.today.selected {
    border-color: #0073aa;
}

/* 土曜日と日曜日のスタイル */
.booking-calendar-day.saturday {
    background-color: #e3f2fd !important; /* 薄い青 */
}

.booking-calendar-day.sunday {
    background-color: #ffebee !important; /* 薄い赤 */
}

.booking-calendar-day.saturday.available {
    background-color: #e3f2fd !important;
}

.booking-calendar-day.sunday.available {
    background-color: #ffebee !important;
}

.booking-calendar-day.saturday.selected {
    background-color: #0073aa !important;
    color: white !important;
}

.booking-calendar-day.sunday.selected {
    background-color: #0073aa !important;
    color: white !important;
}

/* 予約が入っている日のスタイル（濃い赤枠） */
.booking-calendar-day.has-reservation {
    border: 3px solid #dc3545 !important; /* 濃い赤枠 */
    box-sizing: border-box;
}

.booking-calendar-day.has-reservation.selected {
    border: 3px solid #0073aa !important;
}

.booking-calendar-day.has-reservation.today {
    border: 3px solid #dc3545 !important;
}

/* 24時間休業日のスタイル（濃い赤背景、クリック不可） */
.booking-calendar-day.full-day-closed {
    background: #dc3545 !important; /* 濃い赤背景 */
    color: white !important;
    border: 2px solid #c82333 !important;
    cursor: not-allowed !important;
    opacity: 0.8;
}

.booking-calendar-day.full-day-closed.unavailable {
    background: #dc3545 !important; /* 濃い赤背景 */
    color: white !important;
    border: 2px solid #c82333 !important;
    cursor: not-allowed !important;
}

.booking-calendar-day.full-day-closed:hover {
    background: #c82333 !important;
    border-color: #bd2130 !important;
}

.booking-calendar-day.full-day-closed.today {
    border: 2px solid #c82333 !important;
}

.booking-calendar-day.full-day-closed.today.unavailable {
    border: 2px solid #c82333 !important;
    background: #dc3545 !important;
    color: white !important;
}

/* スマホ対応 */
@media (max-width: 768px) {
    #booking-date-calendar-container {
        flex-direction: column;
        gap: 15px;
    }
    
    #booking-date-calendar,
    #booking-date-calendar-current,
    #booking-date-calendar-next {
        max-width: 100%;
        min-width: 100%;
        padding: 10px;
    }
    
    .booking-calendar-day {
        font-size: 12px;
    }
    
    .booking-calendar-header {
        font-size: 16px;
    }
}

/* 時間帯選択ボタンのスタイル */
.booking-time-period-selection {
    margin-top: 15px;
}

.booking-time-periods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.booking-period-btn {
    padding: 8px 5px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    line-height: 1.3;
}

.booking-period-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.booking-period-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Box2 使用時間タイル */
.booking-duration-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.booking-duration-tile {
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer !important;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    min-width: 80px;
    transition: all 0.2s;
    background: white;
    pointer-events: auto !important;
    user-select: none;
}

.booking-duration-tile:hover {
    background: #f0f0f0;
    border-color: #007bff;
}

.booking-duration-tile.available {
    border-color: #28a745;
    color: #28a745;
}

.booking-duration-tile.available:hover {
    background: #d4edda;
    border-color: #218838;
}

.booking-duration-tile.moderate {
    border-color: #ffc107;
    color: #856404;
}

.booking-duration-tile.moderate:hover {
    background: #fff3cd;
    border-color: #e0a800;
}

.booking-duration-tile.low {
    border-color: #dc3545;
    color: #721c24;
}

.booking-duration-tile.low:hover {
    background: #f8d7da;
    border-color: #c82333;
}

.booking-duration-tile.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}

.booking-duration-tile.selected:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.booking-error {
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin: 20px 0;
}
