/* publications.css - 논문 번호 자동 제안 기능이 포함된 완전한 논문 목록 페이지 스타일 */

/* 페이지 헤더 스타일 - 간결하게 */
.page-header {
    text-align: center;
    padding: 10px 15px 20px;
    margin-bottom: 25px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
}

.page-header h1 {
    color: #005792;
    font-size: 2.2em;
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

.page-header h1::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background-color: #4facfe;
}

.page-header p {
    color: #555;
    font-size: 1em;
    max-width: 600px;
    margin: 15px auto 0;
}

/* ==================== 통일된 로그인 및 관리 기능 CSS ==================== */

/* 헤더 수정 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 로그인 버튼 */
.auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 20px;
}

.login-btn, .logout-btn {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.65);
    padding: 7px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.login-btn:hover, .logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
    transform: translateY(-2px);
}

.user-info {
    color: #005792;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 로그인 모달 */
.login-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.login-modal-content {
    background: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: slideIn 0.3s ease;
}

.login-form h2 {
    color: #005792;
    text-align: center;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: bold;
    font-size: 14px;
    line-height: 1.2;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.4;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 0.2rem rgba(79, 172, 254, 0.25);
}

.login-submit {
    width: 100%;
    background: #4facfe;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.login-submit:hover {
    background: #005792;
}

.login-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
}

.login-close:hover {
    color: #005792;
}

.login-help {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9em;
    color: #666;
}

/* 관리자 패널 */
.admin-panel {
    display: none;
    background: white;
    padding: 10px 20px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-top: 3px solid #24488c;
}

.admin-panel h3 {
    color: #162d55;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
    font-weight: 700;
}

.admin-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.admin-btn {
    background: linear-gradient(135deg, #162d55 0%, #24488c 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    white-space: nowrap;
}

.admin-btn:hover {
    background: linear-gradient(135deg, #0f1f3d 0%, #162d55 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(22, 45, 85, 0.35);
}

.admin-btn.delete {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
}

.admin-btn.delete:hover {
    background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
    box-shadow: 0 4px 14px rgba(185, 28, 28, 0.35);
}

.admin-btn.edit {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
    color: white;
}

.admin-btn.edit:hover {
    background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
    box-shadow: 0 4px 14px rgba(180, 83, 9, 0.35);
}

.admin-btn.edit.active {
    background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.3);
}

.admin-btn.delete.active {
    background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

.admin-btn i {
    font-size: 0.9em;
    width: 16px;
    text-align: center;
}

/* ==================== 논문 번호 자동 제안 시스템 CSS (새로 추가) ==================== */

/* 논문 ID 입력 컨테이너 */
.publication-id-container {
    position: relative;
}

/* 입력 필드와 버튼을 한 줄로 배치 */
.input-with-button {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.input-with-button input {
    flex: 1;
    min-width: 0;
}

/* 논문 ID 도움말 박스 */
.publication-id-help {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    animation: slideInDown 0.3s ease;
    line-height: 1.4;
}

.publication-id-help strong {
    color: #007bff;
    font-weight: 600;
}

.publication-id-help i {
    color: #ffc107;
    margin-right: 6px;
    font-size: 1.1em;
}

/* 자동 입력 버튼 */
.auto-fill-btn {
    padding: 8px 14px;
    font-size: 12px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,123,255,0.3);
    white-space: nowrap;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: fit-content;
}

.auto-fill-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,123,255,0.4);
}

.auto-fill-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.auto-fill-btn i {
    font-size: 0.9em;
}

/* 실시간 검증 메시지 */
.publication-id-validation {
    font-size: 12px;
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease;
    line-height: 1.4;
    border-left: 4px solid transparent;
}

.publication-id-validation i {
    margin-right: 6px;
    font-size: 1em;
}

/* 검증 상태별 스타일 */
.validation-success {
    background: #d4edda !important;
    color: #155724 !important;
    border-left-color: #28a745 !important;
}

.validation-error {
    background: #f8d7da !important;
    color: #721c24 !important;
    border-left-color: #dc3545 !important;
}

.validation-warning {
    background: #fff3cd !important;
    color: #856404 !important;
    border-left-color: #ffc107 !important;
}

/* 정보 아이콘 스타일 */
.fa-info-circle {
    color: #6c757d;
    margin-left: 4px;
    cursor: help;
    transition: color 0.2s ease;
}

.fa-info-circle:hover {
    color: #007bff;
}

/* 논문 ID 필드 특별 스타일 */
#publicationId {
    font-weight: 500;
    background-color: #fff;
    transition: all 0.3s ease;
}

