/*
 * Glimmer OS · 送礼卡片美化模板 (仙气果冻·正方形版)
 * 左侧：晨雾冰蓝果冻
 * 右侧：玫瑰粉钻果冻
 */

/* ══════════════════════════════════════
   送礼卡片主容器 (正方形构图)
   ══════════════════════════════════════ */

.gift-bubble {
    position: relative !important;
    overflow: hidden !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    border-radius: 24px !important;
    padding: 16px !important;
    max-width: 160px !important;           /* 更紧凑的尺寸 */
    width: 160px !important;
    min-height: 160px !important;          /* 保持正方形 */
    box-shadow: 0 8px 24px rgba(107, 78, 88, 0.08), inset 0 2px 6px rgba(255, 255, 255, 1) !important;
    display: flex !important;
    flex-direction: column !important;     /* 垂直排列内容 */
    align-items: center !important;
    justify-content: center !important;    /* 垂直居中 */
    text-align: center !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

/* 右上角装饰圆圈 (改为柔和光晕) */
.gift-deco {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255,255,255,0) 70%) !important;
    width: 120px !important;
    height: 120px !important;
    border-radius: 50% !important;
    top: -40px !important;
    right: -40px !important;
    pointer-events: none !important;
}


/* ══════════════════════════════════════
   礼物内容区（图标 + 文字）
   ══════════════════════════════════════ */

.gift-content {
    display: flex !important;
    flex-direction: column !important;     /* 垂直排列 */
    align-items: center !important;
    width: 100% !important;
    position: relative !important;
    z-index: 2 !important;
    margin-bottom: 0 !important;
    gap: 0 !important;
}

/* 礼物图标（emoji）- 隐藏大礼物盒 */
.gift-icon {
    display: none !important;              /* 隐藏顶部大图标 */
}

/* 礼物文字信息区 */
.gift-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    flex: none !important;
}

/* 标题（"🎁 我送出了礼物" / "🎉 收到了礼物"） */
.gift-title {
    font-size: 13px !important;
    color: #6b4e58 !important;
    font-weight: 700 !important;
    margin-bottom: 2px !important;
}

/* 副标题（"送给 XXX" / "来自 XXX"） */
.gift-target {
    font-size: 11px !important;
    color: #9a8b90 !important;
}

/* 礼物名称（底部半透明底座） */
.gift-name {
    font-size: 12px !important;
    color: #6b4e58 !important;
    font-weight: 600 !important;
    margin-top: 12px !important;
    background: rgba(107, 78, 88, 0.05) !important;
    padding: 4px 12px !important;
    border-radius: 12px !important;
    width: max-content !important;
    max-width: 100% !important;
    position: relative !important;
    z-index: 2 !important;
}


/* ══════════════════════════════════════
   自己发送的礼物（右侧：玫瑰粉钻果冻）
   ══════════════════════════════════════ */

.msg-row.me .gift-bubble {
    background: linear-gradient(135deg, #ffe6ea 0%, #f5c8d0 100%) !important;
    border-color: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 8px 24px rgba(200, 150, 160, 0.35), inset 0 3px 8px rgba(255, 255, 255, 1), inset 0 -3px 8px rgba(255, 255, 255, 0.4) !important;
}

.msg-row.me .gift-title {
    color: #5a3d46 !important;
}

.msg-row.me .gift-target {
    color: #8a757b !important;
}

.msg-row.me .gift-name {
    color: #5a3d46 !important;
    background: rgba(255, 255, 255, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
}

.msg-row.me .gift-deco {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255,255,255,0) 70%) !important;
}

.msg-row.me .gift-icon {
    filter: drop-shadow(0 4px 8px rgba(200, 150, 160, 0.4)) !important;
}


/* ══════════════════════════════════════
   对方/AI发送的礼物（左侧：晨雾冰蓝果冻）
   ══════════════════════════════════════ */

.msg-row.other .gift-bubble {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 8px 24px rgba(186, 230, 253, 0.4), inset 0 3px 8px rgba(255, 255, 255, 1), inset 0 -3px 8px rgba(255, 255, 255, 0.5) !important;
}

.msg-row.other .gift-title {
    color: #334155 !important;
}

.msg-row.other .gift-target {
    color: #64748b !important;
}

.msg-row.other .gift-name {
    color: #334155 !important;
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
}

.msg-row.other .gift-deco {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255,255,255,0) 70%) !important;
}

.msg-row.other .gift-icon {
    filter: drop-shadow(0 4px 8px rgba(125, 211, 252, 0.5)) !important;
}


/* ══════════════════════════════════════
   礼物图片（如果有的话）
   ══════════════════════════════════════ */

.gift-bubble img {
    width: 56px !important;
    height: 56px !important;
    border-radius: 12px !important;
    object-fit: cover !important;
    margin-bottom: 8px !important;
    margin-top: 4px !important;
    position: relative !important;
    z-index: 2 !important;
    box-shadow: 0 4px 12px rgba(107, 78, 88, 0.15) !important;
}

/* 当有图片时，隐藏默认的 emoji 图标 */
.gift-bubble.has-img .gift-icon {
    display: none !important;
}

.msg-row.other .gift-bubble img {
    box-shadow: 0 4px 12px rgba(125, 211, 252, 0.3) !important;
}

.msg-row.me .gift-bubble img {
    box-shadow: 0 4px 12px rgba(200, 150, 160, 0.3) !important;
}


/* ══════════════════════════════════════
   暗黑模式适配
   ══════════════════════════════════════ */

body.dark-mode .msg-row.other .gift-bubble {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.5) 0%, rgba(15, 23, 42, 0.6) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .msg-row.me .gift-bubble {
    background: linear-gradient(135deg, rgba(120, 80, 90, 0.6) 0%, rgba(80, 50, 60, 0.6) 100%) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 1px 3px rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .gift-title {
    color: #e2e8f0 !important;
}

body.dark-mode .gift-target {
    color: #94a3b8 !important;
}

body.dark-mode .gift-name {
    color: #e2e8f0 !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: transparent !important;
}

body.dark-mode .gift-deco {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, rgba(255,255,255,0) 70%) !important;
}
