/**
 * EasyLottie - 最近使用文件样式
 * V1.2.71 - 留存优化
 */

/* ===== 最近使用区域 ===== */
.recent-files-section {
    margin: 40px 0;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.recent-files-section:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* ===== 标题区域 ===== */
.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.recent-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d3436;
}

.recent-title .icon {
    font-size: 28px;
}

.recent-title .title-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.recent-title .count {
    font-size: 18px;
    color: #636e72;
    font-weight: 400;
}

/* ===== 文件网格 ===== */
.recent-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* ===== 文件卡片 ===== */
.recent-file-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.recent-file-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.recent-file-card:hover {
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-4px);
}

.recent-file-card:hover::before {
    transform: scaleX(1);
}

/* ===== 文件图标 ===== */
.file-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
    transition: transform 0.3s ease;
}

.recent-file-card:hover .file-icon {
    transform: scale(1.1) rotate(5deg);
}

/* ===== 文件信息 ===== */
.file-info {
    text-align: center;
    margin-bottom: 16px;
}

.file-name {
    font-size: 15px;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.file-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #636e72;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.file-tool {
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.file-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.file-time::before {
    content: '🕒';
    font-size: 12px;
}

.file-size {
    font-size: 12px;
    color: #95a5a6;
    font-weight: 500;
}

/* ===== 操作按钮 ===== */
.file-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.load-btn {
    flex: 1;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.load-btn:active {
    transform: translateY(0);
}

.remove-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    background: #ffffff;
    color: #e74c3c;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
    transform: rotate(90deg);
}

/* ===== 查看全部按钮 ===== */
.view-all-btn {
    padding: 10px 24px;
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background: #667eea;
    color: white;
    transform: translateX(4px);
}

/* ===== 空状态 ===== */
.recent-files-empty {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.recent-files-empty .icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.recent-files-empty p {
    font-size: 16px;
    margin: 0;
}

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

/* 平板 */
@media (max-width: 1024px) {
    .recent-files-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .recent-files-section {
        padding: 24px;
    }
}

/* 手机 */
@media (max-width: 768px) {
    .recent-files-section {
        padding: 20px;
        margin: 24px 0;
    }
    
    .recent-title {
        font-size: 20px;
    }
    
    .recent-title .icon {
        font-size: 24px;
    }
    
    .recent-files-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .recent-file-card {
        padding: 16px;
    }
    
    .file-icon {
        width: 50px;
        height: 50px;
        font-size: 28px;
        margin-bottom: 12px;
    }
    
    .file-name {
        font-size: 14px;
    }
    
    .file-meta {
        font-size: 12px;
        gap: 8px;
    }
    
    .load-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .remove-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .view-all-btn {
        padding: 8px 20px;
        font-size: 13px;
    }
    
    .recent-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .view-all-btn {
        align-self: stretch;
        text-align: center;
    }
}

/* 小手机 */
@media (max-width: 480px) {
    .recent-files-grid {
        grid-template-columns: 1fr;
    }
    
    .recent-file-card {
        display: flex;
        align-items: center;
        gap: 16px;
        text-align: left;
    }
    
    .file-icon {
        width: 60px;
        height: 60px;
        margin: 0;
        flex-shrink: 0;
    }
    
    .file-info {
        flex: 1;
        text-align: left;
        margin-bottom: 0;
    }
    
    .file-name {
        text-align: left;
    }
    
    .file-meta {
        justify-content: flex-start;
    }
    
    .file-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .load-btn {
        min-width: 80px;
    }
}

/* ===== 深色模式支持（可选） ===== */
@media (prefers-color-scheme: dark) {
    .recent-files-section {
        background: #2d3436;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    }
    
    .recent-title {
        color: #dfe6e9;
    }
    
    .recent-file-card {
        background: #34495e;
        border-color: #2c3e50;
    }
    
    .recent-file-card:hover {
        border-color: #667eea;
    }
    
    .file-name {
        color: #dfe6e9;
    }
    
    .file-meta {
        color: #b2bec3;
    }
    
    .file-tool {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .file-size {
        color: #95a5a6;
    }
    
    .remove-btn {
        background: #2d3436;
        border-color: #34495e;
    }
    
    .remove-btn:hover {
        background: #e74c3c;
        color: white;
    }
}

/* ===== 动画效果 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recent-file-card {
    animation: fadeInUp 0.4s ease-out forwards;
}

.recent-file-card:nth-child(1) { animation-delay: 0.05s; }
.recent-file-card:nth-child(2) { animation-delay: 0.1s; }
.recent-file-card:nth-child(3) { animation-delay: 0.15s; }
.recent-file-card:nth-child(4) { animation-delay: 0.2s; }
.recent-file-card:nth-child(5) { animation-delay: 0.25s; }
.recent-file-card:nth-child(6) { animation-delay: 0.3s; }

/* ===== 加载状态 ===== */
.recent-files-loading {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
}

.recent-files-loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}
