/* news.css - 보안 뉴스 검색 페이지 */

/* ==================== 페이지 헤더 (research.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;
}

/* ==================== 검색 카드 ==================== */
.news-search-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    padding: 22px 24px;
    margin-bottom: 20px;
}

.news-search-form {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.news-search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.news-search-icon {
    position: absolute;
    left: 14px;
    color: #aab4c0;
    font-size: 0.95rem;
    pointer-events: none;
}

.news-search-box input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.news-search-box input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.15);
}

#newsSort {
    padding: 0 12px;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #444;
    background: white;
    cursor: pointer;
}

.news-search-btn {
    padding: 0 22px;
    border: none;
    border-radius: 8px;
    background: #005792;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.news-search-btn:hover {
    background: #00436f;
}

/* ==================== 키워드 채널 칩 ==================== */
.news-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.news-keywords:empty {
    display: none;
}

.news-kw-chip {
    padding: 6px 14px;
    border: 1px solid #dbe7f3;
    border-radius: 20px;
    background: #f4f9fe;
    color: #2c5aa0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.news-kw-chip:hover {
    background: #e3f0fc;
    border-color: #4facfe;
}

.news-kw-chip.active {
    background: #005792;
    border-color: #005792;
    color: white;
}

/* ==================== 결과 상태 표시줄 ==================== */
.news-status {
    padding: 10px 16px;
    margin-bottom: 14px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
    font-size: 0.88rem;
    color: #555;
}

.news-status .news-status-count {
    color: #005792;
    font-weight: 600;
}

.news-status.error {
    background: #f8d7da;
    color: #721c24;
}

/* ==================== 뉴스 카드 목록 (그리드) ==================== */
.news-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
    align-items: stretch;
}

.news-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 18px 22px;
    text-decoration: none;
    color: inherit;
    border-left: 4px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    border-left-color: #4facfe;
}

.news-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #223;
    line-height: 1.45;
    margin-bottom: 8px;
}

.news-card-title b {
    color: #005792;
}

.news-card-desc {
    font-size: 0.88rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-desc b {
    color: #2c5aa0;
    font-weight: 600;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: #98a2ad;
    margin-top: auto;   /* 그리드에서 카드 높이가 달라도 메타줄은 바닥 정렬 */
}

.news-card-press {
    padding: 2px 10px;
    border-radius: 12px;
    background: #f1f4f8;
    color: #556;
    font-size: 0.78rem;
}

/* 로딩 스피너 */
.news-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: #98a2ad;
    font-size: 0.95rem;
}

.news-loading i {
    margin-right: 8px;
    color: #4facfe;
}

/* 빈 결과 */
.news-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 0;
    color: #98a2ad;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
}

.news-empty i {
    display: block;
    font-size: 2rem;
    margin-bottom: 12px;
    color: #cfd8e0;
}

/* ==================== 더보기 버튼 ==================== */
.news-more-wrap {
    text-align: center;
    margin: 20px 0 10px;
}

.news-more-btn {
    padding: 11px 34px;
    border: 1px solid #dde3ea;
    border-radius: 24px;
    background: white;
    color: #2c5aa0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.news-more-btn:hover {
    background: #f4f9fe;
    border-color: #4facfe;
}

.news-more-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ==================== 로그인 안내 (비로그인) ==================== */
.news-login-notice {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
    color: #778;
}

.news-login-notice i {
    display: block;
    font-size: 2.2rem;
    margin-bottom: 16px;
    color: #cfd8e0;
}

.news-login-notice p {
    font-size: 1rem;
    line-height: 1.7;
}

/* ==================== 로그인 모달 (common.css 미포함분 — 없으면 폼이 페이지 상단에 그대로 노출됨) ==================== */
.login-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.8);
}

.login-modal-content {
    background: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.login-form h2 { color: #005792; text-align: center; margin-bottom: 22px; }
.login-modal .form-group { margin-bottom: 18px; }
.login-modal label { display: block; margin-bottom: 6px; color: #555; font-weight: bold; font-size: 14px; }
.login-modal input {
    width: 100%; padding: 10px 12px; border: 2px solid #ddd;
    border-radius: 6px; font-size: 14px; box-sizing: border-box;
}
.login-modal input:focus { outline: none; border-color: #4facfe; }
.login-submit {
    width: 100%; background: #4facfe; color: #fff; border: none;
    padding: 12px; border-radius: 8px; font-size: 16px; cursor: pointer;
}
.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; }

/* ==================== 관리자 패널 / 모달 버튼 (common.css 미포함분) ==================== */
.admin-panel {
    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: 8px;
}

.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;
}

.submit-btn, .cancel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.submit-btn {
    background: #005792;
    color: white;
}

.submit-btn:hover { background: #003d6b; }

.cancel-btn {
    background: #f0f2f5;
    color: #555;
    border: 1px solid #dde2ea;
}

.cancel-btn:hover { background: #e2e6ed; }

/* ==================== 반응형 ==================== */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.8em;
    }

    .news-search-form {
        flex-wrap: wrap;
    }

    .news-search-box {
        flex: 1 1 100%;
    }

    #newsSort {
        flex: 1;
        padding: 10px 12px;
    }

    .news-search-btn {
        flex: 2;
        padding: 10px 0;
    }

    .news-card {
        padding: 15px 16px;
    }
}
