/*
 * 개인정보 필터링 차단 모달 스타일
 * - 기반: 정보보안과 붙임5 차단페이지 privacyError.css (디자인 값 동일)
 * - 변경: 관리자/시민 화면 위에 모달로 띄우기 위해 모든 규칙을 #upapiPrivacyRoot 안으로 한정하고
 *         Bootstrap(.modal-*)과 충돌하지 않도록 클래스명에 upapi- 접두사를 붙임.
 *         body/h1/:root 등 전역 선택자 제거, 차단 카드를 오버레이로 표시.
 */
#upapiPrivacyRoot {
    --upapi-primary: #2563eb;
    --upapi-primary-dark: #1d4ed8;
    --upapi-text: #172033;
    --upapi-muted: #64748b;
    --upapi-line: #d9e2ec;
    --upapi-surface: #ffffff;
    color: var(--upapi-text);
    font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
    word-break: keep-all;
}

#upapiPrivacyRoot *,
#upapiPrivacyRoot *::before,
#upapiPrivacyRoot *::after { box-sizing: border-box; }

/* =========================================================================
   차단 카드 오버레이 (붙임5 .page / .block-card)
   ========================================================================= */
#upapiPrivacyRoot .upapi-block-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    padding: 38px 20px;
    overflow-y: auto;
    animation: upapiFadeIn 0.18s ease-out;
}

#upapiPrivacyRoot .upapi-block-overlay.active { display: flex; }

#upapiPrivacyRoot .upapi-block-card {
    width: min(820px, 100%);
    max-height: 100%;
    overflow-y: auto;
    margin: auto;
    padding: 48px 56px 44px;
    border: 1px solid var(--upapi-line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(36, 57, 87, 0.09);
    text-align: left;
}

#upapiPrivacyRoot .upapi-city-logo {
    display: block;
    width: 190px;
    max-width: 52%;
    height: auto;
    margin: 0 0 28px;
}

#upapiPrivacyRoot .upapi-title {
    margin: 18px 0 14px;
    font-size: clamp(30px, 5vw, 42px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.045em;
    color: var(--upapi-text);
}

#upapiPrivacyRoot .upapi-description {
    margin: 0;
    color: var(--upapi-muted);
    font-size: 16px;
    line-height: 1.85;
    letter-spacing: -0.015em;
}

#upapiPrivacyRoot .upapi-detected-text-link {
    display: inline;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--upapi-text);
    font: inherit;
    font-size: 16px;
    font-weight: 750;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

#upapiPrivacyRoot .upapi-detected-text-link:hover { color: var(--upapi-primary); }

#upapiPrivacyRoot .upapi-illustration-wrap {
    display: flex;
    justify-content: center;
    padding: 24px 0 12px;
}

#upapiPrivacyRoot .upapi-illustration {
    display: block;
    width: min(74%, 410px);
    height: auto;
}

#upapiPrivacyRoot .upapi-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 28px;
}

#upapiPrivacyRoot .upapi-back-button {
    min-width: 186px;
    height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--upapi-primary);
    font: inherit;
    font-size: 15px;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
    transition: background 0.15s ease-in-out;
}

#upapiPrivacyRoot .upapi-back-button:hover { background: var(--upapi-primary-dark); }
#upapiPrivacyRoot .upapi-back-button:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.3); outline-offset: 3px; }

/* 확인 카드의 [취소] (보조 버튼) */
#upapiPrivacyRoot .upapi-cancel-button {
    color: var(--upapi-text);
    background: #fff;
    border: 1px solid var(--upapi-line);
    box-shadow: none;
}
#upapiPrivacyRoot .upapi-cancel-button:hover { background: #f1f5f9; }

/* =========================================================================
   상세 모달 (붙임5 .modal-*)
   ========================================================================= */
#upapiPrivacyRoot .upapi-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20010;
    padding: 20px;
    animation: upapiFadeIn 0.18s ease-out;
}

#upapiPrivacyRoot .upapi-modal-overlay.active { display: flex; }

