/**
 * フロントエンド用CSS
 */

/* 基本スタイル */
.my-booking-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* フォームセクション */
.my-booking-form-section {
    margin-bottom: 30px;
    padding: 20px;
}

/* お客様情報セクション */
.customer-info-section {
    margin-top: 40px;
    margin-bottom: 30px;
    padding: 30px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.customer-info-section h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 1.3em;
    font-weight: 600;
    border-bottom: 2px solid #28a745;
    padding-bottom: 12px;
}

.my-booking-form-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2em;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* フォーム行 */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

/* フォーム要素 */
.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 8px rgba(0, 115, 170, 0.3);
    transform: translateY(-1px);
}

.form-group input:disabled,
.form-group select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

/* カレンダー */
.my-booking-calendar {
    margin-bottom: 30px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px 0;
}

.calendar-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
}

.calendar-nav {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.calendar-nav:hover {
    background: #005a87;
}

.calendar-grid {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.weekday {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    border-right: 1px solid #ddd;
}

.weekday:last-child {
    border-right: none;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    position: relative;
    padding: 15px 8px;
    text-align: center;
    cursor: pointer;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover:not(.past):not(.other-month):not(.holiday) {
    background-color: #f0f8ff;
    transform: scale(1.05);
}

.calendar-day.other-month {
    color: #ccc;
    background-color: #fafafa;
    cursor: not-allowed;
}

.calendar-day.past {
    color: #ccc;
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.calendar-day.today {
    background-color: #e3f2fd;
    font-weight: bold;
}

.calendar-day.selected {
    background-color: #ffeb3b;
    color: #333;
    font-weight: bold;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(255, 235, 59, 0.4);
}

.calendar-day.holiday {
    background-color: #ffebee;
    cursor: not-allowed;
}

.day-number {
    font-size: 16px;
    font-weight: 500;
}

.holiday-label {
    background: #f44336;
    color: white;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 50%;
    font-weight: bold;
    line-height: 1;
    white-space: nowrap;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 利用可能な時間枠 */
.available-times {
    margin-top: 30px;
    margin-bottom: 40px;
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.available-times h4 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.time-slot {
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 6px;
    color: #0073aa;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.time-slot:hover {
    background: #0073aa;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

.time-slot.selected {
    background: #0073aa;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.4);
}

.loading-message,
.no-slots,
.error-message {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.error-message {
    color: #e74c3c;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .my-booking-form-container {
        padding: 15px;
    }
    
    .my-booking-form-section {
        padding: 15px;
    }
    
    .calendar-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
    
    .calendar-header h3 {
        font-size: 1.1em;
        flex: 1;
        text-align: center;
        order: 2;
    }
    
    .calendar-nav:first-child {
        order: 1;
    }
    
    .calendar-nav:last-child {
        order: 3;
    }
    
    .calendar-day {
        padding: 10px 4px;
        min-height: 50px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .holiday-label {
        font-size: 8px;
        padding: 1px 3px;
    }
    
    .time-slots {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .time-slot {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .available-times {
        margin-top: 25px;
        margin-bottom: 30px;
        padding: 20px;
    }
    
    .customer-info-section {
        margin-top: 30px;
        margin-bottom: 25px;
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
}

/* 送信ボタン */
.my-booking-submit-btn {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 6px rgba(0, 115, 170, 0.3);
}

.my-booking-submit-btn:hover {
    background: linear-gradient(135deg, #005a87 0%, #004466 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 115, 170, 0.4);
}

.my-booking-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
}

.my-booking-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* メッセージ */
.my-booking-message {
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.my-booking-message.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
    box-shadow: 0 2px 4px rgba(21, 87, 36, 0.1);
}

.my-booking-message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
    box-shadow: 0 2px 4px rgba(114, 28, 36, 0.1);
}

.my-booking-message.loading {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 1px solid #bee5eb;
    box-shadow: 0 2px 4px rgba(12, 84, 96, 0.1);
}

/* エラー状態 */
.form-group input.error,
.form-group select.error {
    border-color: #e74c3c;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.3);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* フォーカス状態 */
.form-group.focused label {
    color: #0073aa;
    font-weight: 700;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* スタイルバリエーション */
.my-booking-style-modern .my-booking-form-section {
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.my-booking-style-modern .my-booking-form-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2em;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.my-booking-style-minimal .my-booking-form-section {
    background: transparent;
    border: none;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    padding: 15px 0;
    box-shadow: none;
}

.my-booking-style-minimal .my-booking-form-section:last-child {
    border-bottom: none;
}

.my-booking-style-minimal .my-booking-form-section h3 {
    border-bottom: 1px solid #0073aa;
    padding-bottom: 5px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .my-booking-form-container {
        padding: 15px;
        margin: 0 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .my-booking-form-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .form-group input,
    .form-group select {
        font-size: 16px; /* iOSでズームを防ぐ */
        padding: 14px;
    }
    
    .my-booking-submit-btn {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .my-booking-message {
        padding: 12px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .my-booking-form-container {
        padding: 10px;
        margin: 0 5px;
    }
    
    .my-booking-form-section {
        padding: 12px;
    }
    
    .my-booking-form-section h3 {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
    
    .calendar-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    
    .calendar-header h3 {
        font-size: 1.0em;
        flex: 1;
        text-align: center;
        order: 2;
    }
    
    .calendar-nav:first-child {
        order: 1;
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .calendar-nav:last-child {
        order: 3;
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px;
        font-size: 16px;
    }
}

/* アクセシビリティ対応 */
@media (prefers-reduced-motion: reduce) {
    .form-group input,
    .form-group select,
    .my-booking-submit-btn,
    .my-booking-message,
    .form-group.focused label {
        transition: none;
        animation: none;
    }
}

/* ハイコントラストモード対応 */
@media (prefers-contrast: high) {
    .my-booking-form-section {
        border: 2px solid #000;
        background-color: #fff;
    }
    
    .form-group input,
    .form-group select {
        border: 2px solid #000;
    }
    
    .my-booking-submit-btn {
        border: 2px solid #000;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .my-booking-form-container {
        background-color: #1a1a1a;
        color: #fff;
    }
    
    .my-booking-form-section {
        background-color: #2d2d2d;
        border-color: #444;
    }
    
    .form-group input,
    .form-group select {
        background-color: #333;
        border-color: #555;
        color: #fff;
    }
    
    .form-group input:focus,
    .form-group select:focus {
        border-color: #0073aa;
        background-color: #444;
    }
    
    .form-group label {
        color: #fff;
    }
    
    .my-booking-message.success {
        background-color: #1e4d2b;
        color: #d4edda;
        border-color: #155724;
    }
    
    .my-booking-message.error {
        background-color: #4d1e1e;
        color: #f8d7da;
        border-color: #721c24;
    }
    
    .my-booking-message.loading {
        background-color: #1e4d4d;
        color: #d1ecf1;
        border-color: #0c5460;
    }
}

/* 印刷対応 */
@media print {
    .my-booking-form-container {
        max-width: none;
        padding: 0;
    }
    
    .my-booking-form-section {
        border: 1px solid #000;
        background-color: #fff;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .my-booking-submit-btn {
        display: none;
    }
    
    .my-booking-message {
        border: 1px solid #000;
        background-color: #fff;
        color: #000;
    }
}
