﻿/* ===== 基本設定 ===== */
html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

body {
    padding: 0;
    background-color: white !important;
    font-family: sans-serif;
    font-size: 19px;
    line-height: 150%;
}

@media screen and (max-width: 480px) {
    body {
        font-size: 16px;
    }
}

/* ===== リンク ===== */
a {
    color: blue !important;
    text-decoration: none;
}

a:hover {
    color: red;
}

a:visited {
    color: #9ABACC !important;
}

/* ===== 見出し ===== */
h1 {
    font-size: 150%;
}

@media only screen and (max-width: 600px) {
    h1 {
        font-size: 130% !important;
    }
}

h2,
h4 {
    font-size: 100%;
}

h4 {
    padding-top: 0.8em;
    padding-bottom: 0;
    line-height: 100%;
    margin: 0;
}

/* ===== ヘッダー ===== */
#header {
    background-color: #006DF0;
    color: white;
    text-align: center;
    padding: 0.1px;
    position: relative;
}

#header h1 {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
    position: relative;
}

#header img {
    width: 30px;
    height: 30px;
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}

/* ===== メイン ===== */
#main {
    flex: 1;
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px 5px;
}

/* ===== フッター ===== */
#footer {
    background-color: #006DF0;
    color: white;
    text-align: center;
    line-height: 100px;
}

/* ===== 戻るボタン ===== */
#fixed-panel {
    position: fixed;
    bottom: 110px;
    left: calc(100% - 110px);
    transform: translateX(0%);
    width: 100px;
    height: 50px !important;
    background-color: blue;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

#fixed-panel a {
    width: 55px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background-color: blue;
}

#returnButton img {
    width: 40px;
    height: 35px;
    background-color: blue;
}

@media (max-width: 480px) {
    #fixed-panel {
        bottom: 10px;
    }
}

@media (min-width: 1300px) {
    #fixed-panel {
        left: calc(50% + 525px);
    }
}

div#fixed-panel {
    display: none;
}

/* ===== 履歴一覧 ===== */
.history-list {
    margin: 0;
}

.history-item {
    padding: 5px 10px;
    padding-left: calc(10px + 1em);
    line-height: 1.3;
    overflow-wrap: anywhere;
    text-indent: -1em;
}
@media screen and (max-width: 499px) {
    .history-item {
    padding: 0;
    padding-left: calc(10px + 0.5em);
    }
}

.history-item a {
    color: #2980B9 !important;
}

.history-item a:hover {
    color: red !important;
}

.history-watch {
    width: 16px;
    height: 16px;
    padding-left: 15px;
}

.history-heading {
    padding: 3px 15px;
    margin: 5px 0 10px;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    font-size: 20px;
}

.history-type {
    font-weight: bold;
    color: black;
    margin-right: 10px;
}

.history-time {
    color: #0000ff;
}

/* ===== 得点 ===== */
.history-score a {
    display: block;
    color: #2980B9 !important;
    font-weight: bold;
}

.history-score a:visited {
    color: #2980B9 !important;
}

.history-score a:hover {
    color: blue !important;
}

/* ===== 理解度・コメント ===== */
.history-user-data {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    margin-left: 10px;
}

.history-level,
.history-comment {
    cursor: pointer;
    color: #333;
}

.history-level {
    font-weight: bold;
    color: red;
}

.history-comment {
    position: relative;
    margin: 0 24px;
    cursor: pointer;
    color: #333;
}

.history-comment span {
    text-decoration: underline;
    text-decoration-style: dotted;
}

.history-comment:hover::after {
    content: attr(data-full-comment);
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 1000;
    width: max-content;
    max-width: min(400px, 80vw);
    padding: 10px;
    background: #fff;
    color: #222;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.6;
}

/* ===== コメント ===== */
.comment {
    font-size: 15px;
    color: gray;
    text-align: right;
}

/* ===== エラー・成功表示 ===== */
.error {
    color: red;
}

.success-container {
    color: green;
    margin-top: 10px;
}

/* ===== アップロード・ダウンロードボタン ===== */
#uploadBtn,
#downloadBtn {
    padding: 6px 12px;
    margin: 5px;
    border-radius: 4px;
    border: 1px solid #333;
    background-color: #007bff;
    color: white;
    cursor: pointer;
}

#uploadBtn:hover,
#downloadBtn:hover {
    background-color: #0056b3;
}

/* ===== 削除ボタン ===== */
button.history-delete {
    border: 0;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    margin-left: 12px;
    padding: 1px 10px;
    transform: translateY(-2px);
}

/* ===== ポップアップ ===== */
.history-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    box-sizing: border-box;
}

.history-popup {
    background: #fff;
    color: #222;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.history-popup-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-popup-content p {
    display: none;
}

.history-popup-content button {
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    border-radius: 4px;
    border: 0;
    background-color: #007bff;
    color: white;
}

.history-popup-close {
    display: none;
}

/* ===== コメント編集 ===== */
.history-comment-full {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.history-comment-editor {
    width: 100%;
    min-height: 160px;
    box-sizing: border-box;
    padding: 10px;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
}