/**
 * フロントエンドCSS
 * ファイル: public/css/frontend-style.css
 */

/* 基本スタイル */
.wp-event-booking-single,
.wp-event-booking-list {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 800px;
    margin: 0 auto;
}

/* イベントヘッダー */
.event-header {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.event-image {
    flex-shrink: 0;
}

.event-image img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.event-info {
    flex: 1;
}

.event-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #333;
    font-weight: bold;
}

.event-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.event-meta span {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.age-range {
    background: #f3e5f5 !important;
    color: #7b1fa2 !important;
}

.location {
    background: #e8f5e8 !important;
    color: #2e7d32 !important;
}

.event-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.instructor {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* 予約セクション */
.booking-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.booking-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
    border-bottom: 2px solid #2196f3;
    padding-bottom: 8px;
}

/* フォームスタイル */
.booking-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.timeslot-selection select,
.customer-info input,
.customer-info select,
.customer-info textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.timeslot-selection select:focus,
.customer-info input:focus,
.customer-info select:focus,
.customer-info textarea:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.required {
    color: #f44336;
}

.customer-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.customer-info .form-row:first-child,
.customer-info .form-row:nth-child(2) {
    grid-column: span 1;
}

.customer-info .form-row:last-child {
    grid-column: span 2;
}

/* 予約ボタン */
.form-actions {
    text-align: center;
    margin-top: 20px;
}

.booking-submit-btn {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.booking-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);
}

.booking-submit-btn:active {
    transform: translateY(0);
}

.booking-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* メッセージ表示 */
.booking-message {
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    font-weight: 500;
}

.booking-message.success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.booking-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.booking-message.info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

/* 空き枠がない場合 */
.no-timeslots {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background: #f5f5f5;
    border-radius: 6px;
}

/* イベント一覧 */
.wp-event-booking-list .event-item {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e0e0e0;
}

.wp-event-booking-list .event-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ローディング状態 */
.booking-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.booking-submit-btn.loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }
    to {
        transform: rotate(1turn);
    }
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    .event-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .event-image {
        text-align: center;
    }
    
    .event-image img {
        max-width: 100%;
        width: 200px;
    }
    
    .event-meta {
        justify-content: center;
    }
    
    .customer-info {
        grid-template-columns: 1fr;
    }
    
    .customer-info .form-row {
        grid-column: span 1 !important;
    }
    
    .booking-submit-btn {
        width: 100%;
        padding: 15px 20px;
    }
}

@media screen and (max-width: 480px) {
    .wp-event-booking-single,
    .wp-event-booking-list {
        margin: 0 10px;
    }
    
    .event-header,
    .booking-section {
        padding: 15px;
    }
    
    .event-title {
        font-size: 20px;
    }
    
    .event-meta span {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* アニメーション */
.wp-event-booking-single,
.wp-event-booking-list {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.booking-message {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* フォーカス時のアニメーション */
.timeslot-selection select:focus,
.customer-info input:focus,
.customer-info select:focus,
.customer-info textarea:focus {
    animation: focusPulse 0.3s ease-out;
}

@keyframes focusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(33, 150, 243, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
    }
}