/* ─── 디자인 시스템 & 변수 선언 ────────────────────────────────────── */
:root {
    --bg-primary: #f8fafc;
    --bg-sidebar: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --border-color: #e2e8f0;
    --font-sans: 'Outfit', 'Noto Sans KR', sans-serif;
    --header-height: 64px;
    --sidebar-width: 290px;
    --base-font-size: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* ─── 기본 스타일 초기화 ─────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-size: var(--base-font-size);
    line-height: 1.6;
    overflow: hidden;
}

/* ─── 스크롤바 커스텀 ────────────────────────────────────────────── */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ─── 상단 내비게이션 바 (Top Bar - maumastro 스타일) ─────────────────── */
.top-nav {
    height: 52px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    position: sticky;
    top: 0;
    z-index: 200;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    font-size: 1.5rem;
    animation: rotateGlobe 12s linear infinite;
}

@keyframes rotateGlobe {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-highlight {
    color: #a5b4fc;
}

/* maumastro 상단 서적 드롭다운 */
.wiki-dropdown-container {
    position: relative;
    display: inline-block;
}

.tab-btn {
    padding: 0.4rem 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.tab-btn.active {
    background: rgba(255,255,255,0.25);
    color: #fff;
    box-shadow: inset 0 -2px 0 #a5b4fc;
}

.wiki-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    z-index: 300;
    overflow: hidden;
}

.wiki-dropdown-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.4rem 0;
}

.wiki-dropdown-item {
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s;
    font-weight: 500;
}

.wiki-dropdown-item:hover {
    background: #eef2ff;
    color: #4f46e5;
}

.wiki-dropdown-admin {
    border-top: 1px solid #e2e8f0;
    padding: 0.4rem;
    background: #f8fafc;
}

.btn-add-category-dropdown {
    width: 100%;
    padding: 0.4rem;
    background: #e0e7ff;
    color: #4338ca;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-add-category-dropdown:hover {
    background: #c7d2fe;
}

