/* Modern PDF Merge Tool - Main Stylesheet */
/* CSS Variables */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* 背景渐变 */
body.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 100vh;
}

html {
    min-height: 100%;
}

/* 主容器自适应首屏高度 */
.container.mx-auto.max-w-6xl {
    min-height: 100vh; /* 最小高度为视口高度 */
    min-height: 100dvh; /* 动态视口高度，适应移动端地址栏 */
}

/* 玻璃态卡片 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
    overflow-x: hidden;
    overflow-y: hidden; /* 防止卡片本身溢出 */
    max-height: 100%; /* 限制最大高度 */
}

/* 上传区域 */
.upload-zone {
    border: 2px dashed #d1d5db;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #f8fafc 25%, transparent 25%),
                linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #f8fafc 75%),
                linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.upload-zone.dragover {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.05);
    transform: scale(1.02);
}

/* 文件项 */
.file-item {
    background: white;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    min-height: 3rem;
    overflow: hidden;
    max-width: 100%;
    width: 100%;
}

.file-item .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.file-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    background: #f8fafc;
}

/* 预览容器 */
.preview-container {
    background: #f8fafc;
    border-radius: 12px;
    height: 100%;
    max-height: 480px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.preview-container::-webkit-scrollbar {
    width: 6px;
}

.preview-container::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.preview-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

/* 文件列表滚动条 */
#fileList {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
}

#fileList::-webkit-scrollbar {
    width: 8px;
}

#fileList::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

#fileList::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#fileList::-webkit-scrollbar-thumb:hover {
    background: #4f46e5;
}

#fileList::-webkit-scrollbar-corner {
    background: transparent;
}

/* 预览页面 */
.preview-page {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin: 0 auto 16px;
    transition: transform 0.2s ease;
}

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

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: var(--primary-color);
}

/* 控制按钮组 */
.control-group {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    gap: 4px;
}

.control-btn {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.control-btn:hover:not(.active) {
    background: #f3f4f6;
    color: #374151;
}

/* 统计徽章 */
.stats-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* 模态框 */
.modal-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    max-height: 85vh;
    overflow-y: auto;
}

.layout-options-grid {
    max-height: 60vh;
    overflow-y: auto;
}

/* Language dropdown styling */
.language-dropdown {
    background-color: #ffffff;
}

/* 预设卡片 */
.preset-card {
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
    cursor: pointer;
}

.preset-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.preset-card.active {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

/* 滑块 */
.slider {
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

/* Toast 通知 */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    display: none;
    z-index: 1000;
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s ease;
}

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

.toast.success { background: var(--success-color); }
.toast.error { background: var(--error-color); }
.toast.warning { background: var(--warning-color); }
.toast.info { background: var(--primary-color); }

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* 防止横向溢出 */
.grid.grid-cols-1.lg\:grid-cols-2 > * {
    min-width: 0;
    overflow-x: hidden;
}

/* 特性区域emoji图标垂直居下 */
.py-16 .text-center .inline-flex.items-center {
    align-items: flex-end !important;
}

/* 特性卡片左右padding */
.py-16 .text-center {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* FAQ 问答卡片样式 - 简化版 */
.faq-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    color: #ffffff;
    font-weight: 600;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item p,
.faq-item li {
    color: rgba(255, 255, 255, 0.85);
}

.faq-item strong {
    color: rgba(255, 255, 255, 0.95);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .glass-card {
        margin: 16px;
    }

    .preview-container {
        max-height: 360px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .file-item {
        padding: 8px;
    }


    #fileList {
        max-height: 300px;
        overflow-y: auto;
    }
}
