/* components.css 분할 _feedback.css — Footer · Empty State · Skeleton · Loading · Toast · Bottom Sheet */
/* ========================================
   Footer Component
   ======================================== */

.site-footer {
    margin-top: var(--spacing-4xl);
    padding: var(--spacing-2xl) var(--spacing-xl);
    text-align: center;
    border-top: 1px solid var(--color-border-light);
    background: var(--color-bg-secondary);
}

.site-footer__links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-xs);
}

.site-footer__links a {
    color: var(--color-text-secondary);
}

.site-footer__links a:hover {
    opacity: 0.7;
}

.site-footer__copyright {
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}


/* ========================================
   Empty State (Generic)
   ======================================== */

.empty-state {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--color-border);
}

.empty-state__icon {
    font-size: 48px;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
}

.empty-state__title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

.empty-state__description {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}


/* ========================================
   Skeleton Loading
   ======================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-secondary) 25%,
        var(--color-border-light) 37%,
        var(--color-bg-secondary) 63%
    );
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
    border-radius: var(--radius-sm);
}

.skeleton--text {
    height: 16px;
    width: 100%;
    margin-bottom: var(--spacing-sm);
}

.skeleton--text-sm {
    height: 12px;
    width: 60%;
}

.skeleton--circle {
    border-radius: 50%;
}

.skeleton--card {
    height: 140px;
    border-radius: var(--radius-lg);
}

.skeleton--input {
    height: 44px;
    width: 100%;
}

@keyframes skeleton-loading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}


/* ========================================
   Floating Button Loading State
   사용법:
   <button class="btn btn--loading" disabled>
       <span class="btn__spinner"></span>
       <span class="btn__loading-text">저장 중...</span>
   </button>
   ======================================== */

.btn--loading {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    pointer-events: none;
    opacity: 0.85;
}

.btn__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    flex-shrink: 0;
}

.btn__loading-text {
    font-size: var(--font-size-sm);
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}


/* ========================================
   Full-screen Loading Overlay
   사용법:
   Loading.start('처리 중...')  — 오버레이 표시
   Loading.stop()              — 오버레이 제거
   ======================================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-index-modal) + 20);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    background-color: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.loading-overlay.is-visible {
    opacity: 1;
}

.loading-overlay__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--color-border-light);
    border-top-color: var(--color-black-normal);
    border-radius: 50%;
    animation: loading-overlay-spin 0.7s linear infinite;
}

.loading-overlay__text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: 500;
}

@keyframes loading-overlay-spin {
    to { transform: rotate(360deg); }
}


/* ========================================
   Toast Notification
   ======================================== */

.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: calc(var(--z-index-modal) + 10);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    box-shadow: var(--box-shadow-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    pointer-events: auto;
    animation: toastSlideIn 0.3s var(--ease-3);
    max-width: 360px;
}

.toast--success {
    border-color: var(--color-green);
}

.toast--success .toast__icon {
    color: var(--color-green);
}

.toast--error {
    border-color: var(--color-red);
}

.toast--error .toast__icon {
    color: var(--color-red);
}

.toast--info {
    border-color: var(--color-blue);
}

.toast--info .toast__icon {
    color: var(--color-blue);
}

.toast__icon {
    flex-shrink: 0;
}

/* Lucide SVG 아이콘 지원 */
.toast__icon svg,
svg.toast__icon {
    width: 20px;
    height: 20px;
    stroke-width: 1.75;
}

.toast__message {
    flex: 1;
}

.toast--removing {
    animation: toastSlideOut 0.2s var(--ease-3) forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ========================================
   Bottom Sheet Component
   공용 바텀 시트 (모바일 액션 시트)
   ======================================== */

.bottom-sheet {
    position: fixed;
    inset: 0;
    z-index: var(--z-index-modal);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s 0.3s;
}

.bottom-sheet.is-open {
    visibility: visible;
    pointer-events: auto;
    transition: visibility 0s 0s;
}

.bottom-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: var(--color-overlay);
    opacity: 0;
    transition: opacity 0.25s var(--ease-3);
}

