/* 商店系统样式 - 可爱风格 */

/* CSS变量 - 马卡龙配色 */
:root {
    /* 背景色 */
    --shop-bg-primary: #FAF9FB;
    --shop-bg-card: #FFFFFF;

    /* 主色调 - 粉紫色系 */
    --shop-color-primary: #E0B4E8;
    --shop-color-primary-dark: #C896D4;
    --shop-color-primary-light: #F2E0F5;

    /* 次要色 - 蓝色系 */
    --shop-color-secondary: #C8E4F9;
    --shop-color-secondary-dark: #A3D4F2;
    --shop-color-secondary-light: #E8F4FC;

    /* 强调色 - 黄色系 */
    --shop-color-accent: #FFF4D6;
    --shop-color-accent-dark: #FFE9B3;

    /* 成功色 - 薄荷绿 */
    --shop-color-success: #B8E6D5;
    --shop-color-success-dark: #9DD4C1;

    /* 边框和分割线 */
    --shop-border-color: #F0EEF2;
    --shop-border-light: #F8F7F9;

    /* 文字色 */
    --shop-text-primary: #5A4963;
    --shop-text-secondary: #8F7B96;
    --shop-text-muted: #C3B8C8;

    /* 圆角 */
    --shop-radius-sm: 12px;
    --shop-radius-md: 16px;
    --shop-radius-lg: 24px;
    --shop-radius-xl: 28px;
}

/* 金币显示 */
.coins-display {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--shop-bg-card);
    padding: 8px 16px;
    border-radius: var(--shop-radius-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--shop-text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--shop-border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.coins-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.coins-icon {
    font-size: 20px;
}

.coins-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--shop-color-accent-dark);
}

/* 商店面板 - 背景遮罩 */
.shop-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(90, 73, 99, 0.4); /* 使用主题色调的半透明背景 */
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.shop-panel.active {
    display: flex;
}

/* 商店容器 - 纯白卡片 */
.shop-container {
    background: var(--shop-bg-card);
    border-radius: var(--shop-radius-xl);
    padding: 32px;
    max-width: 1000px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(90, 73, 99, 0.15);
    border: 1px solid var(--shop-border-color);
    animation: scaleIn 0.3s ease-out;

    /* 隐藏滚动条 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* 隐藏滚动条 - Webkit浏览器 */
.shop-container::-webkit-scrollbar {
    display: none;
}

/* 商店头部 */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--shop-border-color);
}

.shop-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.shop-title h2 {
    font-size: 28px;
    margin: 0;
    color: var(--shop-text-primary);
    font-weight: 700;
}

/* 余额显示 */
.shop-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--shop-color-accent);
    padding: 10px 18px;
    border-radius: var(--shop-radius-md);
    border: 1px solid var(--shop-color-accent-dark);
    box-shadow: 0 2px 6px rgba(255, 233, 179, 0.3);
}

.shop-balance-icon {
    font-size: 24px;
}

.shop-balance-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--shop-text-primary);
}

