/**
 * 時間選択UI スタイル（プラグイン版）
 * STEP11-2: 既存テーマのスタイルを参考にプラグイン向けに移植
 */

/* 時間選択UI全体コンテナ */
#onebuild-time-select {
    max-width: 420px;
    margin: 0 auto;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 時間選択コンテナ */
.time-select-container {
    width: 100%;
}

/* ヘッダー部分 */
.time-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.time-header strong {
    font-size: 18px;
    color: #333;
}

.time-header .back-button {
    background: none;
    border: none;
    color: #0073aa;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
}

.time-header .back-button:hover {
    color: #005177;
}

/* ステータス凡例 */
.legend {
    font-size: 12px;
    margin-bottom: 16px;
    color: #666;
    text-align: center;
}

.legend span {
    margin-right: 16px;
}

/* 時間スロットグリッド */
.time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

/* 時間スロットボタン */
.time-slot {
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid #1c90f3;
    background-color: #fff;
    color: #1c90f3;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot:hover {
    background-color: #f0f8ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(28, 144, 243, 0.2);
}

.time-slot:active {
    transform: translateY(0);
}

/* 満席・利用不可の時間スロット */
.time-slot.closed,
.time-slot[disabled] {
    background-color: #f5f5f5;
    border-color: #ccc;
    color: #999;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.time-slot.closed:hover,
.time-slot[disabled]:hover {
    background-color: #f5f5f5;
    transform: none;
    box-shadow: none;
}

/* 追加の無効化スタイル */
.time-slot.closed,
.time-slot[disabled] {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* フッター戻るボタン */
.footer-back {
    text-align: center;
    margin-top: 20px;
}

.footer-back .back-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    color: #fff;
    background-color: #1c90f3;
    border: 1px solid #1c90f3;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.footer-back .back-button:hover {
    background-color: #1577cc;
    border-color: #1577cc;
    opacity: 0.9;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    #onebuild-time-select {
        margin: 0 10px;
        padding: 12px;
    }

    .time-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .time-header .back-button {
        margin-top: 4px;
    }

    .time-slots {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .time-slot {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 44px;
    }
}

/* 時間スロットアイコン調整 */
.time-slot::before {
    content: '';
    margin-right: 6px;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.time-select-container {
    animation: fadeIn 0.3s ease;
}

/* ローディング状態 */
#onebuild-time-select:empty::after {
    content: "読み込み中...";
    display: block;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* フォーカス状態 */
.time-slot:focus {
    outline: 2px solid #1c90f3;
    outline-offset: 2px;
}

.back-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}