/* list.css */
.question-container {
    display: flex;
    gap: 24px;
    min-height: calc(100vh - 78px);
    padding: 24px;
    background-color: #f8f9fa;
}

/* 카테고리 사이드바 */
.category-sidebar {
    width: 300px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.sidebar-header h3 {
    color: #1f2937;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* 메인 컨텐츠 영역 */
.question-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 검색 및 필터 영역 */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-filters {
    display: flex;
    gap: 12px;
}

.search-input, .form-control {
    width: 300px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #1f2937;
    transition: all 0.2s;
}

#searchInput {
    width: 300px;
}

#typeFilter, #difficultyFilter {
    width: 120px;
}

#typeFilter option, #difficultyFilter option {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-input:focus, .form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #1f2937;
    min-width: 120px;
    transition: all 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* 문제 카드 스타일 */
.question-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.question-card-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
}

.question-card-header:hover {
    background: #f8fafc;
}

.question-title {
    font-weight: 500;
    color: #1f2937;
}

.question-meta {
    display: flex;
    gap: 16px;
    color: #6b7280;
    font-size: 14px;
    align-items: center;
}

.question-meta > span {
    padding: 4px 12px;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.question-meta .category-path {
    color: #6366f1;
    background-color: #e0e7ff;
    border: 1px solid #c7d2fe;
    max-width: 300px;
}

.question-meta .question-type {
    color: #0891b2;
    background-color: #e0faff;
    border: 1px solid #bae6fd;
}

.question-meta .question-difficulty {
    color: #ea580c;
    background-color: #ffedd5;
    border: 1px solid #fed7aa;
}


.question-meta .question-difficulty:hover {
    background-color: #fed7aa;
    transition: background-color 0.2s ease;
}

/* 문제 상세 영역 */
.question-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.question-detail.expanded {
    max-height: 2000px;
}

.detail-content {
    padding: 20px;
}

/* 문제 내용 */
.question-content {
    font-size: 16px;
    line-height: 1.6;
    color: #1f2937;
    margin-bottom: 24px;
}

/* 객관식 문제 스타일 */
.multiple-choice-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.choice-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    transition: background-color 0.2s;
}

.choice-item:hover {
    background: #f3f4f6;
}

.choice-item input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 주관식/서술형 문제 스타일 */
.text-answer-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin: 20px 0;
    background: #f9fafb;
}

.text-answer-input.short {
    height: 42px;
}

.text-answer-input.long {
    height: 120px;
    resize: vertical;
}

/* 정답 확인 버튼 */
.check-answer-btn {
    background: #6366f1;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.check-answer-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

/* 정답 결과 영역 */
.answer-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    display: none;
}

.answer-result.correct {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.answer-result.incorrect {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* 해설 영역 */
.explanation {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: none;
}

.explanation.visible {
    display: block;
}

/* 버튼 스타일 */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: #6366f1;
    color: white;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

/* 카테고리 트리 */
.category-item {
    list-style: none;
    margin: 4px 0;
}

.category-content {
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
}

.category-toggle {
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 8px 0;
    list-style: none;
}

.category-item:first-child .category-content {
    color: #4f46e5;
    font-weight: 500;
}

.category-toggle.rotated {
    transform: rotate(90deg);
}

.category-name {
    color: #1f2937;
    font-size: 14px;
}

.category-content:hover {
    background: #f8fafc;
}

.category-content.selected {
    background: #e0e7ff;
    color: #4f46e5;
}

.category-children {
    margin-left: 20px;
    border-left: 1px solid #e5e7eb;
    padding-left: 12px;
    overflow: hidden;
    transition: height 0.3s ease-in-out;
    will-change: height;
}

.category-content:hover {
    transform: translateX(5px);
    background: #dfdcff;
    transition: all 0.3s ease;
}

.category-toggle:hover {
    transform: scale(1.2);
    color: #4f46e5;
    filter: drop-shadow(0 0 2px rgba(79, 70, 229, 0.3));
}

.category-children.collapsed {
    display: none;
}

/* 아이콘 스타일 */
.category-content i.fa-folder {
    color: #6366f1;
    font-size: 14px;
    width: 12px;  /* 고정 너비 */
}

.category-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 토스트 메시지 */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-left: 4px solid #059669;
}

.toast.error {
    border-left: 4px solid #dc2626;
}
.header-actions {
    display: flex;
    gap: 12px;
}

.btn-secondary {
    background: #4b5563;
    color: white;
}

.btn-secondary:hover {
    background: #374151;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(75, 85, 99, 0.2);
}