/* 关闭按钮 */
.shop-close {
    background: var(--shop-bg-card);
    border: 1px solid var(--shop-border-color);
    color: var(--shop-text-secondary);
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: var(--shop-radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.shop-close:hover {
    background: var(--shop-color-primary-light);
    border-color: var(--shop-color-primary);
    color: var(--shop-color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(224, 180, 232, 0.2);
}

/* 每日特惠 */
.shop-daily-deals {
    margin-bottom: 32px;
}

.shop-section-title {
    font-size: 20px;
    color: var(--shop-text-primary);
    margin-bottom: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.daily-deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* 每日特惠卡片 */
.daily-deal-card {
    background: linear-gradient(135deg, var(--shop-color-accent-dark) 0%, var(--shop-color-accent) 100%);
    border: 2px solid var(--shop-color-accent-dark);
    border-radius: var(--shop-radius-lg);
    padding: 20px;
    position: relative;
    overflow: visible;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 233, 179, 0.2);
}

.daily-deal-card::before {
    content: '⚡ 特惠';
    position: absolute;
    top: 12px;
    right: -8px;
    background: var(--shop-color-primary);
    color: white;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(224, 180, 232, 0.4);
    z-index: 1;
}

.daily-deal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(255, 233, 179, 0.3);
    border-color: var(--shop-color-primary);
}

/* 商品网格 */
.shop-products {
    margin-top: 32px;
}

.shop-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* 商品卡片 - 纯白背景 */
.product-card {
    background: var(--shop-bg-card);
    border: 1px solid var(--shop-border-color);
    border-radius: var(--shop-radius-lg);
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(90, 73, 99, 0.08);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(90, 73, 99, 0.12);
    border-color: var(--shop-color-primary-light);
}

.product-card.affordable {
    border-color: var(--shop-color-success);
}

.product-card.affordable:hover {
    border-color: var(--shop-color-success-dark);
    box-shadow: 0 8px 20px rgba(184, 230, 213, 0.3);
}

.product-card.not-affordable {
    opacity: 0.5;
    filter: grayscale(0.3);
}

.product-card.not-affordable:hover {
    transform: translateY(0);
}

/* 商品图标容器 */
.product-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 12px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--shop-text-primary);
    text-align: center;
    margin-bottom: 8px;
}

.product-description {
    font-size: 13px;
    color: var(--shop-text-muted);
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.5;
}

.product-price-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--shop-color-accent-dark);
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-price-icon {
    font-size: 18px;
}

.product-original-price {
    font-size: 14px;
    color: var(--shop-text-muted);
    text-decoration: line-through;
}

/* 折扣徽章 */
.product-discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--shop-color-primary);
    color: white;
    padding: 4px 10px;
    border-radius: var(--shop-radius-sm);
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(224, 180, 232, 0.3);
}

/* 购买按钮 */
.product-buy-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--shop-color-success) 0%, var(--shop-color-success-dark) 100%);
    border: none;
    color: var(--shop-text-primary);
    padding: 12px;
    border-radius: var(--shop-radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(184, 230, 213, 0.2);
}

.product-buy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(184, 230, 213, 0.4);
}

.product-buy-btn:disabled {
    background: var(--shop-border-light);
    color: var(--shop-text-muted);
    cursor: not-allowed;
    box-shadow: none;
}


/* 购买成功通知 */
.purchase-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    animation: slideDownIn 0.5s ease-out;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.95), rgba(67, 160, 71, 0.95));
    padding: 20px 30px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.purchase-notification.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

.purchase-icon {
    font-size: 40px;
}

.purchase-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.purchase-title {
    font-size: 16px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.purchase-text {
    font-size: 20px;
    font-weight: bold;
    color: white;
}

/* 金币奖励通知 */
.coin-reward-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    animation: rewardPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.98), rgba(255, 193, 7, 0.98));
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(255, 215, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

@keyframes rewardPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.coin-reward-notification.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

.reward-icon {
    font-size: 64px;
    animation: coinBounce 0.8s ease-in-out infinite;
}

@keyframes coinBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.reward-info {
    color: #1a1a2e;
}

.reward-title {
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.reward-amount {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
}

.reward-breakdown {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
}

.reward-breakdown div {
    margin: 2px 0;
}

/* 空状态 */
.shop-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.shop-empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.shop-empty-text {
    font-size: 18px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .shop-container {
        padding: 20px;
        width: 95%;
    }

    .shop-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .shop-title h2 {
        font-size: 28px;
    }

    .shop-products-grid,
    .daily-deals-grid {
        grid-template-columns: 1fr;
    }

    .coins-display {
        top: 10px;
        right: 10px;
        padding: 8px 15px;
        font-size: 16px;
    }

    .coins-icon {
        font-size: 20px;
    }

    .coins-amount {
        font-size: 18px;
    }

    .coin-reward-notification {
        padding: 20px 25px;
        max-width: 90%;
    }

    .reward-icon {
        font-size: 48px;
    }

    .reward-amount {
        font-size: 28px;
    }
}