.bottom-sheet.is-open .bottom-sheet__backdrop {
    opacity: 1;
}

.bottom-sheet__content {
    position: relative;
    width: 100%;
    max-width: var(--content-max-width);
    background: var(--color-bg-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 0 0 env(safe-area-inset-bottom, 0);
    transform: translateY(100%);
    transition: transform 0.3s var(--ease-3);
    max-height: 80vh;
    overflow-y: auto;
}

.bottom-sheet.is-open .bottom-sheet__content {
    transform: translateY(0);
}

.bottom-sheet__handle {
    width: 36px;
    height: 4px;
    background: var(--color-border-dark);
    border-radius: 2px;
    margin: var(--spacing-sm) auto var(--spacing-xs);
}

.bottom-sheet__title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-text-primary);
    padding: var(--spacing-xs) var(--spacing-lg) var(--spacing-md);
}

.bottom-sheet__body {
    padding: 0 var(--spacing-lg) var(--spacing-2xl);
}

.bottom-sheet__option {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    padding: var(--spacing-md) 0;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text-primary);
    font-size: var(--font-size-md);
    transition: background 0.1s;
}

.bottom-sheet__option:last-child {
    /* no special styling needed */
}

.bottom-sheet__option:active {
    background: var(--color-bg-secondary);
}

.bottom-sheet__option-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    color: var(--color-text-primary);
    flex-shrink: 0;
}

.bottom-sheet__option-icon.bottom-sheet__option-icon--svg {
    background: transparent;
}

/* 커스텀 SVG 아이콘 — 컨테이너 내 크기 제어 (currentColor 상속) */
.bottom-sheet__option-icon--svg .menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* 그리드 모드에서는 살짝 더 작게 */
.bottom-sheet__body--grid .bottom-sheet__option-icon--svg .menu-icon {
    width: 18px;
    height: 18px;
}

.bottom-sheet__option-text {
    flex: 1;
    text-align: left;
}

.bottom-sheet__option-label {
    font-weight: 500;
    display: block;
}

.bottom-sheet__option-desc {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-top: var(--spacing-micro);
    display: block;
}

.bottom-sheet__option--danger {
    color: var(--color-red);
}

.bottom-sheet__option--danger .bottom-sheet__option-icon {
    color: var(--color-red);
    background: none;
}

/* Bottom Sheet - 커스텀 헤더 */
.bottom-sheet__header {
    padding: 0 var(--spacing-md);
}

/* Bottom Sheet - 공유 기간 선택 안내 문구 */
.share-ttl-note {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* Bottom Sheet - 임시저장 안내 */
.bottom-sheet__draft-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    text-decoration: none;
}

.bottom-sheet__draft-notice-text {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-primary);
}

.bottom-sheet__draft-notice-link {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-blue);
    white-space: nowrap;
}

/* Bottom Sheet - 답변 유형 선택 안내 (자율선택 질문 카드 진입 시) */
.bottom-sheet__answer-prompt {
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--color-text-primary);
    font-size: var(--font-size-md);
    font-weight: 600;
    text-align: center;
}

/* Bottom Sheet - 2열 그리드 레이아웃 (아이콘 좌측 + 텍스트 우측, 가로 배치) */
.bottom-sheet__body--grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-2xl);
}

.bottom-sheet__body--grid .bottom-sheet__option {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-sm);
    border-radius: var(--radius-md);
    background: var(--color-bg-secondary);
}

.bottom-sheet__body--grid .bottom-sheet__option:hover {
    background: var(--color-bg-tertiary);
}

.bottom-sheet__body--grid .bottom-sheet__option-icon {
    width: 28px;
    height: 28px;
    font-size: 22px;
    flex-shrink: 0;
    background: none;
}

.bottom-sheet__body--grid .bottom-sheet__option-text {
    text-align: left;
}
