/* 위키 목록 페이지 스타일 - 나무위키 스타일 */
.wiki-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    background: #ffffff;
}

/* 나무위키 스타일 메인 헤더 */
.wiki-main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    flex-wrap: wrap;
    gap: 1rem;
}

.wiki-header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 0 0 auto;
}

.wiki-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    justify-content: flex-end;
}

.wiki-header-search {
    flex: 0 0 auto;
    display: flex;
    width: 280px;
}

.random-wiki-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.random-wiki-btn:hover {
    background: #f5f5f5;
    border-color: #b0b0b0;
    color: #0066cc;
}

.random-wiki-btn i {
    font-size: 0.9rem;
}

.wiki-main-title {
    font-size: 1.75rem;
    color: #000;
    margin: 0;
    font-weight: 700;
    line-height: 1.4;
}

.wiki-header-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wiki-header-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.wiki-header-link:hover {
    background: #f5f5f5;
    color: #0066cc;
}

.wiki-header-link i {
    font-size: 0.85rem;
}

.wiki-header-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    gap: 0;
    padding: 0.5rem;
}

.wiki-header-btn:hover {
    background: #f5f5f5;
    color: #0066cc;
}

/* 특수 기능 드롭다운 */
.wiki-header-dropdown {
    position: relative;
}

.wiki-header-dropdown-btn {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.wiki-header-dropdown-arrow {
    font-size: 0.7rem;
    margin-left: 0.25rem;
    transition: transform 0.2s;
}

.wiki-header-dropdown.active .wiki-header-dropdown-arrow {
    transform: rotate(180deg);
}

.wiki-header-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    display: none;
    z-index: 1000;
    padding: 0.5rem 0;
}

.wiki-header-dropdown.active .wiki-header-dropdown-menu {
    display: block;
}

.wiki-header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.wiki-header-dropdown-item:hover {
    background: #f5f5f5;
    color: #0066cc;
}

.wiki-header-dropdown-item i {
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
}

.wiki-header-actions {
    display: flex;
    gap: 0;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
}

