/* Quiz Scores Viewer Styles */

.quiz-scores-container {
    max-width: 1000px; /* 幅を拡張 */
    min-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.quiz-scores-container h2 {
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.no-scores {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.quiz-scores-error {
    color: #d63638;
    background: #fcf0f1;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

/* フィルタリング機能 */
.quiz-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.filter-group label {
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
    font-size: 14px;
}

.filter-group input[type="text"],
.filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.filter-group input[type="text"]:focus,
.filter-group input[type="date"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.date-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-separator {
    color: #666;
    font-weight: bold;
}

.clear-filters-btn {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.clear-filters-btn:hover {
    background: #5a6268;
}

/* Quiz Scores List */
.quiz-scores-list {
    space-y: 15px;
}

.quiz-score-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.quiz-score-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.quiz-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.quiz-score-header:hover {
    background: #e9ecef;
}

.quiz-info h3.quiz-title {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
    font-weight: bold;
}

.quiz-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.quiz-meta span {
    color: #666;
    font-size: 14px;
    padding: 2px 8px;
    background: #e9ecef;
    border-radius: 3px;
}

.quiz-score {
    font-weight: bold;
    color: #0073aa;
}

.quiz-accuracy {
    font-weight: bold;
    color: #28a745;
}

.expand-icon {
    flex-shrink: 0;
}

.arrow {
    display: inline-block;
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.arrow.expanded {
    transform: rotate(180deg);
}

/* Quiz Details */
.quiz-details {
    border-top: 1px solid #ddd;
    background: #fff;
}

.quiz-detail-container {
    padding: 20px;
}

.quiz-summary-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.summary-item {
    color: #555;
    font-size: 14px;
}

.summary-item strong {
    color: #333;
}

/* Questions Table */
.questions-table-container {
    overflow-x: auto;
}

.questions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    table-layout: fixed; /* テーブル幅を固定 */
}

.questions-table th {
    background: #0073aa;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
}

.questions-table th.result-col {
    width: 8%;
    text-align: center;
}

.questions-table th.question-col {
    width: 35%;
}

.questions-table th.answer-col {
    width: 25%;
}

.questions-table th.explanation-col {
    width: 32%;
}

.questions-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
    word-wrap: break-word;
}

.question-row.correct-row {
    background: #f8fff8;
}

.question-row.incorrect-row {
    background: #fff8f8;
}

.result-cell {
    text-align: center;
}

.result-icon {
    font-size: 24px;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.result-icon.success {
    color: #28a745;
}

.result-icon.failure {
    color: #dc3545;
}

.result-text {
    font-size: 12px;
    font-weight: bold;
}

.result-text.success {
    color: #28a745;
}

.result-text.failure {
    color: #dc3545;
}

.question-number {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

.question-title-small {
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
    font-size: 13px;
}

.question-text-small {
    color: #444;
    font-size: 13px;
    line-height: 1.4;
}

.question-text-small p {
    margin: 0 0 8px 0;
}

.question-image-small {
    margin-top: 8px;
}

/* 回答セクション（縦並び） */
.answer-cell {
    font-size: 13px;
    line-height: 1.4;
}

.user-answer-section,
.correct-answer-section {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 4px;
}

.user-answer-section {
    background: #f8f9fa;
    border-left: 3px solid #6c757d;
}

.correct-answer-section {
    background: #e8f5e8;
    border-left: 3px solid #28a745;
}

.answer-label {
    font-weight: bold;
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
}

.answer-content {
    color: #333;
    font-size: 13px;
}

/* 解説セクション */
.explanation-cell {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

.explanation-content {
    padding: 8px;
    background: #fff9e6;
    border-radius: 4px;
    border-left: 3px solid #ffc107;
}

.no-explanation {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.no-questions {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    margin: 20px 0;
}

/* アニメーション */
.quiz-detail-container {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .quiz-scores-container {
        max-width: 85%;
        min-width: 85%;
        margin: 10px;
        padding: 15px;
    }
    
    .questions-table th.question-col {
        width: 30%;
    }
    
    .questions-table th.answer-col {
        width: 30%;
    }
    
    .questions-table th.explanation-col {
        width: 32%;
    }
}

@media (max-width: 768px) {
    .quiz-filters {
        min-width: 85%;
        max-width: 85%;
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .date-filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .quiz-score-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .expand-icon {
        align-self: flex-end;
        margin-top: -25px;
    }
    
    .quiz-meta {
        gap: 10px;
    }
    
    .quiz-summary-info {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .questions-table {
        font-size: 11px;
        table-layout: auto;
    }
    
    .questions-table th,
    .questions-table td {
        padding: 6px 4px;
    }
    
    .questions-table th.result-col {
        width: 10%;
    }
    
    .questions-table th.question-col {
        width: 35%;
    }
    
    .questions-table th.answer-col {
        width: 30%;
    }
    
    .questions-table th.explanation-col {
        width: 25%;
    }
}