/* ─── 반응형 미디어 쿼리 (maumastro 동기화) ──────────────── */
@media (max-width: 900px) {
    html, body {
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100vh;
    }

    .top-nav {
        padding: 0 0.75rem;
    }

    .logo-title {
        font-size: 0.95rem;
    }

    /* 1. 전체 레이아웃을 상하 1단 구조로 변경 (가로 스크롤 제거, 세로 스크롤 허용) */
    .split-layout {
        flex-direction: column;
        overflow: visible !important;
        height: auto !important;
        min-height: calc(100vh - 52px);
    }

    /* 2. 사이드바 (상단 Sticky 아코디언) */
    .sidebar {
        width: 100%;
        min-width: unset;
        max-width: none;
        height: auto;
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
        position: sticky;
        top: 52px; /* 상단 top-nav 높이 */
        z-index: 110;
        background-color: #f8fafc;
    }

    .sidebar-header {
        position: relative;
        cursor: pointer;
        padding: 0.75rem 1rem;
        user-select: none;
        background-color: #f8fafc;
    }

    .sidebar-title {
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.95rem;
        padding: 0.2rem 0;
    }

    .sidebar-title::after {
        content: '▼';
        font-size: 0.8rem;
        color: #94a3b8;
        transition: transform 0.3s ease;
        transform: rotate(180deg);
        margin-left: 0.3rem;
    }

    .sidebar.mobile-collapsed .sidebar-title::after {
        transform: rotate(0deg);
    }

    /* mobile-collapsed 상태일 때 카테고리 트리 부드럽게 숨기기 */
    .sidebar .category-tree {
        max-height: 350px !important;
        overflow-y: auto !important;
        transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s;
        opacity: 1;
    }

    .sidebar.mobile-collapsed .category-tree {
        max-height: 0 !important;
        height: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        overflow: hidden !important;
        opacity: 0;
        border: none !important;
    }

    /* 드롭다운이 화면 밖(우측)으로 삐져나가 여백을 만들지 않도록 모바일 최적화 */
    .wiki-dropdown-menu {
        left: auto !important;
        right: 0 !important;
        min-width: 200px;
    }

    /* 3. 메인 본문 독서 패널 */
    .reading-workspace {
        width: 100%;
        padding: 1.25rem 1rem 3rem 1rem;
        height: auto !important;
        min-height: unset;
        overflow: visible !important;
    }

    .doc-header h1 {
        font-size: 1.45rem;
        line-height: 1.35;
    }

    .doc-body {
        margin-top: 1rem;
        font-size: 1rem;
        line-height: 1.75;
    }

    .doc-body img,
    .doc-body video,
    .doc-body iframe {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 8px;
    }

    .doc-body table {
        display: block;
        width: 100% !important;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* 이전 글/다음 글 모바일 세로 배치 카드 */
    .doc-nav {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 2rem;
    }

    .doc-nav button {
        width: 100%;
        text-align: left;
    }

    /* 4. 모달 모바일 최적화 */
    .modal-card {
        width: 95% !important;
        max-height: 90vh !important;
        padding: 1.25rem !important;
    }
}


/* ─── 메인 분할 레이아웃 (Split Layout) ────────────────────────────── */
.split-layout {
    display: flex;
    height: calc(100vh - 52px);
    overflow: hidden;
    position: relative;
}

/* ─── 좌측 사이드바 (Sidebar) ────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
}

.sidebar-header {
    background-color: #f1f5f9;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-sidebar-action {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sidebar-action:hover {
    background-color: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}

.category-tree {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.5rem;
}

.loading-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 2rem 0;
}

/* ─── 트리 리스트 요소 스타일 ──────────────────────────────────────── */
.tree-node {
    margin-bottom: 2px;
}

.node-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.node-item:hover {
    background-color: #f1f5f9;
}

.node-item.active {
    background-color: #e0e7ff;
    color: #4f46e5;
    font-weight: 600;
}

.node-content {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    white-space: normal;
    word-break: break-all;
}

.node-icon {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.25rem;
}

.node-icon-svg {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
}

.node-icon-book {
    color: #4f46e5; /* Indigo */
}

.node-icon-folder {
    color: #d97706; /* Amber/Orange */
}

.node-icon-post {
    color: #64748b; /* Slate Gray */
}

.node-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.node-item:hover .node-actions {
    opacity: 1;
}

.btn-mini-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 2px 4px;
    cursor: pointer;
    font-size: 0.75rem;
    border-radius: 4px;
}

.btn-mini-action:hover {
    background-color: #cbd5e1;
    color: #0f172a;
}

.node-children {
    padding-left: 1.25rem;
    border-left: 1px dashed #cbd5e1;
    margin-left: 0.8rem;
    margin-top: 0.2rem;
}

/* ─── 중앙 독서 영역 (Workspace) ────────────────────────────────── */
.reading-workspace {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    background-color: #ffffff;
}

.workspace-container {
    max-width: 950px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
}

.breadcrumbs span {
    cursor: pointer;
}

.breadcrumbs span:hover {
    color: var(--accent-color);
}

.doc-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
}

#doc-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: -1px;
}

.meta-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 문서 버튼 */
.btn-edit, .btn-delete, .btn-primary, .btn-secondary {
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}

.btn-edit {
    background-color: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}
