/* ===========================
   민감정보·보안 텍스트 스캐너
   Style Sheet
   =========================== */

/* 페이지 컨테이너 가운데 정렬 */
.page-container {
    padding: 20px;
}

.page-container .container {
    max-width: 1200px;
    margin: 0 auto;
    display: block;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
}

/* 필터 섹션 */
.filter-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.filter-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

.filter-section h3 i {
    color: var(--primary-color);
}

.filter-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 16px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    border: 2px solid transparent;
}

.filter-toggle:hover {
    background: var(--border-color);
}

.filter-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.filter-toggle input[type="checkbox"]:checked + .toggle-label {
    font-weight: 600;
    color: var(--primary-color);
}

.filter-toggle input[type="checkbox"]:checked ~ .toggle-label {
    font-weight: 600;
    color: var(--primary-color);
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-color);
    user-select: none;
}

/* 결과 요약 */
.result-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.summary-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    transition: var(--transition);
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-item.danger {
    border-left-color: var(--danger-color);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.02) 100%);
}

.summary-item.warning {
    border-left-color: var(--warning-color);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.02) 100%);
}

.summary-item.info {
    border-left-color: var(--info-color);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, rgba(6, 182, 212, 0.02) 100%);
}

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.summary-item.danger .summary-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.summary-item.warning .summary-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.summary-item.info .summary-icon {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
}

.summary-content {
    display: flex;
    flex-direction: column;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.summary-item.danger .summary-value {
    color: var(--danger-color);
}

.summary-item.warning .summary-value {
    color: var(--warning-color);
}

.summary-item.info .summary-value {
    color: var(--info-color);
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* 검출 항목 목록 */
.detections-panel {
    margin-bottom: 20px;
}

.detections-panel h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 1.1rem;
}

.detections-panel h3 i {
    color: var(--primary-color);
}

.detections-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    background: var(--bg-color);
}

.no-detections {
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
    font-size: 1rem;
}

.detection-item {
    padding: 15px;
    margin-bottom: 10px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.detection-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.detection-item.high-risk {
    border-left-color: var(--danger-color);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, var(--card-bg) 100%);
}

.detection-item.medium-risk {
    border-left-color: var(--warning-color);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, var(--card-bg) 100%);
}

.detection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.detection-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.detection-type.resident {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.detection-type.account {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.detection-type.phone {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.detection-type.email {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.detection-type.keyword {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
}

.detection-risk {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.detection-risk.high {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.detection-risk.medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.detection-content {
    font-size: 0.95rem;
    color: var(--text-color);
    word-break: break-all;
    margin-bottom: 5px;
}

.detection-match {
    background: rgba(239, 68, 68, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    color: var(--danger-color);
}

.detection-match.medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.detection-position {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.detection-position i {
    font-size: 0.7rem;
}

/* 하이라이트 스타일 */
.highlight-resident {
    background: rgba(239, 68, 68, 0.3);
    border-bottom: 2px solid var(--danger-color);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    color: var(--danger-color);
    cursor: pointer;
}

.highlight-account {
    background: rgba(239, 68, 68, 0.3);
    border-bottom: 2px solid var(--danger-color);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    color: var(--danger-color);
    cursor: pointer;
}

.highlight-phone {
    background: rgba(245, 158, 11, 0.3);
    border-bottom: 2px solid var(--warning-color);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    color: #b45309;
    cursor: pointer;
}

.highlight-email {
    background: rgba(245, 158, 11, 0.3);
    border-bottom: 2px solid var(--warning-color);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    color: #b45309;
    cursor: pointer;
}

.highlight-keyword {
    background: rgba(6, 182, 212, 0.3);
    border-bottom: 2px solid var(--info-color);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    color: #0891b2;
    cursor: pointer;
}

/* 기본 키워드 목록 */
.default-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.default-keywords .keyword-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.setting-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
    font-style: italic;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .filter-toggles {
        flex-direction: column;
    }

    .filter-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .summary-panel {
        grid-template-columns: 1fr;
    }

    .detection-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detection-item {
    animation: fadeIn 0.3s ease;
}

/* 스크롤바 스타일 (detections-list용) */
.detections-list::-webkit-scrollbar {
    width: 8px;
}

.detections-list::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.detections-list::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.detections-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== FAQ/QNA 섹션 (페이지 하단) ===== */
.faq-section {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    padding: 40px 32px;
    margin: 40px auto 0 auto;
    max-width: 900px;
}

.faq-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
    text-align: center;
}

.faq-title i {
    color: #2563eb;
    font-size: 1.5rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.faq-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    transition: all 0.3s ease;
    width: 100%;
}

.faq-item.active,
.faq-item:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    background: #f8fafc;
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    line-height: 1.6;
    width: 100%;
}

.faq-question span:not(.faq-icon) {
    flex: 1;
    word-break: keep-all;
}

.faq-icon {
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.faq-arrow {
    margin-left: auto;
    color: #64748b;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-arrow {
    transform: rotate(180deg);
    color: #2563eb;
}

.faq-item .faq-answer {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    padding-left: 0;
    border-top: 1px solid #e2e8f0;
    color: #475569;
    font-size: 1rem;
    line-height: 1.8;
    width: 100%;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-answer p {
    margin: 0;
    margin-bottom: 8px;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer strong {
    color: #1e293b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .faq-section {
        padding: 24px 20px;
        margin: 24px 0 0;
    }
    
    .faq-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
        flex-direction: column;
        gap: 8px;
    }
    
    .faq-item {
        padding: 16px 18px;
    }
    
    .faq-question {
        font-size: 1rem;
        gap: 10px;
    }
    
    .faq-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .faq-item .faq-answer {
        font-size: 0.95rem;
    }
}

