/* 강의줍줍 - 유틸리티 클래스 */

/* 검색 가능 셀렉트 */
.ss-wrap { position: relative; }
.ss-dropdown {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: var(--bf-bg-card);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius);
    box-shadow: var(--bf-shadow-md);
    z-index: 50;
    margin-top: 2px;
}
.ss-item {
    padding: var(--bf-space-2) var(--bf-space-3);
    font-size: var(--bf-text-sm);
    cursor: pointer;
    border-bottom: 1px solid var(--bf-border-light);
    transition: background var(--bf-transition);
}
.ss-item:hover { background: var(--bf-bg-hover); }
.ss-item:last-child { border-bottom: none; }

/* 드래그앤드롭 */
.sortable-ghost {
    opacity: 0.4;
    background: var(--bf-primary-light) !important;
}

.sortable-chosen {
    background: var(--bf-bg-hover);
}

.sortable-drag {
    opacity: 0.9;
    box-shadow: var(--bf-shadow-lg);
}

.lesson-dropzone {
    transition: background 0.2s;
}

.lesson-row:hover {
    background: var(--bf-bg-hover);
}

/* 드래그앤드롭 파일 업로드 */
.file-drop {
    position: relative;
    border: 2px dashed var(--bf-border-input);
    border-radius: var(--bf-radius);
    padding: var(--bf-space-6) var(--bf-space-4);
    text-align: center;
    cursor: pointer;
    transition: all var(--bf-transition);
    background: var(--bf-bg-input);
}

.file-drop:hover {
    border-color: var(--bf-primary);
    background: var(--bf-primary-glow);
}

.file-drop.dragover {
    border-color: var(--bf-primary);
    background: var(--bf-primary-light);
    box-shadow: var(--bf-shadow-primary);
}

.file-drop.has-file {
    border-color: var(--bf-success);
    border-style: solid;
    background: var(--bf-success-light);
}

.file-drop input[type="file"] {
    display: none;
}

.file-drop-icon {
    color: var(--bf-text-muted);
    margin-bottom: var(--bf-space-2);
}

.file-drop.has-file .file-drop-icon {
    color: var(--bf-success);
}

.file-drop-text {
    font-size: var(--bf-text-sm);
    color: var(--bf-text-muted);
}

.file-drop-hint {
    font-size: var(--bf-text-xs);
    color: var(--bf-text-muted);
    margin-top: var(--bf-space-1);
}

.file-drop-name {
    font-size: var(--bf-text-sm);
    font-weight: 600;
    color: var(--bf-text);
    margin-top: var(--bf-space-1);
    word-break: break-all;
}

.file-drop-size {
    font-size: var(--bf-text-xs);
    color: var(--bf-text-muted);
}

/* Quill 에디터 */
.quill-editor {
    min-height: 120px;
    background: var(--bf-bg-input);
    border-radius: 0 0 var(--bf-radius) var(--bf-radius);
}

.quill-editor .ql-editor {
    min-height: 100px;
    font-family: var(--bf-font-family);
    font-size: var(--bf-text-sm);
    line-height: 1.7;
}

/* Quill 콘텐츠 렌더링 (사용자 쪽) */
.ql-content p { margin-bottom: 0.5em; }
.ql-content ul, .ql-content ol { padding-left: 1.5em; margin-bottom: 0.5em; }
.ql-content li { margin-bottom: 0.25em; }
.ql-content a { color: var(--bf-primary); text-decoration: underline; }
.ql-content pre.ql-syntax {
    background: var(--bf-bg-code);
    padding: var(--bf-space-3);
    border-radius: var(--bf-radius);
    font-family: var(--bf-font-mono);
    font-size: var(--bf-text-xs);
    overflow-x: auto;
}
.ql-content strong { font-weight: 600; }

/* 통계 카드 그리드 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--bf-space-4);
    margin-bottom: var(--bf-space-6);
}

.stat-card {
    padding: var(--bf-space-5);
}

.stat-label {
    color: var(--bf-text-muted);
    font-size: var(--bf-text-sm);
    margin-bottom: var(--bf-space-2);
}

.stat-value {
    font-size: var(--bf-text-2xl);
    font-weight: 700;
}

/* 강의 카드 그리드 */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--bf-space-4);
}

/* 페이지 상단 바 */
.page-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--bf-space-4);
    gap: var(--bf-space-3);
    flex-wrap: wrap;
}

/* 뱃지/태그 */
.badge {
    display: inline-block;
    font-size: var(--bf-text-xs);
    padding: 2px 8px;
    border-radius: var(--bf-radius-full);
}

.badge-success {
    background: var(--bf-success-light);
    color: var(--bf-success);
}

.badge-danger {
    background: var(--bf-danger-light);
    color: var(--bf-danger);
}

.badge-info {
    background: var(--bf-info-light);
    color: var(--bf-info);
}

.badge-primary {
    background: var(--bf-primary-light);
    color: var(--bf-primary);
}

.badge-muted {
    color: var(--bf-text-muted);
    font-size: var(--bf-text-xs);
}

/* 프로그래스 바 */
.progress-bar {
    height: 6px;
    background: var(--bf-bg-hover);
    border-radius: var(--bf-radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--bf-radius-full);
    background: var(--bf-primary);
    transition: width 0.3s;
}

.progress-bar-fill.complete {
    background: var(--bf-success);
}

/* 빈 상태 */
.empty-state {
    padding: var(--bf-space-12);
    text-align: center;
    color: var(--bf-text-muted);
}

.empty-state .empty-icon {
    color: var(--bf-text-muted);
    margin: 0 auto var(--bf-space-4);
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--bf-space-1);
    margin-top: var(--bf-space-4);
}

/* 뒤로가기 링크 */
.back-link {
    margin-bottom: var(--bf-space-4);
}

/* 토스트 컨테이너 */
.toast-container {
    position: fixed;
    top: var(--bf-space-4);
    right: var(--bf-space-4);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--bf-space-2);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--bf-space-3);
    padding: var(--bf-space-3) var(--bf-space-4);
    border-radius: var(--bf-radius);
    background: var(--bf-bg-card);
    border: 1px solid var(--bf-border);
    box-shadow: var(--bf-shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 400px;
    font-size: var(--bf-text-sm);
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

.toast-success { border-left: 3px solid var(--bf-success); }
.toast-error   { border-left: 3px solid var(--bf-danger); }
.toast-warning { border-left: 3px solid var(--bf-warning); }
.toast-info    { border-left: 3px solid var(--bf-info); }

.toast-icon { flex-shrink: 0; }
.toast-success .toast-icon { color: var(--bf-success); }
.toast-error .toast-icon   { color: var(--bf-danger); }
.toast-warning .toast-icon { color: var(--bf-warning); }
.toast-info .toast-icon    { color: var(--bf-info); }

.toast-message { flex: 1; }

.toast-close {
    background: none;
    border: none;
    color: var(--bf-text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}
