/*
 * shared.css - FocusBooksFrontShare 공유 전역 스타일
 * 기능: Web·Client 양쪽에서 공통으로 사용하는 서브 페이지 레이아웃(sub-*) 클래스 정의
 * 영향: FocusBooksWeb(App.razor)·FocusBooksClient(index.html)에서 _content/FocusBooksFrontShare/css/shared.css 로 참조
 * 참조: FocusBooksWeb/wwwroot/css/app.css, FocusBooksClient/wwwroot/css/app.css
 */

/* ═══════════════════════════════════════════════════════════════════════
   서브 페이지 공통 레이아웃 (sub-*)
   Setting / Account / MediaSlot / HowToUse / Coupon / Music 공유 구조.
   색상·배경은 각 페이지별 .razor.css 에서 정의한다.
   ═══════════════════════════════════════════════════════════════════════ */

/* SVG fill 내부 외곽선과 stroke underlay의 Web·MAUI 공용 계약.
 * fill overlay는 전처리 markup의 fb-fill-outline-N 클래스가 담당하고, 원본 stroke는
 * draw-outline-N wrapper가 있을 때만 전처리된 내부 폭으로 줄인다. */
.fb-fill-outline-0 { stroke: var(--draw-outline-color-0, transparent); }
.fb-fill-outline-1 { stroke: var(--draw-outline-color-1, transparent); }
.fb-fill-outline-2 { stroke: var(--draw-outline-color-2, transparent); }
.fb-fill-outline-3 { stroke: var(--draw-outline-color-3, transparent); }
.fb-fill-outline-4 { stroke: var(--draw-outline-color-4, transparent); }
.fb-fill-outline-5 { stroke: var(--draw-outline-color-5, transparent); }

[class^="fb-fill-outline-"],
[class*=" fb-fill-outline-"] {
    fill: none;
    stroke-width: 12px;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.draw-outline-0 .fb-draw-color-0 { stroke-width: var(--fb-draw-inner-width-0) !important; }
.draw-outline-1 .fb-draw-color-1 { stroke-width: var(--fb-draw-inner-width-1) !important; }
.draw-outline-2 .fb-draw-color-2 { stroke-width: var(--fb-draw-inner-width-2) !important; }
.draw-outline-3 .fb-draw-color-3 { stroke-width: var(--fb-draw-inner-width-3) !important; }
.draw-outline-4 .fb-draw-color-4 { stroke-width: var(--fb-draw-inner-width-4) !important; }
.draw-outline-5 .fb-draw-color-5 { stroke-width: var(--fb-draw-inner-width-5) !important; }

/* 페이지 컨테이너 — 고정 전체화면, flex 컬럼 */
.sub-page {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
}

/* 상단 헤더 — 반투명 회색 배경 + blur */
.sub-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: calc(var(--safe-area-inset-top, 0px) + 12px) 16px 12px;
    min-height: 56px;
    flex-shrink: 0;
    background: rgba(236, 236, 241, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

/* 뒤로가기 버튼 — 원형 40px */
.sub-back-btn {
    background: rgba(0, 0, 0, 0.06);
    color: #1c1c1e;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    transition: background 0.2s;
}
.sub-back-btn:hover { background: rgba(0, 0, 0, 0.1); }

/* 헤더 제목 */
.sub-header-title {
    flex: 1;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* 헤더 우측 여백 (좌우 대칭 유지) */
.sub-header-spacer {
    width: 40px;
    flex-shrink: 0;
}

/* 스크롤 콘텐츠 영역 */
.sub-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 섹션 레이블 (UPPERCASE 소제목) */
.sub-section-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 4px;
}

/* 카드 컨테이너 — 흰색, 경계선, 둥근 모서리 */
.sub-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

/* 상단 컨텐츠 패널 — 흰색 배경, 상하 경계 + 그림자 */
.sub-top-panel {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* 뱃지 기본 구조 */
.sub-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 10px;
}

/* 뱃지 색상 변형 */
.sub-badge-gray  { background: #f0f0f0; border: 1px solid #ddd;     color: #888; }
.sub-badge-green { background: #e8f5e9; border: 1px solid #a5d6a7;  color: #2e7d32; }
.sub-badge-amber { background: #fff8e1; border: 1px solid #ffe082;  color: #f57f17; }
.sub-badge-blue  { background: #e3f2fd; border: 1px solid #90caf9;  color: #1565c0; }

/* 토스트 메시지 */
.sub-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a1a;
    color: #fff;
    padding: 11px 22px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1000;
    transition: transform 0.3s, opacity 0.3s;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}
.sub-toast-show { transform: translateX(-50%) translateY(0); opacity: 1; }
.sub-toast-hide { transform: translateX(-50%) translateY(100px); opacity: 0; }

/* ─── 모달 공통 ──────────────────────────────────────────── */

/* 오버레이 배경 */
.sub-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: sub-fade-in 0.15s ease;
}

@keyframes sub-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* 다이얼로그 박스 */
.sub-dialog {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    width: min(320px, 90vw);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.sub-dialog-title {
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    color: #1A1A1A;
    margin: 0;
}

.sub-dialog-message {
    font-size: 14px;
    text-align: center;
    color: #555;
    line-height: 1.5;
    margin: 0;
}

.sub-dialog-btns {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.sub-dialog-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.sub-dialog-btn:active { opacity: 0.8; }

/* ─── 로딩 스피너 (전역) ─────────────────────────────────── */

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #AEE3FF;
    border-radius: 50%;
    animation: sub-spin 0.8s linear infinite;
}

.loading-spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-top-color: #fff;
}

@keyframes sub-spin {
    to { transform: rotate(360deg); }
}

/*
기능: 정적 정책 문서(개인정보처리방침·이용약관) 팝업의 공통 스타일.
영향: 컴포넌트 스코프 CSS 는 컴포넌트마다 따로 적용되므로 공유 스타일은 전역에 둔다.
참조: PolicyDialog.razor
*/
.policy-dialog {
    width: min(920px, calc(100vw - 24px));
    height: min(840px, calc(100dvh - 24px));
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgb(0 0 0 / 35%);
    overflow: hidden;
}

.policy-dialog::backdrop { background: rgb(0 0 0 / 55%); }

.policy-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    color: #111827;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.policy-dialog-header h2 { margin: 0; font-size: 18px; }

.policy-dialog-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    color: #111827;
    background: #f3f4f6;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.policy-dialog-frame { display: block; width: 100%; height: calc(100% - 69px); border: 0; background: #fff; }

.policy-dialog-error { margin: 24px; color: #b91c1c; line-height: 1.6; }

@media (max-width: 520px) {
    .policy-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
}

/*
기능: 정적 정책 문서 공개 호환 경로(/privacy, /account-delete)의 전체 화면 레이아웃.
영향: 컴포넌트 스코프 CSS 는 페이지마다 따로 적용되므로 공유 스타일은 전역에 둔다.
참조: Privacy.razor, AccountDelete.razor
*/
.policy-page {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    background: #fff;
}

.policy-page h1 {
    margin: 0;
    padding: calc(var(--safe-area-inset-top, 0px) + 16px) 20px 16px;
    color: #111827;
    font-size: 22px;
}

.policy-page-frame { flex: 1; width: 100%; border: 0; background: #fff; }

.policy-page-error { margin: 24px; color: #b91c1c; line-height: 1.6; }
