/* ==========================================================================
   HTMX UX: 토스트 알림, 로딩 인디케이터, 트랜지션
   ========================================================================== */

/* ── 토스트 컨테이너 ── */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

/* ── 개별 토스트 ── */
.htmx-toast {
    padding: 12px 20px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    pointer-events: auto;
    animation: htmx-toast-in .3s ease-out;
    max-width: 360px;
    word-break: keep-all;
}
.htmx-toast.success { background: #28a745; }
.htmx-toast.error   { background: #dc3545; }
.htmx-toast.info    { background: #17a2b8; }
.htmx-toast.warning { background: #ffc107; color: #333; }

.htmx-toast.removing {
    animation: htmx-toast-out .3s ease-in forwards;
}

@keyframes htmx-toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes htmx-toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

/* ── HTMX 로딩 인디케이터 ── */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-block;
}

/* 기본 스피너 */
.htmx-indicator.spinner::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #999;
    border-top-color: transparent;
    border-radius: 50%;
    animation: htmx-spin .6s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

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

/* ── HTMX swap 트랜지션 ── */
.htmx-swapping {
    opacity: 0;
    transition: opacity .15s ease-out;
}
.htmx-settling {
    opacity: 1;
    transition: opacity .15s ease-in;
}
