/* === CrossLink Learn Page Styles === */

.crosslink-learn-wrapper {
    display: flex;
    gap: 30px;
}

/* === Filter Sidebar === */
.crosslink-learn-filter {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.crosslink-filter-form h3 {
    margin: 0 0 20px;
    font-size: 1.2rem;
    border-bottom: 2px solid #0066cc;
    padding-bottom: 10px;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section h4 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: #555;
}

.filter-section input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-section select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.crosslink-filter-submit {
    width: 100%;
    padding: 12px;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.crosslink-filter-submit:hover {
    background: #0052a3;
}

/* === Taxonomy Tree === */
.taxonomy-tree {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
}

.taxonomy-tree label {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    line-height: 1.4;
}

.taxonomy-tree input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.tree-parent {
    margin-bottom: 8px;
}

.tree-parent > label {
    font-weight: 600;
}

.tree-children {
    list-style: none;
    margin: 5px 0 0 20px;
    padding: 0;
}

.tree-child {
    margin-bottom: 4px;
}

.tree-grandchildren {
    list-style: none;
    margin: 4px 0 0 20px;
    padding: 0;
}

.tree-grandchildren li {
    margin-bottom: 3px;
}

/* === Results === */
.crosslink-learn-results {
    flex: 1;
    min-width: 0;
}

.crosslink-learn-results h2 {
    margin: 0 0 20px;
    font-size: 1.3rem;
}

.result-count {
    font-size: 0.9rem;
    color: #666;
    font-weight: normal;
}

.result-group {
    margin-bottom: 30px;
}

.group-title {
    font-size: 1.1rem;
    margin: 0 0 15px;
    padding: 10px 15px;
    background: #f0f4f8;
    border-radius: 4px;
    border-left: 4px solid #0066cc;
}

.result-cards {
    display: grid;
    gap: 15px;
}

.result-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s, transform 0.2s;
}

.result-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.result-card a {
    display: block;
    padding: 20px;
    color: inherit;
    text-decoration: none;
}

.card-meta {
    display: inline-block;
    font-size: 0.8rem;
    color: #666;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 3px;
    margin-bottom: 8px;
}

.card-title {
    margin: 0 0 10px;
    font-size: 1rem;
    color: #0066cc;
}

.card-excerpt {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

.no-results {
    padding: 40px;
    text-align: center;
    color: #666;
    background: #fff;
    border-radius: 8px;
}

/* === Pagination === */
.crosslink-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.page-number:hover {
    background: #0066cc;
    border-color: #0066cc;
    color: #fff;
    text-decoration: none;
}

.page-number.current {
    background: #0066cc;
    border-color: #0066cc;
    color: #fff;
}

/* === Question Detail (single-question) === */
.single-question-page .question-detail {
    padding: 30px;
}

.question-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.question-meta {
    margin-bottom: 10px;
}

.question-meta .meta-item {
    display: inline-block;
    font-size: 0.85rem;
    color: #666;
    background: #f0f4f8;
    padding: 4px 12px;
    border-radius: 3px;
    margin-right: 8px;
}

.question-title {
    margin: 0 0 15px;
    font-size: 1.4rem;
}

.question-terms {
    font-size: 0.85rem;
}

.term-label {
    color: #666;
    margin-right: 5px;
}

.term-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    margin-right: 5px;
    font-size: 0.8rem;
}

.term-badge.profession {
    background: #e3f2fd;
    color: #1565c0;
}

.term-badge.subject {
    background: #f3e5f5;
    color: #7b1fa2;
}

.question-body,
.question-choices,
.question-explanation,
.question-source {
    margin-bottom: 30px;
}

.question-body h2,
.question-choices h2,
.question-explanation h2,
.question-source h2 {
    font-size: 1.1rem;
    margin: 0 0 15px;
    color: #333;
}

.question-text {
    background: #fafafa;
    padding: 20px;
    border-radius: 4px;
    line-height: 1.8;
}

.choices-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.choice-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.choice-item.correct {
    background: #e8f5e9;
    border-color: #a5d6a7;
}

.choice-label {
    font-weight: 700;
    color: #0066cc;
    flex-shrink: 0;
}

.choice-text {
    flex: 1;
}

.correct-badge {
    background: #4caf50;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 3px;
    flex-shrink: 0;
}

.explanation-text {
    background: #fff8e1;
    padding: 20px;
    border-radius: 4px;
    border-left: 4px solid #ffc107;
    line-height: 1.8;
}

.no-source {
    color: #999;
    font-style: italic;
}

.question-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.question-nav a {
    padding: 10px 20px;
    background: #f5f5f5;
    border-radius: 4px;
    font-weight: 500;
}

.question-nav a:hover {
    background: #e0e0e0;
    text-decoration: none;
}

/* === Responsive === */
@media (max-width: 900px) {
    .crosslink-learn-wrapper {
        flex-direction: column;
    }

    .crosslink-learn-filter {
        width: 100%;
        position: static;
    }

    .taxonomy-tree {
        max-height: 200px;
    }
}
