/**
 * 会议总结功能样式 - 高级版
 *
 * 包含:
 * - AI 流光动画效果 (ai-shimmer)
 * - 毛玻璃效果 (glassmorphism)
 * - 生成总结按钮
 * - 总结卡片展开/收起
 * - 精致的微交互动画
 */

/* ========== 核心动画定义 ========== */

/* AI 流光扫过效果 - 更流畅 */
@keyframes ai-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 渐变边框旋转效果 */
@keyframes ai-border-glow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* 总结出现动画 - 更有弹性 */
@keyframes summary-appear {
    0% {
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* 成功发光脉冲 - 更明显 */
@keyframes summary-success-glow {
    0% {
        box-shadow:
            0 0 0 0 rgba(16, 185, 129, 0.5),
            0 4px 20px rgba(16, 185, 129, 0.2);
    }
    50% {
        box-shadow:
            0 0 0 12px rgba(16, 185, 129, 0.1),
            0 4px 30px rgba(16, 185, 129, 0.3);
    }
    100% {
        box-shadow:
            0 0 0 0 rgba(16, 185, 129, 0),
            0 4px 20px rgba(16, 185, 129, 0);
    }
}

/* 加载点脉冲 */
@keyframes dot-pulse {
    0%, 80%, 100% {
        transform: scale(0.5);
        opacity: 0.3;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 图标闪烁 - 更有层次 */
@keyframes icon-sparkle {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 3px rgba(167, 139, 250, 0.6));
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        filter: drop-shadow(0 0 12px rgba(167, 139, 250, 1));
        transform: scale(1.1);
    }
}

/* 文字渐显动画 */
@keyframes text-reveal {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 图标旋转 */
@keyframes ai-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== 总结区域容器 ========== */

.meeting-summary-section {
    margin-top: var(--space-3);
    position: relative;
}

/* ========== 生成总结按钮 - 高级版 ========== */

.btn-generate-summary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 50%, #667EEA 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow:
        0 4px 15px rgba(102, 126, 234, 0.35),
        0 2px 4px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

/* 按钮光泽效果 */
.btn-generate-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s ease;
}

.btn-generate-summary:hover::before {
    left: 100%;
}

.btn-generate-summary svg {
    width: 18px;
    height: 18px;
    stroke: white;
    fill: rgba(255, 255, 255, 0.25);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.btn-generate-summary:hover {
    transform: translateY(-3px) scale(1.02);
    background-position: 100% 100%;
    box-shadow:
        0 8px 25px rgba(102, 126, 234, 0.45),
        0 4px 10px rgba(118, 75, 162, 0.3),
        0 0 40px rgba(167, 139, 250, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-generate-summary:hover svg {
    transform: rotate(72deg) scale(1.15);
    fill: rgba(255, 255, 255, 0.5);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

.btn-generate-summary:active {
    transform: scale(0.98) translateY(0);
    box-shadow:
        0 2px 8px rgba(102, 126, 234, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 按钮加载状态 */
.btn-generate-summary.loading {
    pointer-events: none;
    opacity: 0.9;
}

.btn-generate-summary.loading svg {
    animation: ai-spin 1s linear infinite;
}

/* ========== 总结卡片 - 毛玻璃高级版 ========== */

.summary-card {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(248, 250, 255, 0.85) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow:
        0 4px 24px rgba(102, 126, 234, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.summary-card:hover {
    border-color: rgba(167, 139, 250, 0.35);
    box-shadow:
        0 8px 32px rgba(102, 126, 234, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* 生成中状态 - 炫酷流光效果 */
.summary-card.generating {
    background: linear-gradient(
        135deg,
        rgba(129, 140, 248, 0.1) 0%,
        rgba(167, 139, 250, 0.15) 50%,
        rgba(196, 181, 253, 0.1) 100%
    );
    border-color: transparent;
}

/* 流光扫过遮罩 - 更强烈 */
.summary-card.generating::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(102, 126, 234, 0.2) 15%,
        rgba(167, 139, 250, 0.35) 50%,
        rgba(102, 126, 234, 0.2) 85%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: ai-shimmer 1.8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* 发光边框效果 - 更炫酷 */
.summary-card.generating::after {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(
        135deg,
        #667EEA 0%,
        #764BA2 25%,
        #A78BFA 50%,
        #764BA2 75%,
        #667EEA 100%
    );
    background-size: 400% 400%;
    animation: ai-border-glow 2.5s ease infinite;
    border-radius: calc(var(--radius-xl) + 3px);
    z-index: -1;
    opacity: 0.75;
    filter: blur(6px);
}

/* 成功状态 */
.summary-card.success {
    animation: summary-appear 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.summary-card.just-generated {
    animation: summary-success-glow 1s ease-out;
}

/* 展开/收起状态 */
.summary-card.collapsed .summary-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.summary-card.expanded .summary-content {
    max-height: 400px;
    overflow-y: auto;
    opacity: 1;
}

/* ========== 卡片头部 - 精致版 ========== */

.summary-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 2;
    transition: all 0.25s ease;
}

.summary-card-header:hover {
    background: linear-gradient(
        90deg,
        rgba(167, 139, 250, 0.06) 0%,
        rgba(129, 140, 248, 0.04) 100%
    );
}

.summary-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #818CF8 0%, #A78BFA 50%, #C4B5FD 100%);
    border-radius: var(--radius-md);
    flex-shrink: 0;
    box-shadow:
        0 4px 12px rgba(129, 140, 248, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.summary-card:hover .summary-card-icon {
    transform: scale(1.05);
    box-shadow:
        0 6px 16px rgba(129, 140, 248, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.summary-card-icon svg {
    width: 18px;
    height: 18px;
    stroke: white;
    fill: rgba(255, 255, 255, 0.35);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* 生成中图标动画 */
.summary-card.generating .summary-card-icon {
    animation: icon-sparkle 1.2s ease-in-out infinite;
}

.summary-card.generating .summary-card-icon svg {
    animation: ai-spin 2s linear infinite;
}

.summary-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--neutral-800);
    flex-shrink: 0;
    letter-spacing: 0.2px;
}

.summary-preview {
    flex: 1;
    font-size: 13px;
    color: var(--neutral-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: var(--space-2);
    font-weight: 400;
}

.summary-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(167, 139, 250, 0.08);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    margin-left: auto;
}

.summary-toggle-btn:hover {
    background: rgba(167, 139, 250, 0.15);
    transform: scale(1.1);
}

.summary-toggle-icon {
    width: 16px;
    height: 16px;
    stroke: var(--ai-lavender);
    stroke-width: 2.5;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.summary-card.expanded .summary-toggle-icon {
    transform: rotate(180deg);
}

/* ========== 加载状态 - 更精致 ========== */

.summary-loading-text {
    font-size: 14px;
    color: var(--color-purple);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.summary-loading-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
}

.summary-loading-dots span {
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #667EEA, #A78BFA);
    border-radius: 50%;
    animation: dot-pulse 1.2s ease-in-out infinite;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.summary-loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.summary-loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

/* ========== 总结内容区域 - 高级版 ========== */

.summary-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
        max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        padding 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s ease;
    padding: 0 var(--space-5);
    position: relative;
    z-index: 2;
}

.summary-card.expanded .summary-content {
    padding-bottom: var(--space-5);
}

/* 要点列表 - 精致卡片风格 */
.summary-points-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.summary-point-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: 14px;
    line-height: 1.7;
    color: var(--neutral-700);
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(248, 250, 255, 0.6) 100%
    );
    border-radius: var(--radius-md);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(167, 139, 250, 0.1);
    animation: text-reveal 0.4s ease backwards;
}

.summary-point-item:nth-child(1) { animation-delay: 0.05s; }
.summary-point-item:nth-child(2) { animation-delay: 0.1s; }
.summary-point-item:nth-child(3) { animation-delay: 0.15s; }
.summary-point-item:nth-child(4) { animation-delay: 0.2s; }
.summary-point-item:nth-child(5) { animation-delay: 0.25s; }
.summary-point-item:nth-child(6) { animation-delay: 0.3s; }
.summary-point-item:nth-child(7) { animation-delay: 0.35s; }
.summary-point-item:nth-child(8) { animation-delay: 0.4s; }

.summary-point-item:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(248, 250, 255, 0.9) 100%
    );
    transform: translateX(6px);
    border-color: rgba(167, 139, 250, 0.25);
    box-shadow:
        0 4px 12px rgba(102, 126, 234, 0.1),
        -4px 0 0 var(--ai-lavender);
}

/* 要点前的渐变圆点 */
.summary-point-item::before {
    content: '';
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #818CF8, #A78BFA);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 8px;
    box-shadow: 0 2px 4px rgba(129, 140, 248, 0.3);
    transition: all 0.25s ease;
}

.summary-point-item:hover::before {
    transform: scale(1.3);
    box-shadow: 0 3px 8px rgba(129, 140, 248, 0.5);
}

/* ========== 重新生成按钮 - 高级小巧版 ========== */

.summary-regenerate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.summary-regenerate-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.1) 0%, rgba(167, 139, 250, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: inherit;
}

.summary-regenerate-btn:hover::before {
    opacity: 1;
}

.summary-regenerate-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--neutral-400);
    stroke-width: 2;
    fill: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.summary-regenerate-btn:hover svg {
    stroke: var(--ai-lavender);
    transform: rotate(45deg);
}

.summary-regenerate-btn:active svg {
    transform: rotate(180deg) scale(0.95);
}

/* 重新生成中 - 旋转动画 */
.summary-regenerate-btn.loading svg {
    stroke: var(--ai-lavender);
    animation: regenerate-spin 1s linear infinite;
}

@keyframes regenerate-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 卡片重新生成状态 - 边框发光 */
.summary-card.regenerating {
    border-color: rgba(167, 139, 250, 0.4);
}

.summary-card.regenerating::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(102, 126, 234, 0.08) 25%,
        rgba(167, 139, 250, 0.12) 50%,
        rgba(102, 126, 234, 0.08) 75%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: ai-shimmer 1.8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

/* ========== 无内容提示 ========== */

.summary-empty {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    font-size: 14px;
    color: var(--neutral-400);
    font-style: italic;
}

.summary-empty svg {
    width: 18px;
    height: 18px;
    stroke: var(--neutral-400);
    opacity: 0.6;
}

/* ========== 移动端适配 ========== */

@media (max-width: 640px) {
    .meeting-summary-section {
        margin-top: var(--space-3);
    }

    .btn-generate-summary {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 15px;
    }

    .summary-card-header {
        padding: var(--space-3) var(--space-4);
    }

    .summary-card-icon {
        width: 32px;
        height: 32px;
    }

    .summary-card-icon svg {
        width: 16px;
        height: 16px;
    }

    .summary-preview {
        display: none;
    }

    .summary-content {
        padding: 0 var(--space-4);
    }

    .summary-card.expanded .summary-content {
        padding-bottom: var(--space-4);
    }

    .summary-point-item {
        padding: var(--space-3);
        font-size: 13px;
    }
}