#publicationId:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    background-color: #f8f9ff;
}

#publicationId::placeholder {
    color: #6c757d;
    font-style: italic;
}

/* ==================== 기존 논문 추가/수정 폼 스타일 ==================== */

/* 논문 추가 폼 */
.add-publication-form {
    display: none;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 2px solid #4facfe;
}

.add-publication-form h4 {
    color: #005792;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-publication-form h4 i {
    color: #4facfe;
    font-size: 1em;
}

/* 논문 수정 폼 */
.edit-publication-form {
    display: none;
    background: #fff3cd;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 2px solid #ffc107;
}

.edit-publication-form h4 {
    color: #856404;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-publication-form h4 i {
    color: #d39e00;
    font-size: 1em;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
    min-width: 0;
}

.form-group textarea {
    min-height: 70px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.4;
}

.form-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.submit-btn, .cancel-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
}

.submit-btn {
    background: #005792;
    color: white;
}

.submit-btn:hover {
    background: #003d6b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 87, 146, 0.3);
}

.cancel-btn {
    background: #f0f2f5;
    color: #555;
    border: 1px solid #dde2ea;
}

.cancel-btn:hover {
    background: #e2e6ed;
    transform: translateY(-1px);
}

.submit-btn i, .cancel-btn i {
    font-size: 0.9em;
}

/* 위치 선택 관련 스타일 */
#specificPositionGroup {
    transition: all 0.3s ease;
    opacity: 1;
}

#specificPositionGroup.hidden {
    opacity: 0;
    transform: translateY(-10px);
}

#specificPosition {
    background-color: #f8f9fa;
    border: 2px solid #4facfe;
    font-weight: 500;
}

#insertPosition {
    background-color: #fff;
    border: 2px solid #ddd;
    font-weight: 500;
}

#insertPosition:focus, #specificPosition:focus {
    border-color: #4facfe;
    box-shadow: 0 0 0 0.2rem rgba(79, 172, 254, 0.25);
}

/* 위치 안내 텍스트 */
.position-help {
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
    padding: 5px 8px;
    background: #e9ecef;
    border-radius: 4px;
    line-height: 1.3;
}

/* 알림 메시지 */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
    max-width: 400px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* ==================== 기존 논문 스타일 ==================== */

/* 논문 네비게이션 버튼 스타일 */
.publication-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-button {
    background: white;
    color: #162d55;
    border: 1.5px solid #24488c;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(22, 45, 85, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-button:hover {
    background: #eef2f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(22, 45, 85, 0.15);
}

.nav-button.active {
    background: linear-gradient(90deg, #162d55, #24488c);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(22, 45, 85, 0.3);
}

.nav-button i {
    font-size: 1em;
}

/* 논문 섹션 스타일 */
.publication-section {
    margin-bottom: 20px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: none;
}

.section-header h2 {
    color: #0f2044;
    font-size: 1.1em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 14px;
    border-left: 3px solid #4facfe;
    background: linear-gradient(90deg, rgba(79, 172, 254, 0.07), transparent);
    border-radius: 0 5px 5px 0;
}

.section-header i {
    color: #4facfe;
}

.count {
    background-color: #f0f7ff;
    color: #005792;
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.85em;
    border: 1px solid #e0f0ff;
}

/* 각 섹션별 왼쪽 보더 + 상단 색상 바 */
.publication-section { position: relative; overflow: hidden; }
.publication-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 8px 8px 0 0;
}