.btn-create {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-create:hover {
    background: #f5f5f5;
    border-color: #b0b0b0;
}

/* 검색 박스 스타일 */
.wiki-container .search-box {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 0;
    overflow: hidden;
    width: 100%;
    height: 40px;
    gap: 0 !important;
    margin: 0;
}

.wiki-container .search-box input {
    flex: 1;
    padding: 0.5rem 0 0.5rem 0.75rem !important;
    border: none;
    font-size: 0.9rem;
    outline: none;
    background: transparent;
    min-width: 0;
    height: 40px;
    margin: 0;
}

.wiki-container .search-box input::placeholder {
    color: #999;
}

.wiki-container .search-btn {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    transition: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 100%;
    flex-shrink: 0;
    align-self: stretch;
    gap: 0 !important;
    position: static !important;
    right: auto !important;
    left: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
}

.search-btn i {
    font-size: 0.9rem;
    display: block;
}

.wiki-container .search-btn:hover,
.wiki-container .search-btn:focus,
.wiki-container .search-btn:active,
.wiki-container .search-btn:hover i,
.wiki-container .search-btn:focus i,
.wiki-container .search-btn:active i {
    color: #666 !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}


.wiki-content-area {
    padding: 2rem;
    min-height: 400px;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.wiki-main-content {
    flex: 1;
    min-width: 0;
}

.wiki-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.sidebar-section {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e5e5;
}

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

.sidebar-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-item:last-child {
    border-bottom: none;
}

.sidebar-item-link {
    display: block;
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.5;
    transition: color 0.2s;
}

.sidebar-item-link:hover {
    color: #0052a3;
    text-decoration: underline;
}

.sidebar-item-meta {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.25rem;
}

/* 나무위키 스타일 문서 목록 */
.wiki-list {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.wiki-item {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.wiki-item:last-child {
    border-bottom: none;
}

.wiki-item:hover {
    background: #f8f8f8;
}

.wiki-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0066cc;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    display: inline-block;
}

.wiki-item:hover .wiki-item-title {
    text-decoration: underline;
}

.wiki-item-description {
    color: #666;
    margin-bottom: 0.75rem;
    line-height: 1.6;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wiki-item-meta {
    display: flex;
    gap: 1.25rem;
    font-size: 0.85rem;
    color: #999;
    flex-wrap: wrap;
}

.wiki-item-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.wiki-item-meta i {
    font-size: 0.75rem;
    color: #bbb;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: #333;
}

.pagination button:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #b0b0b0;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #fafafa;
}

.pagination button.active {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.pagination button.active:hover {
    background: #0052a3;
    border-color: #0052a3;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #888;
    font-size: 1rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

/* 나무위키 스타일 빈 상태 (검색 결과 없음) */
.wiki-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.wiki-empty-icon {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 1.5rem;
}

.wiki-empty-icon i {
    display: block;
}

.wiki-empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.wiki-empty-description {
    font-size: 1rem;
    color: #666;
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

.wiki-empty-actions {
    margin-bottom: 3rem;
}

.btn-create-doc {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    border: 1px solid #0066cc;
    background: #0066cc;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.btn-create-doc:hover {
    background: #0052a3;
    border-color: #0052a3;
}

.wiki-empty-suggestions {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e5e5;
    text-align: left;
}

.wiki-empty-suggestions-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 1rem 0;
}

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

.similar-doc-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.similar-doc-item:last-child {
    border-bottom: none;
}

.similar-doc-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0066cc;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.similar-doc-link:hover {
    color: #0052a3;
    text-decoration: underline;
}

.similar-doc-link i {
    font-size: 0.85rem;
    color: #999;
}

.no-similar-docs {
    color: #999;
    font-size: 0.9rem;
    padding: 1rem 0;
    text-align: center;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #888;
}

.error {
    text-align: center;
    padding: 3rem;
    color: #d32f2f;
}

#create-wiki-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#create-wiki-btn:hover {
    background: #f5f5f5;
    border-color: #b0b0b0;
}

/* 최근 변경 페이지 스타일 */
.wiki-change-item {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    transition: background 0.2s;
}

.wiki-change-item:hover {
    background: #f9f9f9;
}

.wiki-change-item.minor {
    opacity: 0.8;
}

.change-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.change-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s;
}

.change-item-title:hover {
    color: #0052a3;
    text-decoration: underline;
}

.minor-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: #666;
    background: #f0f0f0;
    border-radius: 3px;
}

.change-item-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

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

.change-item-meta i {
    font-size: 0.75rem;
}

.change-item-summary {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #f9f9f9;
    border-left: 3px solid #0066cc;
    font-size: 0.9rem;
    color: #555;
}

.change-item-actions {
    display: flex;
    gap: 0.75rem;
}

.change-item-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    color: #0066cc;
    text-decoration: none;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    transition: all 0.2s;
}

.change-item-link:hover {
    background: #f0f7ff;
    border-color: #0066cc;
}

/* 최근 토론 페이지 플레이스홀더 */
.wiki-discussions-placeholder {
    padding: 4rem 2rem;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    margin: 2rem 0;
}

.placeholder-icon {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 1.5rem;
}

.wiki-discussions-placeholder h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.wiki-discussions-placeholder p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.placeholder-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-primary {
    background: #0066cc;
    color: #fff;
    border: 1px solid #0066cc;
}

.btn-primary:hover {
    background: #0052a3;
    border-color: #0052a3;
}

.btn-secondary {
    background: #fff;
    color: #333;
    border: 1px solid #d0d0d0;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #b0b0b0;
}

/* 활성 링크 스타일 */
.wiki-header-link.active {
    background: #f0f7ff;
    color: #0066cc;
    font-weight: 600;
}

/* 빈 상태 및 에러 상태 */
.empty-state,
.error-state {
    padding: 3rem 2rem;
    text-align: center;
    color: #666;
    font-size: 1rem;
}

.error-state {
    color: #d32f2f;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .wiki-main-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .wiki-main-title {
        font-size: 1.5rem;
    }

    .wiki-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        flex: 1 1 100%;
    }

    .wiki-header-links {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .wiki-header-actions {
        flex: 0 0 auto;
        min-width: fit-content;
    }

    #create-wiki-btn,
    .btn-create {
        width: auto;
        min-height: 36px;
        padding: 0.45rem 0.85rem;
        white-space: nowrap;
    }

    .wiki-header-link {
        font-size: 0.8rem; /* 텍스트 크기 축소 */
        padding: 0.5rem;
        white-space: nowrap; /* 항상 1줄로 표시 */
    }

    .wiki-header-link i {
        font-size: 0.75rem; /* 아이콘 크기도 축소 */
    }

    .wiki-header-right {
        order: -1;
        width: 100%;
        flex: 1 1 100%;
        justify-content: flex-start;
        gap: 0.5rem;
        flex-direction: row;
        align-items: center;
    }

    .wiki-header-search {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        max-width: none;
    }

    .wiki-container .search-box,
    .wiki-container .search-box input,
    #wiki-search-input {
        width: 100%;
        max-width: none;
    }

    .random-wiki-btn {
        display: flex;
        align-self: auto;
    }

    .random-wiki-btn {
        width: 36px;
        height: 36px;
    }

    .wiki-container .search-box {
        height: 36px;
    }

    .wiki-container .search-box input {
        height: 36px;
        padding: 0.5rem 0 0.5rem 0.5rem !important;
        font-size: 0.85rem;
    }

    .wiki-container .search-btn {
        width: 36px;
        font-size: 0.85rem;
    }

    .wiki-content-area {
        padding: 0.75rem; /* 여백 축소 */
        flex-direction: column;
        align-items: stretch;
    }

    .wiki-main-content {
        width: 100%;
    }

    .wiki-sidebar {
        width: 100%;
        order: 2; /* 본문 아래로 이동 */
        margin-top: 1.5rem;
    }

    .wiki-item {
        padding: 1rem;
    }

    .wiki-item-title {
        font-size: 1rem;
    }

    .wiki-item-meta {
        font-size: 0.8rem;
        gap: 1rem;
    }

    .wiki-change-item {
        padding: 1rem;
    }

    .change-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .change-item-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .change-item-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .change-item-link {
        width: 100%;
        justify-content: center;
    }

    .wiki-discussions-placeholder {
        padding: 2rem 1rem;
    }

    .placeholder-icon {
        font-size: 3rem;
    }

    .placeholder-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
