/* ===================================
   AI Travel Agent - 予約フォームスタイル
   =================================== */

/* リセット & 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* カラーパレット */
    --primary-color: #1a73e8;
    --primary-hover: #1557b0;
    --secondary-color: #f8f9fa;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-gray: #f1f3f4;
    --border-color: #dadce0;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.15);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* ベーススタイル */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #f5f7fa;
    min-height: 100vh;
}

/* コンテナ */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
header {
    background-color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    color: var(--primary-color);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

header h2 {
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 400;
}

/* 予約フォーム */
.booking-form {
    background-color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 0;
    overflow: hidden;
}

/* フォームセクション */
.form-section {
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.form-section h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background-color: var(--primary-color);
    margin-right: 12px;
    border-radius: 2px;
}

/* フライト情報表示 */
#flight-summary {
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.flight-route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.airport {
    text-align: center;
    flex: 1;
}

.airport-code {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.airport-time {
    font-size: 14px;
    color: var(--text-secondary);
    display: block;
    margin-top: 5px;
}

.flight-arrow {
    flex: 0 0 60px;
    text-align: center;
    font-size: 24px;
    color: var(--primary-color);
}

.flight-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.flight-detail {
    text-align: center;
}

.detail-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* フォームグループ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group label::after {
    content: '*';
    color: var(--danger-color);
    margin-left: 4px;
}

.form-group label[data-optional]::after {
    content: '';
}

/* フォーム入力フィールド */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: white;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

input[readonly] {
    background-color: var(--light-gray);
    cursor: not-allowed;
}

/* セレクトボックスの矢印 */
select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2714%27%20height%3D%278%27%20viewBox%3D%270%200%2014%208%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1%201l6%206%206-6%27%20stroke%3D%27%23333%27%20stroke-width%3D%272%27%20fill%3D%27none%27%20fill-rule%3D%27evenodd%27/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* 乗客エントリー */
.passenger-entry {
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.passenger-entry h4 {
    color: var(--primary-color);
    font-size: 16px;
    margin-bottom: 15px;
}

/* グリッドレイアウト */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* テスト環境通知 */
.test-notice {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.test-notice::before {
    content: '⚠️';
    font-size: 20px;
    margin-right: 10px;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--light-gray);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #218838;
    box-shadow: var(--shadow-md);
}

/* フォームアクション */
.form-actions {
    padding: 30px;
    background-color: var(--light-gray);
    text-align: center;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    padding: 20px 30px;
    background-color: var(--primary-color);
    color: white;
    font-size: 20px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

#booking-summary {
    padding: 30px;
}

.summary-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.summary-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.summary-section h4 {
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.summary-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.summary-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.modal-actions {
    padding: 20px 30px;
    background-color: var(--light-gray);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-actions button {
    flex: 1;
}

/* エラーメッセージ */
.error-message {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.form-group.error input,
.form-group.error select {
    border-color: var(--danger-color);
}

.form-group.error .error-message {
    display: block;
}

/* ローディング */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* 成功/エラー通知 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    animation: notificationSlideIn 0.3s ease;
    z-index: 2000;
    max-width: 400px;
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.notification.success {
    background-color: var(--success-color);
    color: white;
}

.notification.error {
    background-color: var(--danger-color);
    color: white;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 24px;
    }

    header h2 {
        font-size: 16px;
    }

    .form-section {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .flight-route {
        flex-direction: column;
    }

    .flight-arrow {
        transform: rotate(90deg);
        margin: 10px 0;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}

/* プリントスタイル */
@media print {
    body {
        background-color: white;
    }

    .container {
        max-width: 100%;
    }

    .btn,
    .form-actions,
    .modal {
        display: none !important;
    }

    .form-section {
        page-break-inside: avoid;
    }
}

/* アクセシビリティ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* フォーカス表示 */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* アニメーション無効化（設定による） */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}