/* 基本的なリセット */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: sans-serif;
}
.container {
    display: flex;
    height: 100vh;
}
.panel {
    flex: 1;
    padding: 10px;
    box-sizing: border-box;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
}

.panel:last-child {
    border-right: none; /* 最後のパネルの線は消す */
}

/* 左パネルのスタイル */
.left-panel {
    flex: 1; /* ★ 変更点: 比率を1に */
    background-color: #f4f4f4;
    overflow-y: auto; /* 内容が多ければスクロール */
}

/* 中央パネルの古いtextareaスタイルを削除し、新しい要素のスタイルを定義 */
.center-panel #line-input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-sizing: border-box;
    font-size: 16px;
    margin-bottom: 10px; /* 入力欄と表示エリアの間隔 */
    flex-shrink: 0; /* 縮まないように */
}

.center-panel .input-display-area {
    flex-grow: 1; /* 残りの高さをすべて使用 */
    border: 1px solid #eee;
    background-color: #fdfdfd;
    padding: 10px;
    overflow-y: auto; /* 内容が多くなったらスクロール */
}

.input-display-area div {
    margin: 0 0 0.5em 0; /* 各行の間隔 */
    border-bottom: 1px dashed #f0f0f0; /* 行間の区切り線 */
    padding-bottom: 0.5em;
    border-radius: 4px; /* 角を少し丸める */
}

/* ▼ 新しく追加 ▼ */
/* 編集可能な行のスタイル */
.editable-line {
    background-color: #fff8e1; /* 薄い黄色 */
    border: 1px dashed #ffc107; /* 黄色い破線 */
    outline: none; /* クリック時の枠線を消す */
}

/* 右パネルのスタイル */
.right-panel {
        flex: 1; 
    background-color: #f9f9f9;
    display: flex; /* flexboxコンテナにする */
    flex-direction: column; /* 縦積み */
}

/* 中央パネル内のテキストエリアのスタイル */
.center-panel textarea {
    width: 100%;
    height: 100%; /* パネル全体に広げる */
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-sizing: border-box;
    font-size: 16px;
    resize: none; /* サイズ変更を無効化 */
}

/* ▼ 変更: 中央パネルのタイトルに下マージンを追加 ▼ */
.center-panel h2 {
    margin-bottom: 10px;
}

/* === 進捗バー (追加) === */
.progress-container {
    width: 98%; /* パネルのpaddingを考慮 */
    margin: 5px auto 5px auto; /* 上下左右のマージン */
    background-color: #e0e0e0; /* 背景色 (未達成部分) */
    border-radius: 4px;
    height: 10px;
    overflow: hidden; /* 角丸のため */
}

.progress-bar-fill {
    height: 100%;
    width: 0%; /* 初期値は 0% */
    background-color: #4a90e2; /* 進行中の色 (青) */
    border-radius: 4px;
    /* アニメーション */
    transition: width 0.3s ease-out, background-color 0.3s ease;
}

.progress-text {
    width: 98%;
    margin: 5px auto 0 auto;
    text-align: right;
    font-size: 0.9em;
    color: #555;
}

/* ▼ 追加: 中央パネルの保存ボタンのスタイル ▼ */
#save-log-btn {
    padding: 5px 15px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #007bff;
    background-color: #e7f3ff;
    color: #007bff;
    border-radius: 5px;
}
#save-log-btn:hover {
    background-color: #d0e7ff;
}

h2 {
    margin-top: 0;
    margin-bottom: 0; /* 少しマージン調整 */
    flex-shrink: 0;
}
p {
    flex-shrink: 0;
    margin-top: 0; /* マージン調整 */
}


/* 左パネルのヘッダー部分 */
.panel-header {
    display: flex;
    justify-content: space-between; /* 両端に配置 */
    align-items: center; /* 上下中央揃え */
    flex-shrink: 0;
}

/* ▼追加▼ 注意事項のタイトルをクリック可能に見せる */
#notes-toggle {
    cursor: pointer;
    user-select: none; /* テキスト選択を無効化 */
}

/* ▼追加▼ notes-contentが.collapsedクラスを持つ場合に非表示にする */
#notes-content.collapsed {
    display: none;
}

/* 拡大・縮小ボタンのコンテナ */
.zoom-controls button {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    font-size: 18px;
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 5px;
}
.zoom-controls button:hover {
    background-color: #e9e9e9;
}

/* ▼ここから変更・追加▼ */

/* 読み込んだテキストの表示領域（旧#fileContent）*/
.file-content-area {
    flex-grow: 1;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    overflow-y: auto;
    font-size: 14px; /* 初期フォントサイズ */

    /* コピーペースト禁止のためのスタイル */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* 1行ごとのコンテナ */
.line {
    display: flex;
    min-height: 1.5em; /* 空行でも高さを確保 */
}

/* 行番号のスタイル */
.line-number {
    flex-shrink: 0; /* 縮まないように */
    width: 40px; /* 番号表示エリアの幅 */
    padding-right: 10px;
    text-align: right;
    color: #888;
    border-right: 1px solid #eee;
    margin-right: 10px;
}

/* 行のテキストコンテンツ */
.line-content {
    white-space: pre-wrap; /* 元のテキスト同様、空白や改行を維持 */
    word-break: break-all; /* 長い単語を折り返す */
}
/* ▲ここまで変更・追加▲ */


/* 全角スペースをハイライトするスタイル */
.full-width-space {
    background-color: #bde8fb;
    outline: 1px dotted #007bff;
}

/* 注意事項ページのコンテナ */
#warnings-container {
    font-family: sans-serif;
    background-color: #f4f4f9;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    margin: 0;
}
.warnings-inner-container {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 600px;
    width: 90%;
}
#warnings-container h1 {
    text-align: center;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-top: 0;
}
#warnings-container ul {
    padding-left: 20px;
    line-height: 1.8;
}
#warnings-container li {
    margin-bottom: 10px;
}
.button-container {
    text-align: center;
    margin-top: 30px;
}
#sound_check_btn{
    padding: 10px 15px;
    font-size: 15px;
    font-weight: bold;
}
.proceed-button {
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s;
}
.proceed-button:hover {
    background-color: #0056b3;
}

