/* exam/list.css */
.exam-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;
}

/* 메인 컨텐츠 영역 */
.exam-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;
}

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

/* 모의고사 카드 스타일 */
.exam-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;
    cursor: pointer;
}

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

.exam-card-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: background-color 0.2s;
}

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

.exam-info {
    flex: 1;
}

.exam-title {
    font-weight: 500;
    color: #1f2937;
    font-size: 16px;
    margin: 0 0 8px 0;
}

.exam-description {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.exam-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.exam-meta > span {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
}

.exam-meta .time-limit {
    color: #0891b2;
    background-color: #e0faff;
    border: 1px solid #bae6fd;
}

.exam-meta .question-count {
    color: #059669;
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.exam-meta .total-points {
    color: #ea580c;
    background-color: #ffedd5;
    border: 1px solid #fed7aa;
}

.exam-meta .category-path {
    color: #6366f1;
    background-color: #e0e7ff;
    border: 1px solid #c7d2fe;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exam-meta i {
    font-size: 14px;
}

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

.category-content {
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 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 {
    transform: translateX(5px);
    background: #dfdcff;
    transition: all 0.3s ease;
}

.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-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;
}

/* 데이터 없음 표시 */
.no-data {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

/* 토스트 메시지 */
.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;
}

/* 버튼 스타일 */
.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);
}

.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);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .exam-container {
        flex-direction: column;
    }

    .category-sidebar {
        width: 100%;
    }

    .content-header {
        flex-direction: column;
        gap: 16px;
    }

    .search-filters {
        width: 100%;
    }

    .form-control {
        width: 100%;
    }

    .exam-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .exam-meta > span {
        width: 100%;
    }
}

/* 모바일 최적화 */
@media (max-width: 480px) {
    .exam-container {
        padding: 16px;
    }

    .content-header {
        padding: 16px;
    }

    .exam-card-header {
        flex-direction: column;
        gap: 12px;
    }
}