/**
 * Flatpickr（日付選択）のカスタムスタイル
 */

/* カレンダーの基本スタイル */
.flatpickr-calendar {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    max-width: 307px;
    padding: 8px;
    position: absolute;
    z-index: 1000;
}

/* カレンダーヘッダー */
.flatpickr-months {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.flatpickr-month {
    color: #333;
    font-weight: 600;
    text-align: center;
    flex: 1;
}

/* 月の切り替えボタン */
.flatpickr-prev-month,
.flatpickr-next-month {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    background-color: #f5f5f5;
    color: #333;
}

/* 曜日ヘッダー */
.flatpickr-weekdays {
    display: flex;
    margin-bottom: 4px;
}

.flatpickr-weekday {
    color: #666;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    flex: 1;
    padding: 4px 0;
}

/* 日付グリッド */
.flatpickr-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

/* 日付セル */
.flatpickr-day {
    background: none;
    border: none;
    border-radius: 4px;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    transition: all 0.2s ease;
    width: 100%;
}

/* 日付ホバー効果 */
.flatpickr-day:hover {
    background-color: #f0f8ff;
    color: #0066cc;
}

/* 今日の日付 */
.flatpickr-day.today {
    background-color: #e6f3ff;
    color: #0066cc;
    font-weight: 600;
}

/* 選択された日付 */
.flatpickr-day.selected {
    background-color: #0066cc;
    color: #fff;
    font-weight: 600;
}

/* 無効な日付（過去の日付など） */
.flatpickr-day.disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #ccc;
    cursor: not-allowed;
}

.flatpickr-day.disabled:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: none;
    color: #ccc;
}

/* 入力フィールドのスタイル */
input[name="visit-date"] {
    cursor: pointer;
    background-color: #fff;
}

input[name="visit-date"]:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

/* カレンダーが開いている時の入力フィールド */
input[name="visit-date"].flatpickr-input {
    background-color: #fff;
}

/* 休館日のスタイル */
.flatpickr-day.closed-day {
    background-color: #f8f8f8;
    color: #ccc;
    cursor: not-allowed;
    position: relative;
}

.flatpickr-day.closed-day::after {
    content: '休';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    color: #999;
    background-color: #f0f0f0;
    border-radius: 2px;
    padding: 1px 2px;
    line-height: 1;
}

.flatpickr-day.closed-day:hover {
    background-color: #f8f8f8;
    color: #ccc;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .flatpickr-calendar {
        max-width: 280px;
        font-size: 13px;
    }
    
    .flatpickr-day {
        height: 28px;
        line-height: 28px;
        font-size: 13px;
    }
    
    .flatpickr-day.closed-day::after {
        font-size: 7px;
        top: 1px;
        right: 1px;
        padding: 0 1px;
    }
}
