/* 医療接遇研修 予約システム - レスポンシブ・アクセシビリティ対応 CSS */
/* 国際おもてなし協会 - 竹下一雅様専用 */

/* アクセシビリティ改善 */
/* フォーカス表示の強化 */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* スキップリンク */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}

/* ハイコントラストモード対応 */
@media (prefers-contrast: high) {
    .gradient-bg {
        background: #000 !important;
    }
    
    .card-shadow {
        border: 2px solid #000 !important;
    }
    
    .selected-time {
        border: 3px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
    }
}

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --card-bg: #2d2d2d;
        --text-color: #ffffff;
        --border-color: #404040;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .bg-white {
        background-color: var(--card-bg) !important;
        color: var(--text-color) !important;
    }
    
    .bg-gray-50 {
        background-color: #2a2a2a !important;
        color: var(--text-color) !important;
    }
    
    .border-gray-300 {
        border-color: var(--border-color) !important;
    }
    
    .text-gray-800, .text-gray-700, .text-gray-600 {
        color: #e5e5e5 !important;
    }
}

/* タブレット対応 (768px - 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    /* 時間選択ボタンのサイズ調整 */
    .time-slot {
        font-size: 0.875rem;
        padding: 0.75rem 0.5rem;
    }
    
    /* 希望日時選択エリア */
    .preference-slot {
        padding: 1.5rem;
    }
    
    /* モーダルのサイズ調整 */
    .modal-content {
        padding: 2rem;
    }
}

/* スマートフォン対応 (320px - 767px) */
@media screen and (max-width: 767px) {
    /* ヘッダー調整 */
    .gradient-bg h1 {
        font-size: 1.5rem;
    }
    
    .gradient-bg p {
        font-size: 0.875rem;
    }
    
    /* コンテナー調整 */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* カード調整 */
    .card-shadow {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
        padding: 1rem;
    }
    
    /* フォーム要素の調整 */
    .grid.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .grid.lg\\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* ボタン調整 */
    button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .flex.justify-between button {
        width: auto;
        min-width: 120px;
    }
    
    /* 時間選択の調整 */
    .time-slots {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .time-slot {
        padding: 0.75rem;
        font-size: 0.875rem;
        text-align: center;
    }
    
    /* 希望日時エリアの調整 */
    .preference-slot {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* ステップインジケーター */
    .booking-step h3 {
        font-size: 1.125rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .booking-step h3 span {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    /* 管理画面テーブル */
    .info-table {
        font-size: 0.875rem;
    }
    
    .info-table th,
    .info-table td {
        padding: 0.5rem;
    }
    
    /* モーダル調整 */
    .modal-content {
        margin: 1rem;
        padding: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* 統計カード */
    .grid.grid-cols-1.md\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* ページネーション */
    .pagination {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
}

/* 極小スクリーン対応 (320px以下) */
@media screen and (max-width: 320px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .card-shadow {
        padding: 0.75rem;
    }
    
    .preference-slot {
        padding: 0.75rem;
    }
    
    .time-slot {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    /* 統計カードを1列に */
    .grid.grid-cols-1.md\\:grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* 大画面対応 (1200px以上) */
@media screen and (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    /* より大きなフォントサイズ */
    .gradient-bg h1 {
        font-size: 2.5rem;
    }
    
    .gradient-bg p {
        font-size: 1.25rem;
    }
    
    /* より広いスペーシング */
    .card-shadow {
        padding: 3rem;
    }
    
    .preference-slot {
        padding: 2rem;
    }
}

/* タッチデバイス対応 */
@media (hover: none) and (pointer: coarse) {
    /* タッチターゲットのサイズを44px以上に */
    .time-slot,
    button,
    input,
    select,
    textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* ホバー効果を無効化 */
    .time-slot:hover,
    button:hover {
        background-color: inherit;
        transform: none;
    }
    
    /* タップ時のフィードバック */
    .time-slot:active,
    button:active {
        transform: scale(0.98);
        background-color: #e5e7eb;
    }
}

/* 印刷対応 */
@media print {
    /* 不要な要素を非表示 */
    .gradient-bg,
    button,
    .hidden,
    nav,
    .modal,
    .action-btn {
        display: none !important;
    }
    
    /* 印刷用スタイル */
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .card-shadow {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    /* ページブレーク */
    .booking-step,
    .preference-slot {
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* スクリーンリーダー用のテキスト */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ローディングアニメーション */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* カスタムプロパティ */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --border-radius: 0.5rem;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* フォームの改善 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input:invalid {
    border-color: var(--error-color);
}

/* エラーメッセージ */
.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* 成功メッセージ */
.success-message {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}