/* 自定义动画和样式 */

/* 页面渐显动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    animation: fadeIn 0.8s ease-out;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
}

/* 上传区域动画 */
#drop-zone {
    position: relative;
    transition: all 0.3s ease;
    z-index: 1;
    min-height: 200px;
}

#drop-zone.drag-over {
    background-color: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.9);
    transform: scale(1.01);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#drop-zone:hover {
    border-color: rgba(99, 102, 241, 0.9);
    background-color: rgba(99, 102, 241, 0.05);
}

#drop-zone-overlay {
    z-index: 5;
}

/* 主标题悬停动画 */
h1:hover i {
    transform: rotate(-10deg);
    display: inline-block;
    transition: transform 0.3s ease;
}

/* 按钮效果 */
button {
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.96);
}

/* 进度条动画 */
#progress-bar {
    transition: width 0.5s ease;
}

/* 卡片样式增强 */
.bg-white {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bg-white:hover {
    transform: translateY(-2px);
}

/* 音频播放器自定义样式 */
audio {
    border-radius: 30px;
    width: 100%;
}

/* 为支持的格式卡片添加悬停效果 */
.bg-indigo-50 {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bg-indigo-50:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 响应式字体大小 */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }
}

/* 添加自定义滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a5b4fc;
}

/* 添加转场动画 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 转换完成动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 0.6s ease-in-out;
}

/* 修改错误信息样式，改为友好提示 */
/* 错误信息区域样式已删除 */

/* 改进加载指示器，添加淡入淡出效果 */
.loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    margin: 0 auto 1.5rem;
    background-color: #eff6ff;
    border-radius: 0.5rem;
    border: 1px solid #dbeafe;
    max-width: 24rem;
    color: #1e40af;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.loading-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-indicator i {
    margin-right: 0.75rem;
    animation: spin 1s linear infinite;
    font-size: 1.25rem;
}

/* 添加禁用状态样式 */
.pointer-events-none {
    pointer-events: none;
}

/* 透明度转换动画 */
.opacity-50 {
    transition: opacity 0.3s ease;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-content {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-width: 28rem;
    width: 90%;
    animation: slideUp 0.3s ease-out;
}

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

/* 批量处理相关样式 */
.batch-file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
}

.batch-file-item:last-child {
    border-bottom: none;
}

.batch-file-item:hover {
    background-color: #f9fafb;
}

.batch-file-item .file-icon {
    color: #6366f1;
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.batch-file-item .file-details {
    flex-grow: 1;
}

.batch-file-item .file-name {
    font-weight: 500;
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.batch-file-item .file-size {
    font-size: 0.75rem;
    color: #6b7280;
}

.batch-file-item .remove-file {
    color: #ef4444;
    padding: 0.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.batch-file-item .remove-file:hover {
    color: #b91c1c;
}

/* 结果列表样式 */
.result-success {
    color: #059669;
}

.result-error {
    color: #dc2626;
}

/* 模式切换按钮 */
.mode-active {
    background-color: #4f46e5;
    color: white;
}

.mode-inactive {
    background-color: transparent;
    color: #4f46e5;
    border: 1px solid #4f46e5;
}

/* 下载按钮闪烁动画 */
@keyframes pulse-download {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(22, 163, 74, 0);
    }
}

#download-all-btn {
    animation: pulse-download 2s infinite;
}

/* 下载按钮状态效果 */
.download-item {
    transition: all 0.2s ease;
}

.download-item:active {
    transform: scale(0.92);
}

/* 下载状态动画 */
@keyframes downloadProgress {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

#download-all-btn:disabled {
    background: linear-gradient(-45deg, #34d399, #10b981, #059669);
    background-size: 200% 200%;
    animation: downloadProgress 2s ease infinite;
}

/* 下载成功效果 */
.download-success {
    position: relative;
    overflow: hidden;
}

.download-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(16, 185, 129, 0.2);
    transform: translateX(-100%);
    animation: downloadComplete 0.8s ease forwards;
}

@keyframes downloadComplete {
    to {
        transform: translateX(0);
    }
}

/* 表格样式优化 */
#result-files-list td {
    padding: 0.5rem 0.75rem;
}

#result-files-list tr:hover {
    background-color: rgba(243, 244, 246, 0.5);
}

/* 淡出动画 */
.fade-out {
    animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 上传按钮样式 */
#upload-helper-btn {
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#upload-helper-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

#upload-helper-btn:active {
    transform: translateY(0);
}

/* 改进文件选择按钮 */
label[for="file-input"],
label[for="batch-file-input"] {
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 160px;
}

label[for="file-input"]:hover,
label[for="batch-file-input"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 确保文件信息正确显示 */
#file-info {
    transition: all 0.3s ease;
}

#file-info.hidden {
    display: none;
}

/* 安全的淡入淡出效果 */
.fade-in-element {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
