/* Design tokens live in dsmetrix-theme.css */

body {
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.2rem;
    font-weight: 600;
}

h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

.section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* 基本統計テーブル */
.stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--border-color);
}

.stats-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.stats-table td:first-child {
    font-weight: 600;
    width: 30%;
    background-color: var(--dx-bg-warm, #f7f7f2);
}

.stats-table tr:last-child td {
    border-bottom: none;
}

.stats-table td:last-child {
    text-align: right;
    font-family: 'Monaco', monospace;
}

/* 合格率の色分け */
.stats-value.high-score {
    color: #27ae60;
    font-weight: bold;
}

.stats-value.medium-score {
    color: #f39c12;
    font-weight: bold;
}

.stats-value.low-score {
    color: #c0392b;
    font-weight: bold;
}

/* ホバーエフェクト */
.stats-table tr:hover td:last-child {
    background-color: var(--dx-bg-muted, #f0f0eb);
}


/* 難易度分析テーブルのスタイル */
.difficulty-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

.difficulty-table th,
.difficulty-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.difficulty-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    position: sticky;
    top: 0;
}

.difficulty-table tbody tr {
    transition: background-color 0.2s;
}

.difficulty-table tbody tr:nth-child(even) {
    background-color: var(--dx-bg-warm, #f7f7f2);
}

.difficulty-table tbody tr:hover {
    background-color: var(--dx-bg-muted, #f0f0eb);
}

/* 数値セルの右寄せと書式設定 */
.difficulty-table td:nth-child(n+4) {
    text-align: right;
    font-family: 'Monaco', monospace;
}

/* 正答率による色分け */
.difficulty-table td.high-score {
    color: #27ae60;
}

.difficulty-table td.medium-score {
    color: #f39c12;
}

.difficulty-table td.low-score {
    color: #c0392b;
}

/* スクロール可能なコンテナ */
.table-container {
    overflow-x: auto;
    margin: 1rem -2rem;
    padding: 0 2rem;
}


/* 問題別講評テーブル */
.comment-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
    background-color: white;
}

.comment-table th,
.comment-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comment-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    padding: 1.2rem 1rem;
}

.comment-table tbody tr:last-child td {
    border-bottom: none;
}

/* 列幅の設定 */
.comment-table .col-id {
    width: 60px;
    min-width: 50px;  
}

.comment-table .col-theory {
    width: 150px;
}

/* セルのスタイル */
.comment-table td.col-id {
    font-family: var(--dx-font-mono, monospace);
    font-weight: 600;
    background-color: var(--dx-bg-warm, #f7f7f2);
}

.comment-table td.col-theory {
    font-weight: 500;
    color: var(--primary-color);
}

.comment-table td.col-comment {
    line-height: 1.6;
    white-space: pre-line;
    color: var(--text-color);
}

/* ホバーエフェクト */
.comment-table tbody tr:hover {
    background-color: var(--dx-bg-muted, #f0f0eb);
}

.comment-table tbody tr:hover td.col-id {
    background-color: var(--dx-bg-warm, #f7f7f2);
}

/* スクロール可能なコンテナ */
.table-container {
    overflow-x: auto;
    margin: 1rem -2rem;
    padding: 0 2rem;
}



/* ランキングテーブル */

.ranking-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
}

.ranking-table th {
    background-color: var(--dx-text, #1a1a1a);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    border: 1px solid var(--dx-text, #1a1a1a);
}

.ranking-table thead tr {
    height: 50px;
}

.ranking-table th:first-child {
    border-top-left-radius: 10px;
}

.ranking-table th:last-child {
    border-top-right-radius: 10px;
}

.ranking-table tbody tr {
    border-bottom: 1px solid #e0e0e0; /* 行の間に薄い線を追加 */
}

.ranking-table tbody tr:hover {
    background-color: #f5f5f5; /* ホバー時の背景色 */
    cursor: pointer; /* カーソルをポインターに変更 */
}

.ranking-table td {
    padding: 10px;
    text-align: center;
}


/* グラフコンテナ */

.chart-container {
    width: 100%;
    height: 600px;  /* 400pxから600pxに変更 */
    margin: 2rem 0;  /* マージンも少し増やす */
}

/* 個人別講評テーブル */
.comment-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 各列の幅を調整 */
.comment-table th.col-rank,
.comment-table td.col-rank {
    width: 60px;
    min-width: 60px;
    text-align: center;
}

.comment-table th.col-name,
.comment-table td.col-name {
    width: 120px;
    min-width: 120px;
}

.comment-table th.col-score,
.comment-table td.col-score {
    width: 80px;
    min-width: 80px;
    text-align: right;
}

.comment-table th.col-judge,
.comment-table td.col-judge {
    width: 80px;
    min-width: 80px;
    text-align: center;
}

/* 講評列は残りのスペースを使用 */
.comment-table th.col-comment,
.comment-table td.col-comment {
    min-width: 300px;  /* 最小幅を設定 */
}

/* セルの共通スタイル */
.comment-table th,
.comment-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.comment-table td.comment-display {
    white-space: pre-wrap;  /* 改行を保持 */
    line-height: 1.5;
}





/* 講評編集画面用 */
.comment-edit {
    width: 100%;
    min-height: 100px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
}

.comment-table button {
    padding: 4px 8px;
    margin: 0 4px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
}

.comment-table button:hover {
    opacity: 0.9;
}

.comment-display {
    white-space: pre-wrap;
    min-height: 1.5em;
}


/* 管理画面リンク */
.admin-link {
    text-align: right;
    padding: 20px;
    opacity: 0.5;
}

.subtle-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9em;
}

.subtle-link:hover {
    text-decoration: underline;
}

/* 管理画面のスタイル */
.admin-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-header h1 {
    margin: 0;
}

.error-page {
    text-align: center;
    padding: 2rem;
}

.error-message {
    color: #e74c3c;
    margin: 2rem 0;
    padding: 1rem;
    background-color: #fdf2f2;
    border-radius: 8px;
}

.back-link {
    margin-top: 2rem;
}

.edit-question-comment {
    background-color: var(--dx-text, #1a1a1a);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.edit-question-comment:hover {
    background-color: #333333;
}

.col-edit {
    text-align: center;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--background-color);
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.error-message {
    color: #e74c3c;
    margin: 1rem 0;
    padding: 0.5rem;
    background-color: #fdf2f2;
    border-radius: 4px;
}

/* Nav styles → dsmetrix-theme.css */

.user-info {
    opacity: 0.8;
}

.home-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.menu-grid {
    display: grid;
    /* 3列のグリッドに固定 */
    grid-template-columns: repeat(3, 1fr);
    gap: 6rem;
    margin-top: 4rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;  /* 左右にパディングを追加 */
}



.menu-item {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.menu-item:hover {
    transform: translateY(-5px);
}

.menu-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: 100%;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 1rem;  /* カード間の垂直マージンを追加 */
}

/* カードのホバーエフェクトを改善 */
.menu-item:hover .menu-card {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* タイトル部分のスタイル調整 */
.menu-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

/* 説明文のスタイル調整 */
.menu-card p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #4a5568;
}

.menu-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.menu-item.disabled .menu-card {
    background: #f5f5f5;
}

/* Coming Soon用のスタイル */
.disabled .menu-card {
    background: #f8fafc;
}

.disabled .menu-card p {
    color: #a0aec0;
}

/* レスポンシブ対応 */

/* 画面サイズが小さい場合は2列に */
@media (max-width: 1024px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* さらに小さい画面では1列に */
@media (max-width: 640px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-grid {
        grid-template-columns: 1fr;  /* 小さい画面では1列に */
    }
    
    .menu-card {
        min-height: 200px;  /* モバイル表示時は高さを調整 */
    }
}