/**
 * 快讯海报生成功能样式 - TKTOC抖音风格
 * 配色方案：抖音红(#FF0050)、抖音蓝(#25D366)、黑色背景(#000000)
 */

/* 快讯操作按钮统一样式 */
.kuaixun-actions .btn {
    background: transparent;
    color: #6c757d;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 400;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kuaixun-actions .btn:hover {
    background: rgba(108, 117, 125, 0.1);
    color: #495057;
    text-decoration: none;
}

.kuaixun-actions .btn:active {
    transform: none;
    background: rgba(108, 117, 125, 0.15);
}

.kuaixun-actions .btn i {
    font-size: 12px;
}

/* 操作按钮容器样式 */
.kuaixun-actions {
    margin-top: 8px;
}

.kuaixun-actions .action-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}

/* 确保按钮在移动端也能正确右对齐 */
@media (max-width: 768px) {
    .kuaixun-actions .action-buttons {
        gap: 8px;
    }
}

/* 海报预览模态框 */
.poster-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.poster-preview-modal.hidden {
    opacity: 0;
    visibility: hidden;
}

.poster-preview-modal.show {
    opacity: 1;
    visibility: visible;
}

.poster-preview-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.poster-preview-modal .modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 95vw;
    max-height: 95vh;
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.poster-preview-modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.poster-preview-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
}

.poster-preview-modal .modal-header h5 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.poster-preview-modal .close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 20px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.poster-preview-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.poster-preview-modal .modal-body {
    padding: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.poster-preview-modal .poster-preview {
    text-align: center;
    max-width: 100%;
    max-height: 100%;
    position: relative;
}

.poster-preview-modal .poster-preview img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.poster-preview-modal .poster-preview img:hover {
    transform: scale(1.02);
}

.poster-preview-modal .modal-footer {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 24px 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
}

.poster-preview-modal .btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.poster-preview-modal .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.poster-preview-modal .btn:hover::before {
    left: 100%;
}

.poster-preview-modal .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.poster-preview-modal .btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

.poster-preview-modal .btn-primary {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.poster-preview-modal .btn-primary:hover {
    background: linear-gradient(135deg, #357ABD 0%, #2E6DA4 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

/* 加载状态 - 抖音风格 */
.poster-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.poster-loading .loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #FF0050;
    border-right: 4px solid #25D366;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
    margin-bottom: 24px;
    box-shadow: 0 0 20px rgba(255, 0, 80, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 500;
    font-size: 14px;
    z-index: 10001;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    animation: slideInRight 0.3s ease-out;
}

.toast-success {
    background: linear-gradient(135deg, #25D366 0%, #20B358 100%);
    border-left: 4px solid #1DA851;
}

.toast-info {
    background: linear-gradient(135deg, #FF0050 0%, #E91E63 100%);
    border-left: 4px solid #C2185B;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 生成海报按钮样式增强 */
.kuaixun-actions .btn[data-action="poster"] {
    position: relative;
    overflow: hidden;
}

.kuaixun-actions .btn[data-action="poster"]:hover {
    background: linear-gradient(45deg, #f1404b, #ff6b75);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(241, 64, 75, 0.2);
}

.kuaixun-actions .btn[data-action="poster"]:active {
    transform: translateY(0);
}

/* 微信分享按钮样式增强 */
.kuaixun-actions .btn[data-action="wechat-share"]:hover {
    background: linear-gradient(45deg, #07c160, #38d973);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .poster-preview-modal .modal-content {
        max-width: 95vw;
        margin: 20px;
    }
    
    .poster-preview-modal .modal-header,
    .poster-preview-modal .modal-footer {
        padding: 16px 20px;
    }
    
    .poster-preview-modal .modal-body {
        padding: 20px;
    }
    
    .poster-preview-modal .poster-preview img {
        max-height: 40vh;
    }
    
    .poster-preview-modal .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .poster-preview-modal .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .poster-preview-modal .modal-header h5 {
        font-size: 16px;
    }
    
    .poster-preview-modal .btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .poster-loading {
        font-size: 14px;
    }
    
    .poster-loading .loading-spinner {
        width: 40px;
        height: 40px;
        margin-bottom: 16px;
    }
}

/* 动画效果 */
.kuaixun-actions .btn {
    position: relative;
    overflow: hidden;
}

.kuaixun-actions .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.kuaixun-actions .btn:hover::before {
    width: 100px;
    height: 100px;
}

/* 海报预览图片的缩放效果 */
.poster-preview img {
    transition: transform 0.3s ease;
}

.poster-preview:hover img {
    transform: scale(1.02);
}

/* 模态框进入动画 */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.poster-preview-modal.show .modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

/* 按钮点击反馈 */
.kuaixun-actions .btn:active {
    transform: scale(0.98);
}

/* 工具提示样式 */
.kuaixun-actions .btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.kuaixun-actions .btn[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}