/**
 * overlays.css - 화면 전역에 얹히는 오버레이 컴포넌트
 * 토스트, 바텀시트(상세/수정/삭제확인/로그아웃확인 공통), 오프라인 배너.
 */

/* ---------------- 토스트 ---------------- */
#toast-container {
    position: fixed;
    left: 50%;
    bottom: 1.2rem;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: var(--surface);
    color: var(--text-primary);
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.5;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    border-left: 3px solid var(--success);
    width: 260px;
    box-sizing: border-box;
    white-space: normal;
    text-align: left;
    word-break: keep-all;
    overflow-wrap: break-word;
    pointer-events: auto;
}
.toast svg {
    width: 15px;
    height: 15px;
    color: var(--success);
    flex-shrink: 0;
    margin-top: 0.15rem;
}
.toast.error {
    border-left-color: var(--danger);
}
.toast.error svg {
    color: var(--danger);
}
@media (prefers-reduced-motion: no-preference) {
    .toast {
        animation: toastIn 0.25s ease-out;
    }
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------------- 바텀시트 (상세보기 / 수정 / 삭제확인 / 로그아웃확인 공통) ---------------- */
@media (prefers-reduced-motion: no-preference) {
    .sheet-backdrop { transition: opacity 0.25s ease; }
    .sheet { transition: transform 0.32s cubic-bezier(0.25, 0.8, 0.35, 1); }
}
.sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 18, 0.35);
    opacity: 0;
    pointer-events: none;
    z-index: 30;
}
.sheet-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}
.sheet {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    padding: 1.1rem 1.2rem 1.3rem;
    transform: translateY(100%);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
    z-index: 31;
}
.sheet.open {
    transform: translateY(0);
}
.sheet .grabber {
    width: 36px;
    height: 4px;
    border-radius: 99px;
    background: var(--border-color);
    margin: 0 auto 0.9rem;
}
.sheet .close-x {
    position: absolute;
    top: 0.9rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
}
.sheet .msg-full {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}
.sheet .meta {
    font-size: 0.74rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.sheet .sheet-actions {
    display: flex;
    gap: 0.6rem;
}
.sheet .sheet-actions button {
    flex: 1;
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: var(--bg);
    color: var(--text-primary);
    cursor: pointer;
}
.sheet .sheet-actions button.danger {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}
.sheet .sheet-actions button:active,
.sheet .close-x:active {
    transform: scale(0.95);
}

/* 삭제/로그아웃 등 컨펌 전용 서브 컴포넌트 (sheet 내부에서 사용) */
.confirm-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--danger) 14%, var(--surface));
    color: var(--danger);
    margin: 0 auto 1rem;
}
.confirm-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.4rem;
}
.confirm-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 1.3rem;
    line-height: 1.6;
}

/* ---------------- 오프라인 배너 ---------------- */
.offline-banner {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.9rem;
    background: var(--warning);
    color: #fff9ef;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}
.offline-banner svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
@media (prefers-reduced-motion: no-preference) {
    .offline-banner svg {
        animation: offlinePulse 1.4s ease-in-out infinite;
    }
}
@keyframes offlinePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
[data-theme="dark"] .offline-banner {
    color: #241a06;
}
