/* BankFlow - 모달 & 토스트 (v2 — Modern SaaS) */

/* ── 모달 ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--bf-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--bf-transition), visibility var(--bf-transition);
    padding: var(--bf-space-4);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--bf-bg-modal);
    border-radius: var(--bf-radius-2xl);
    box-shadow: var(--bf-shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(12px) scale(0.97);
    transition: transform var(--bf-transition-slow);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--bf-space-5) var(--bf-space-6);
    border-bottom: 1px solid var(--bf-border-light);
}

.modal-title {
    font-size: var(--bf-text-lg);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bf-text-muted);
    border-radius: var(--bf-radius);
    transition: all var(--bf-transition);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.25rem;
}

.modal-close:hover {
    color: var(--bf-text);
    background-color: var(--bf-bg-hover);
}

.modal-body {
    padding: var(--bf-space-5) var(--bf-space-6);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--bf-space-3);
    padding: var(--bf-space-4) var(--bf-space-6);
    border-top: 1px solid var(--bf-border-light);
}

/* ── 토스트 알림 ── */
.toast-container {
    position: fixed;
    top: var(--bf-space-5);
    right: var(--bf-space-5);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--bf-space-3);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--bf-space-3);
    padding: var(--bf-space-4) var(--bf-space-5);
    background-color: var(--bf-bg-card);
    border-radius: var(--bf-radius-xl);
    box-shadow: var(--bf-shadow-lg);
    min-width: 320px;
    max-width: 440px;
    animation: toastSlideIn 0.35s var(--bf-transition);
    border: 1px solid var(--bf-border);
}

.toast.removing {
    animation: toastSlideOut 0.25s ease forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.toast-success .toast-icon { color: var(--bf-success); }
.toast-error .toast-icon   { color: var(--bf-danger); }
.toast-warning .toast-icon { color: var(--bf-warning); }
.toast-info .toast-icon    { color: var(--bf-info); }

/* 좌측 컬러바 대신 아이콘 배경 */
.toast-success { background: linear-gradient(90deg, var(--bf-success-light) 0%, var(--bf-bg-card) 40px); }
.toast-error   { background: linear-gradient(90deg, var(--bf-danger-light) 0%, var(--bf-bg-card) 40px); }
.toast-warning { background: linear-gradient(90deg, var(--bf-warning-light) 0%, var(--bf-bg-card) 40px); }
.toast-info    { background: linear-gradient(90deg, var(--bf-info-light) 0%, var(--bf-bg-card) 40px); }

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: var(--bf-text-sm);
    font-weight: 600;
    color: var(--bf-text);
}

.toast-message {
    flex: 1;
    font-size: var(--bf-text-sm);
    color: var(--bf-text-secondary);
    line-height: 1.5;
}

.toast-close {
    color: var(--bf-text-muted);
    padding: 2px;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: var(--bf-radius-sm);
    transition: all var(--bf-transition);
    background: none;
    border: none;
}

.toast-close:hover {
    color: var(--bf-text);
    background: var(--bf-bg-hover);
}

/* 토스트 진행 바 */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 var(--bf-radius-xl) var(--bf-radius-xl);
    animation: toastProgress 4s linear forwards;
}

.toast-success .toast-progress { background: var(--bf-success); }
.toast-error .toast-progress   { background: var(--bf-danger); }
.toast-warning .toast-progress { background: var(--bf-warning); }
.toast-info .toast-progress    { background: var(--bf-info); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(40px) scale(0.95); }
}

@keyframes toastProgress {
    from { width: 100%; }
    to   { width: 0%; }
}

/* ── 스켈레톤 로딩 ── */
.skeleton {
    background: linear-gradient(90deg, var(--bf-bg-hover) 25%, var(--bf-bg-active) 50%, var(--bf-bg-hover) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--bf-radius);
}

.skeleton-text {
    height: 14px;
    margin-bottom: var(--bf-space-2);
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: var(--bf-space-3);
}

.skeleton-card {
    height: 120px;
    border-radius: var(--bf-radius-xl);
}

.skeleton-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── 페이지 전환 ── */
.page-enter {
    animation: pageEnter 0.3s var(--bf-transition);
}

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