.jif-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: #eaf3ff; color: #1769b0; font-size: 0.78em; font-weight: 700; vertical-align: middle; }
.sci-section { border-left: 2px solid #4facfe; }
.sci-section::before { background: linear-gradient(90deg, #4facfe, #00c6ff); }

.kci-section { border-left: 2px solid #28a745; }
.kci-section::before { background: linear-gradient(90deg, #28a745, #48c774); }

.other-section { border-left: 2px solid #6c757d; }
.other-section::before { background: linear-gradient(90deg, #6c757d, #adb5bd); }

/* CLS 방지 */
.publication-list { min-height: 80px; }

/* 논문 목록 스타일 */
.publication-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.publication-item {
    display: flex;
    padding: 10px 14px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: var(--card-radius, 8px);
    transition: var(--card-transition, all 0.3s ease);
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    position: relative;
}

.publication-item:hover {
    background-color: #f0f7ff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.publication-id {
    min-width: 50px;
    font-weight: bold;
    color: #005792;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 2px;
    font-size: 0.9em;
}

.publication-content {
    flex: 1;
    position: relative;
}

.publication-title {
    margin: 0 0 6px 0;
    font-size: 1em;
    line-height: 1.4;
    color: #333;
}

.publication-title strong {
    font-weight: 600;
}

.publication-title a {
    color: #005792;
    text-decoration: none;
    transition: color 0.2s ease;
}

.publication-title a:hover {
    color: #4facfe;
    text-decoration: underline;
}

.publication-authors {
    margin: 0 0 4px 0;
    font-size: 0.9em;
    color: #555;
}

.publication-journal {
    margin: 0;
    font-size: 0.85em;
    font-style: italic;
    color: #666;
}

/* 수상 내역 강조 */
.publication-journal .award {
    color: #dc3545;
    font-weight: bold;
    font-style: normal;
}

/* paper / project page 링크 줄 */
.publication-links {
    margin: 6px 0 0 0;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.publication-links .pub-link {
    color: #005792;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.publication-links .pub-link:hover {
    color: #4facfe;
    text-decoration: underline;
}

.publication-links .pub-link i {
    font-size: 0.9em;
}

.publication-links .pub-link-sep {
    color: #bbb;
    margin: 0 2px;
}

/* 논문 요약문 */
.publication-summary {
    margin: 8px 0 0 0;
    font-size: 0.88em;
    line-height: 1.55;
    color: #444;
}

/* 논문 아이템 액션 버튼 */
.publication-actions {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    gap: 5px;
}

.edit-publication-btn {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
    margin-right: 8px;
}

.edit-publication-btn:hover {
    background: #e0a800;
    transform: scale(1.05);
}

.delete-publication-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.delete-publication-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* 더 보기 버튼 스타일 */
.more-publications {
    margin-top: 20px;
}

.show-more-button {
    background-color: transparent;
    color: #005792;
    border: 1px solid #4facfe;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 auto;
}

.show-more-button:hover {
    background-color: #f0f7ff;
}

.show-more-button i {
    transition: transform 0.3s ease;
}

.hidden-publications {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.hidden-publications.show {
    display: block;
}

/* 애니메이션 효과 */
.hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== 애니메이션 키프레임 ==================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 반응형 디자인 ==================== */

@media (max-width: 992px) {
    .publication-nav {
        gap: 12px;
    }
    
    .nav-button {
        padding: 8px 16px;
        font-size: 0.95em;
    }
    
    .section-header h2 {
        font-size: 1.4em;
    }
    
    .admin-panel h3 {
        font-size: 1.2em;
    }
    
    .admin-btn {
        font-size: 0.85em;
        padding: 9px 18px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 10px;
        padding: 12px 3%;
    }

    .auth-section {
        margin-right: 0;
    }

    .container { padding-top: 140px; }

    .publication-section {
        padding: 18px 15px;
    }
    
    .publication-item {
        padding: 12px;
        flex-direction: column;
    }
    
    .publication-id {
        margin-bottom: 6px;
    }
    
    .page-header h1 {
        font-size: 1.8em;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .count {
        align-self: flex-start;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 15px;
    }

    .admin-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .admin-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 0.9em;
    }

    .publication-actions {
        position: static;
        margin-top: 10px;
        display: flex;
        justify-content: flex-end;
    }
    
    .form-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .submit-btn, .cancel-btn {
        width: 100%;
        justify-content: center;
    }
    
    .add-publication-form h4, .edit-publication-form h4 {
        font-size: 1em;
    }

    /* 논문 번호 자동 제안 모바일 스타일 */
    .input-with-button {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    
    .auto-fill-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .publication-id-help {
        font-size: 11px;
        padding: 8px 12px;
    }
    
    .publication-id-validation {
        font-size: 11px;
        padding: 8px 12px;
    }
}

@media (max-width: 576px) {
    .publication-nav {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-button {
        width: 100%;
        justify-content: center;
    }
    
    .publication-section {
        padding: 15px 12px;
    }
    
    .publication-title {
        font-size: 0.95em;
    }
    
    .publication-authors, .publication-journal {
        font-size: 0.8em;
    }
    
    .page-header {
        padding: 20px 12px 15px;
    }

    .add-publication-form, .edit-publication-form {
        padding: 15px 12px;
    }

    .form-group input, .form-group select, .form-group textarea {
        font-size: 16px; /* 모바일에서 확대 방지 */
    }
    
    .admin-panel {
        padding: 15px 12px;
    }
    
    .admin-panel h3 {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
    
    .admin-btn {
        padding: 10px 16px;
        font-size: 0.85em;
        min-height: 36px;
    }