@keyframes upapiFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#upapiPrivacyRoot .upapi-modal-container {
    width: min(620px, 100%);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: var(--upapi-surface);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
    border: 1px solid var(--upapi-line);
    overflow: hidden;
    animation: upapiSlideUp 0.18s ease-out;
}

@keyframes upapiSlideUp {
    from { transform: translateY(14px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#upapiPrivacyRoot .upapi-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--upapi-line);
    background: #f8fafc;
}

#upapiPrivacyRoot .upapi-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

#upapiPrivacyRoot .upapi-modal-close-icon {
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: var(--upapi-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}

#upapiPrivacyRoot .upapi-modal-close-icon:hover {
    color: var(--upapi-text);
    background: #e2e8f0;
}

#upapiPrivacyRoot .upapi-modal-body {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    max-height: 460px;
}

#upapiPrivacyRoot .upapi-modal-body-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#upapiPrivacyRoot .upapi-modal-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#upapiPrivacyRoot .upapi-modal-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    padding-bottom: 6px;
    border-bottom: 2px solid #e2e8f0;
}

#upapiPrivacyRoot .upapi-modal-section-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    background: #e0f2fe;
    color: #0369a1;
}

#upapiPrivacyRoot .upapi-modal-file-group {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#upapiPrivacyRoot .upapi-modal-file-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 750;
    color: #334155;
    padding-bottom: 8px;
    border-bottom: 1px dashed #cbd5e1;
}

#upapiPrivacyRoot .upapi-modal-file-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
}

#upapiPrivacyRoot .upapi-modal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#upapiPrivacyRoot .upapi-modal-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 13.5px;
    align-items: center;
}

#upapiPrivacyRoot .upapi-modal-item-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #1e3a8a;
    background: #dbeafe;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12.5px;
    text-align: center;
    white-space: nowrap;
}

#upapiPrivacyRoot .upapi-modal-item-values {
    color: #1e293b;
    line-height: 1.5;
    word-break: break-all;
    font-variant-numeric: tabular-nums;
}

#upapiPrivacyRoot .upapi-val-more {
    display: inline-block;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11.5px;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}

#upapiPrivacyRoot .upapi-modal-empty {
    text-align: center;
    color: #64748b;
    padding: 24px 0;
}

#upapiPrivacyRoot .upapi-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 14px 24px;
    border-top: 1px solid var(--upapi-line);
    background: #f8fafc;
}

#upapiPrivacyRoot .upapi-modal-close-btn {
    height: 40px;
    padding: 0 20px;
    border: 1px solid var(--upapi-line);
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

#upapiPrivacyRoot .upapi-modal-close-btn:hover { background: #f1f5f9; }

/* =========================================================================
   검사 중 로딩 (추가)
   ========================================================================= */
#upapiPrivacyRoot .upapi-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20020;
    padding: 20px;
}

#upapiPrivacyRoot .upapi-loading-overlay.active { display: flex; }

#upapiPrivacyRoot .upapi-loading-box {
    min-width: 280px;
    padding: 28px 32px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
    text-align: center;
}

#upapiPrivacyRoot .upapi-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid #dbeafe;
    border-top-color: var(--upapi-primary);
    border-radius: 50%;
    animation: upapiSpin 0.9s linear infinite;
}

@keyframes upapiSpin { to { transform: rotate(360deg); } }

#upapiPrivacyRoot .upapi-loading-text {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.7;
    color: var(--upapi-text);
}

@media (max-width: 600px) {
    #upapiPrivacyRoot .upapi-block-overlay { padding: 18px 12px; }
    #upapiPrivacyRoot .upapi-block-card { padding: 32px 22px 30px; border-radius: 16px; }
    #upapiPrivacyRoot .upapi-illustration { width: min(88%, 350px); }
    #upapiPrivacyRoot .upapi-modal-item { grid-template-columns: 1fr; gap: 6px; }
    #upapiPrivacyRoot .upapi-actions { flex-wrap: wrap; }
    #upapiPrivacyRoot .upapi-back-button { width: 100%; }
}
