/**
 * Empty States - 空状态样式
 *
 * 为各种空状态提供友好的视觉反馈
 *
 * @version 1.0.0
 */

/* ============================================
   基础空状态
   ============================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    min-height: 300px;
}

.empty-state__icon {
    font-size: 4rem;
    color: var(--bs-gray-400);
    margin-bottom: 1.5rem;
    line-height: 1;
}

.empty-state__icon i {
    display: block;
}

.empty-state__image {
    max-width: 200px;
    height: auto;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.empty-state__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bs-gray-800);
    margin-bottom: 0.5rem;
}

.empty-state__description {
    font-size: 0.95rem;
    color: var(--bs-gray-600);
    max-width: 400px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.empty-state__action {
    margin-top: 0.5rem;
}

.empty-state__action .btn {
    min-width: 140px;
}

/* ============================================
   空状态变体
   ============================================ */

/* 无数据 */
.empty-state--no-data .empty-state__icon {
    color: var(--bs-info);
}

/* 无搜索结果 */
.empty-state--no-results .empty-state__icon {
    color: var(--bs-warning);
}

/* 无权限 */
.empty-state--no-permission .empty-state__icon {
    color: var(--bs-danger);
}

/* 错误状态 */
.empty-state--error .empty-state__icon {
    color: var(--bs-danger);
}

/* 成功状态 */
.empty-state--success .empty-state__icon {
    color: var(--bs-success);
}

/* ============================================
   紧凑模式
   ============================================ */

.empty-state--compact {
    padding: 2rem 1rem;
    min-height: 200px;
}

.empty-state--compact .empty-state__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state--compact .empty-state__image {
    max-width: 150px;
    margin-bottom: 1rem;
}

.empty-state--compact .empty-state__title {
    font-size: 1.1rem;
}

.empty-state--compact .empty-state__description {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ============================================
   内联空状态
   ============================================ */

.empty-state--inline {
    flex-direction: row;
    text-align: left;
    padding: 1.5rem;
    min-height: auto;
}

.empty-state--inline .empty-state__icon {
    font-size: 2.5rem;
    margin-bottom: 0;
    margin-right: 1rem;
    flex-shrink: 0;
}

.empty-state--inline .empty-state__content {
    flex: 1;
}

.empty-state--inline .empty-state__description {
    margin: 0 0 1rem 0;
}

/* ============================================
   特定场景空状态
   ============================================ */

/* 购物车为空 */
.empty-state--cart {
    padding: 4rem 2rem;
}

.empty-state--cart .empty-state__icon {
    font-size: 5rem;
    color: var(--bs-gray-300);
}

/* 无收藏 */
.empty-state--favorites .empty-state__icon {
    color: var(--bs-warning);
}

/* 无通知 */
.empty-state--notifications .empty-state__icon {
    color: var(--bs-info);
}

/* 无消息 */
.empty-state--messages .empty-state__icon {
    color: var(--bs-primary);
}

/* 文件为空 */
.empty-state--files .empty-state__icon {
    color: var(--bs-secondary);
}

/* ============================================
   卡片内空状态
   ============================================ */

.card .empty-state,
.page-card .empty-state {
    min-height: 250px;
    padding: 2rem 1rem;
}

.card .empty-state__icon,
.page-card .empty-state__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ============================================
   空状态动画
   ============================================ */

.empty-state {
    animation: fadeInUp 0.5s ease;
}

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

.empty-state__icon {
    animation: scaleIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 图标脉动动画（可选） */
.empty-state--animated .empty-state__icon {
    animation: scaleIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
               pulse 2s ease-in-out infinite 1s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   响应式设计
   ============================================ */

@media (max-width: 576px) {
    .empty-state {
        padding: 2rem 1rem;
        min-height: 250px;
    }

    .empty-state__icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    .empty-state__image {
        max-width: 150px;
        margin-bottom: 1rem;
    }

    .empty-state__title {
        font-size: 1.1rem;
    }

    .empty-state__description {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }

    .empty-state--inline {
        flex-direction: column;
        text-align: center;
    }

    .empty-state--inline .empty-state__icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .empty-state__action .btn {
        width: 100%;
        min-width: auto;
    }
}

/* ============================================
   暗色模式
   ============================================ */

@media (prefers-color-scheme: dark) {
    .empty-state__icon {
        color: var(--text-secondary);
    }

    .empty-state__title {
        color: var(--text-primary);
    }

    .empty-state__description {
        color: var(--text-secondary);
    }

    .empty-state__image {
        opacity: 0.6;
        filter: brightness(0.8);
    }

    /* 变体颜色调整 */
    .empty-state--no-data .empty-state__icon {
        color: var(--primary);
    }

    .empty-state--no-results .empty-state__icon {
        color: var(--warning);
    }

    .empty-state--no-permission .empty-state__icon,
    .empty-state--error .empty-state__icon {
        color: var(--error);
    }

    .empty-state--success .empty-state__icon {
        color: var(--success);
    }
}

/* ============================================
   辅助类
   ============================================ */

/* 文本对齐 */
.empty-state--left {
    text-align: left;
    align-items: flex-start;
}

.empty-state--right {
    text-align: right;
    align-items: flex-end;
}

/* 背景变体 */
.empty-state--bg-light {
    background: var(--bs-gray-50);
    border-radius: 12px;
}

.empty-state--bordered {
    border: 2px dashed var(--bs-border-color);
    border-radius: 12px;
}

/* 移除最小高度 */
.empty-state--no-min-height {
    min-height: auto;
}

/* ============================================
   空状态列表（多个建议）
   ============================================ */

.empty-state__suggestions {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    text-align: left;
    max-width: 400px;
}

.empty-state__suggestion {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bs-gray-50);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--bs-gray-700);
    transition: all 0.2s ease;
}

.empty-state__suggestion:hover {
    background: var(--bs-gray-100);
    transform: translateX(4px);
}

.empty-state__suggestion i {
    color: var(--bs-primary);
    margin-right: 0.75rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
    .empty-state__suggestion {
        background: var(--bg-muted);
        color: var(--text-secondary);
    }

    .empty-state__suggestion:hover {
        background: var(--hover-bg);
    }
}

/* ============================================
   空状态操作组
   ============================================ */

.empty-state__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

@media (max-width: 576px) {
    .empty-state__actions {
        flex-direction: column;
        width: 100%;
    }

    .empty-state__actions .btn {
        width: 100%;
    }
}

/* ============================================
   SVG插图支持
   ============================================ */

.empty-state__illustration {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin-bottom: 1.5rem;
}

.empty-state__illustration svg {
    width: 100%;
    height: auto;
}

@media (max-width: 576px) {
    .empty-state__illustration {
        max-width: 200px;
    }
}

/* ============================================
   Reduced Motion Accessibility
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .empty-state {
        animation: none;
    }

    .empty-state__icon {
        animation: none;
    }

    .empty-state--animated .empty-state__icon {
        animation: none;
    }

    .empty-state__suggestion {
        transition: none;
    }

    .empty-state__suggestion:hover {
        transform: none;
    }
}