.btn-edit:hover { background-color: #fde68a; }

.btn-delete {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.btn-delete:hover { background-color: #fecaca; }

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
}
.btn-primary:hover { background-color: var(--accent-hover); }

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.btn-secondary:hover { background-color: #cbd5e1; }

/* ─── 문서 본문 (Reading Mode) ─────────────────────────────────── */
.doc-body {
    font-size: 1.125rem;
    line-height: 1.95;
    color: #334155;
    min-height: 50vh;
}

.welcome-container {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-muted);
}

.welcome-container h2 {
    color: #0f172a;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

/* ─── 하단 내비게이션 (이전/다음 글) ────────────────────────────────── */
.doc-nav {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.doc-nav button {
    flex: 1;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    outline: none;
    max-width: 50%;
}

.doc-nav button:hover {
    border-color: var(--accent-color);
    background-color: #e0e7ff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.doc-nav button#btn-next-doc {
    text-align: right;
    align-items: flex-end;
}

.nav-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.nav-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── 모달 구조 및 디자인 ────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-lg {
    max-width: 950px;
    height: 85vh;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.close-btn:hover {
    color: #0f172a;
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
}

.form-group input, .form-group select {
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--accent-color);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ─── 네이버 소셜 로그인 버튼 ─────────────────────────────────────── */
.naver-login-btn {
    background-color: #03C75A;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    width: 100%;
    padding: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: var(--font-sans);
    transition: background-color 0.2s ease;
}

.naver-login-btn:hover {
    background-color: #02b350;
}

.naver-logo {
    font-weight: 900;
    background-color: #ffffff;
    color: #03C75A;
    font-size: 0.9rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* TUI Editor Container height adjustment */
#tui-editor {
    flex: 1;
    min-height: 350px;
}

/* 범용 숨김 처리 클래스 */
.hidden {
    display: none !important;
}

/* 드래그 앤 드롭 스타일 */
.node-item[draggable="true"] {
    cursor: grab;
}
.node-item[draggable="true"]:active {
    cursor: grabbing;
}
.node-item.dragging {
    opacity: 0.4;
}

/* 폴더 위에 드롭할 때 (폴더 내부에 넣기) */
.node-item.drag-inside {
    background-color: #e0e7ff !important;
    border: 1px dashed var(--accent-color) !important;
}

/* 틈새 드롭 갭 (Drop Gap) 스타일 */
.drop-gap {
    height: 2px;
    margin: 1px 0;
    background-color: transparent;
    border-radius: 2px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 5;
}

/* 드래그 시 반응 영역 활성화 */
body.drag-active .drop-gap {
    height: 8px;
    background-color: #f1f5f9;
    border: 1px dashed #cbd5e1;
}

/* 마우스 호버 시 틈이 넓어지며 가이드 표시 */
body.drag-active .drop-gap.drag-over {
    height: 16px;
    background-color: var(--accent-color);
    border: none;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

/* ─── 모바일 전용 토글 버튼 & 오버레이 백드롭 ──────────────────────────── */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.mobile-menu-toggle:hover {
    background-color: #1e293b;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* ─── 반응형 미디어 쿼리 (Mobile & Tablet) ───────────────────────── */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    /* 1. 상단 내비게이션 바 모바일 최적화 */
    .top-nav {
        padding: 0 1rem;
        gap: 0.5rem;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .logo-icon {
        font-size: 1.4rem;
    }

    .logo-title {
        font-size: 1.05rem;
        white-space: nowrap;
    }

    .logo-highlight {
        display: inline;
    }

    .nav-right {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .btn-login, .btn-logout {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .username-tag {
        display: none; /* 모바일에서는 아이콘/배지만 노출 */
    }

    /* 3. 독서 영역 모바일 최적화 */

    .workspace-container {
        max-width: 100%;
    }

    .breadcrumbs {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .doc-header h1 {
        font-size: 1.4rem;
        line-height: 1.35;
    }

    .doc-body {
        margin-top: 1rem;
        padding-bottom: 2rem;
        font-size: 1rem;
        line-height: 1.7;
    }

    /* 문서 본문 내 미디어/표 모바일 리사이징 */
    .doc-body img,
    .doc-body video,
    .doc-body iframe {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 8px;
    }

    .doc-body table {
        display: block;
        width: 100% !important;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .doc-body pre {
        max-width: 100%;
        overflow-x: auto;
        border-radius: 8px;
    }

    /* 이전 글/다음 글 모바일 세로 배치 */
    .doc-nav {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 2rem;
    }

    .doc-nav button {
        width: 100%;
        text-align: left;
    }

    /* 4. 모달 모바일 전체 화면 최적화 */
    .modal-card {
        width: 95% !important;
        max-height: 92vh !important;
        padding: 1.25rem !important;
        margin: 0 auto;
    }

    .modal-card.modal-lg {
        width: 96% !important;
        height: 94vh !important;
    }

    #tui-editor {
        min-height: 250px;
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    .logo-title {
        font-size: 0.95rem;
    }
}

/* ─── 추가된 기능 스타일링 (댓글, 학습완료, 진도 관리 대시보드) ─── */

/* 1. 상단 진도관리 버튼 */
.btn-progress-dashboard {
    background: rgba(165, 180, 252, 0.15);
    border: 1px solid rgba(165, 180, 252, 0.4);
    color: #a5b4fc;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}
.btn-progress-dashboard:hover {
    background: rgba(165, 180, 252, 0.3);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(165, 180, 252, 0.2);
}

/* 2. 학습 완료하기 버튼 */
.doc-completion-area {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 1rem 0 1.5rem 0;
    padding: 0;
}
.action-buttons-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-progress-toggle {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-progress-toggle:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}
.btn-progress-toggle.completed {
    background-color: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}
.btn-progress-toggle.completed:hover {
    background-color: #bbf7d0;
}

/* 사이드바 체크 뱃지 */
.post-check-badge {
    background-color: #22c55e;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-left: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* 3. 댓글 섹션 */
.comments-section {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--border-color);
}
.comments-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.2rem;
}
.comment-input-area {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    transition: border-color 0.2s;
}
.comment-input-area:focus-within {
    border-color: var(--accent-color);
}
.comment-input-area textarea {
    border: none;
    outline: none;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
    background: transparent;
}
.btn-submit-comment {
    align-self: flex-end;
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.45rem 1.2rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s;
}
.btn-submit-comment:hover {
    background-color: var(--accent-hover);
}
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.no-comments-text, .loading-text, .error-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 2rem 0;
}
.comment-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}
.comment-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}
.comment-author {
    font-weight: 600;
    color: #475569;
    margin-right: 0.75rem;
}
.comment-date {
    color: var(--text-muted);
}
.btn-delete-comment {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: auto;
}
.btn-delete-comment:hover {
    text-decoration: underline;
}
.comment-content {
    font-size: 0.92rem;
    color: var(--text-main);
    line-height: 1.5;
    word-break: break-all;
}

/* 4. 관리자 진도관리 모달 테이블 */
.admin-dashboard-container {
    width: 100%;
    overflow-x: auto;
}
.progress-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}
.progress-table th, .progress-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
.progress-table th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 700;
}
.progress-table tr:hover {
    background-color: #f8fafc;
}

/* 진도율 바 */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 150px;
    background-color: #e2e8f0;
    border-radius: 9999px;
    height: 16px;
    position: relative;
    overflow: hidden;
}
.progress-bar-fill {
    background: linear-gradient(90deg, #6366f1 0%, #a5b4fc 100%);
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s ease-out;
}
.progress-percentage {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #1e293b;
    z-index: 10;
}

.btn-detail-progress {
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-detail-progress:hover {
    background-color: #e2e8f0;
    border-color: #94a3b8;
    color: #1e293b;
}

/* 사용자 상세 진도 목록 */
.user-detail-progress-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.detail-progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #fafafa;
    font-size: 0.88rem;
}
.detail-progress-item.completed {
    border-color: #bbf7d0;
    background-color: #f0fdf4;
}
.detail-item-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.detail-category {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.detail-title {
    color: var(--text-main);
}
.detail-item-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}
.detail-progress-item .status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background-color: #e2e8f0;
    color: #64748b;
}
.detail-progress-item.completed .status-badge {
    background-color: #dcfce7;
    color: #166534;
}
.detail-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}