.iframe-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-shrink: 0; /* ボタンコンテナが縮まないように */
}

.iframe-controls button {
    width: 40px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    border-radius: 4px;
}
.iframe-controls button:hover {
    background-color: #eee;
}

.right-panel iframe {
    flex-grow: 1; /* 残りの高さをすべて使用 */
    border: none;
}

/* タイマー用iframe (ID指定) は、Unityの位置調整のため relative にする */
#timer-app-iframe {
    position: relative;
    overflow: hidden; /* はみ出したUnityを隠す */
}

/* チャット用iframe (ID指定) はシンプルに */
#chat-app-iframe {
    width: 100%;
    height: 100%;
}

/* ------------------------*/
/* ここからアンケートフォーム */
/* ------------------------ */

#survey-overlay {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

#survey-overlay h2 { border-bottom: 2px solid #ddd; padding-bottom: 10px; margin-bottom: 20px; }
p.survey_desc { font-size: 0.9em; color: #666; margin-top: -5px; margin-bottom: 15px; }

/* --- 共通: コンテナ制御 --- */
.survey_container { display: none; } /* 初期状態は非表示（JSで制御） */
.survey_container.survey_active { display: block; }

/* --- 共通: ボタン --- */
button.survey_action_btn {
    padding: 12px 30px;
    font-size: 16px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    margin-top: 20px;
    transition: background-color 0.3s;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
button.survey_action_btn:hover { background-color: #0056b3; }
button.survey_finish_btn { background-color: #28a745; }
button.survey_finish_btn:hover { background-color: #218838; }

#abort_btn{
    padding: 12px 30px;
    font-size: 16px;
    cursor: pointer;
    background-color: #0063ce;
    color: white;
    border: none;
    border-radius: 5px;
    margin-top: 20px;
    transition: background-color 0.3s;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
#abort_btn:hover{
    background-color: #0089b3;
}

/* --- NASA-TLX用スタイル --- */
.survey_scale_container {
    width: 100%; max-width: 600px;
    display: flex; justify-content: space-between; align-items: center;
    margin: 10px 0; position: relative;
}
.survey_radio_item {
    display: flex; flex-direction: column; align-items: center;
    cursor: pointer; position: relative; width: 20px;
}
.survey_tick_mark {
    width: 1px; height: 5px; background-color: #ccc; margin-bottom: 2px;
}
.survey_slider_wrapper {
    display: flex; align-items: center; gap: 15px; margin-bottom: 10px;
}
/* 元のCSSにあったクラスですがHTMLで使用されていない可能性があるため、
    comparison-areaにもflexスタイルを適用しておきます */
.survey_comparison_buttons, .survey_comparison_area {
    display: flex; gap: 30px; justify-content: center; margin-top: 20px;
}
.survey_choice_btn {
    padding: 15px 30px; font-size: 16px; cursor: pointer;
    border: 1px solid #ccc; background-color: #f0f0f0; border-radius: 5px;
}
.survey_choice_btn:hover { background-color: #e0e0e0; }

/* --- アンケート(リッカート尺度)用スタイル --- */
.survey_likert_explanation {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9em;
}

.survey_likert_item {
    margin-bottom: 25px;
    padding: 15px;
    border-bottom: 1px solid #eee;
}
.survey_likert_question {
    font-weight: bold;
    margin-bottom: 10px;
}

.survey_likert_scale_wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.survey_likert_option {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 12%;
    cursor: pointer;
}
.survey_likert_option input { margin-bottom: 5px; transform: scale(1.2); cursor: pointer; }
.survey_likert_option span { font-size: 0.8em; color: #666; }

.survey_scale_labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #555;
    max-width: 620px; /* scale-wrapperより少し広く */
    margin: 0 auto 5px auto;
    padding: 0 10px;
}

textarea { width: 100%; font-family: monospace; margin-top: 10px; padding: 10px; box-sizing: border-box;}
#survey_free_comment{
    resize: vertical;
}


/* IMI------------------------- */
 /* コンテナ (imi_ 接頭辞) */
#imi_container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#imi_title {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

#imi_description {
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

/* 質問ブロック */
.imi_question_block {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.imi_question_text {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* 選択肢エリア */
.imi_options_wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.imi_option_label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex: 1;
}

.imi_radio_input {
    margin-bottom: 5px;
    transform: scale(1.2);
    cursor: pointer;
}

.imi_scale_text {
    font-size: 0.8em;
    color: #777;
    text-align: center;
}

/* スケールの説明（両端） */
.imi_scale_legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #555;
    margin-bottom: 5px;
    font-weight: bold;
}

/* エラーメッセージ */
#imi_error_msg {
    color: #e74c3c;
    text-align: center;
    margin-top: 10px;
    display: none;
}
