/**
 * 논문 작성 도우미 - 기존 기능 스타일 (4장/5장)
 * v0.4.0 - Dark Mode Design System 호환
 */

.icon-gap {
    margin-right: 0.4rem;
}

.welcome-icon i {
    font-size: 2.8rem;
}

/* ========== 컨테이너 ========== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== 헤더 ========== */
header {
    text-align: center;
    padding: 30px 0;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

header p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ========== 진행 단계 ========== */
.progress-steps {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.4;
    transition: opacity var(--transition-normal);
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 1;
    color: var(--success);
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.step.active .step-num {
    background: var(--gradient-accent);
    color: var(--text-inverse);
    box-shadow: var(--shadow-glow);
}

.step.completed .step-num {
    background: var(--success);
    color: var(--text-inverse);
}

/* ========== 드롭존 ========== */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(0, 255, 0, 0.05);
    box-shadow: var(--shadow-glow);
}

.light-mode .dropzone:hover,
.light-mode .dropzone.dragover {
    background: rgba(16, 185, 129, 0.05);
}

.dropzone .icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 16px;
}

/* ========== 업로드 옵션 ========== */
.upload-options {
    margin-top: 20px;
    text-align: center;
}

.upload-options label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.upload-options label:hover {
    color: var(--text-primary);
}

.upload-options input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-primary);
}

/* ========== 액션 버튼 ========== */
.action-buttons {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ========== 요약 박스 ========== */
.summary-box {
    margin: 24px 0;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border-left: 4px solid var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.summary-box h3 {
    font-size: 1rem;
    margin-bottom: 14px;
    color: var(--accent-primary);
}

#summaryContent {
    line-height: 1.9;
    color: var(--text-primary);
}

/* ========== 텍스트 미리보기 ========== */
.text-preview {
    margin-top: 24px;
}

.text-preview h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.text-preview pre {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

/* ========== 국가 선택 ========== */
.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.country-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.country-check:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.country-check input[type="checkbox"] {
    accent-color: var(--accent-primary);
}

/* ========== 컨트롤 그룹 ========== */
.control-group {
    margin-bottom: 24px;
}

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ========== 생성 섹션 ========== */
.section-group {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.section-header {
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gen-btn {
    padding: 10px 18px;
    border: 1px solid var(--accent-primary);
    background: transparent;
    color: var(--accent-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.gen-btn:hover {
    background: var(--accent-primary);
    color: var(--text-inverse);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.gen-btn.small {
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* ========== 생성 결과 ========== */
.result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.generated-text {
    background: var(--bg-tertiary);
    padding: 24px;
    border-radius: 10px;
    white-space: pre-wrap;
    line-height: 1.9;
    max-height: 400px;
    overflow-y: auto;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

/* ========== 조사 결과 ========== */
.country-result {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.country-result:last-child {
    border-bottom: none;
}

.country-result h3 {
    font-size: 1.15rem;
    margin-bottom: 16px;
    color: var(--accent-primary);
}

.country-result .content {
    white-space: pre-wrap;
    line-height: 1.8;
    color: var(--text-primary);
}

.citations {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

.citations h4 {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.citations a {
    color: var(--accent-tertiary);
    font-size: 0.85rem;
    display: block;
    margin-bottom: 6px;
    transition: color var(--transition-fast);
}

.citations a:hover {
    color: var(--accent-primary);
}

/* ========== 단계 콘텐츠 ========== */
.step-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.step-content.active {
    display: block;
}

/* ========== 섹션 태그 ========== */
.sections-found {
    margin: 20px 0;
}

.sections-found h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

#sectionsList {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.section-tag {
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.section-tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ========== 결과 정보 ========== */
.result-info p {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.result-info strong {
    color: var(--text-secondary);
}
