/* PDF Merger - joinpdf.org */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --accent-primary: #8b5cf6;
    --accent-secondary: #ec4899;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --success-color: #10b981;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.theme-toggle {
    position: fixed; bottom: 20px; right: 20px;
    width: 50px; height: 50px; border-radius: 50%;
    border: none; background: var(--bg-secondary);
    box-shadow: var(--shadow-md); cursor: pointer; z-index: 1000;
}
.sun-icon, .moon-icon { font-size: 1.5rem; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transition: opacity 0.3s; }
.moon-icon { opacity: 0; }
[data-theme="dark"] .sun-icon { opacity: 0; }
[data-theme="dark"] .moon-icon { opacity: 1; }

.container { max-width: 800px; margin: 0 auto; padding: 40px 20px; }

header { text-align: center; margin-bottom: 40px; }
h1 {
    font-size: 2.5rem; font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--text-secondary); font-size: 1.1rem; margin-top: 10px; }

.upload-section { margin-bottom: 30px; }

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-secondary);
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}
.drop-icon { font-size: 4rem; display: block; margin-bottom: 15px; }
.drop-zone p { margin: 5px 0; color: var(--text-primary); }
.drop-hint { color: var(--text-secondary) !important; font-size: 0.95rem !important; }

.files-section { display: none; background: var(--bg-secondary); border-radius: var(--radius-lg); padding: 25px; margin-bottom: 30px; }
.files-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.files-header h2 { font-size: 1.2rem; }
.file-count { background: var(--accent-gradient); color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; }
.reorder-hint { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 15px; }

.file-list { list-style: none; }
.file-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 15px; background: var(--bg-tertiary);
    border-radius: var(--radius-sm); margin-bottom: 8px;
    cursor: grab; transition: all 0.2s;
}
.file-item:hover { background: var(--border-color); }
.file-item.dragging { opacity: 0.5; }
.drag-handle { color: var(--text-muted); cursor: grab; }
.file-icon { font-size: 1.2rem; }
.file-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--text-muted); font-size: 0.85rem; }
.remove-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 1rem; padding: 5px;
}
.remove-btn:hover { color: #ef4444; }

.merge-actions { display: flex; gap: 15px; margin-top: 20px; }
.merge-actions .btn { flex: 1; }

.btn {
    padding: 15px 24px; border: none; border-radius: var(--radius-sm);
    font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-primary { background: var(--accent-gradient); color: white; }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); }

.result-section {
    display: none; text-align: center;
    background: var(--bg-secondary); border-radius: var(--radius-lg);
    padding: 50px 30px;
}
.result-icon { font-size: 4rem; margin-bottom: 20px; }
.result-section h2 { margin-bottom: 10px; color: var(--success-color); }
.result-info { color: var(--text-secondary); margin-bottom: 25px; }
.download-btn { width: 100%; margin-bottom: 15px; padding: 18px; font-size: 1.1rem; }

.trust-badges {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px; margin: 50px 0;
}
.badge {
    text-align: center; padding: 25px 15px;
    background: var(--bg-secondary); border-radius: var(--radius-md);
}
.badge-icon { font-size: 2rem; display: block; margin-bottom: 10px; }
.badge-text { display: block; font-weight: 700; margin-bottom: 5px; }
.badge-desc { font-size: 0.85rem; color: var(--text-secondary); }

.how-it-works { margin: 50px 0; }
.how-it-works h2 { text-align: center; font-size: 1.8rem; margin-bottom: 30px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 25px; }
.step { text-align: center; padding: 25px; }
.step-number {
    width: 50px; height: 50px; background: var(--accent-gradient);
    color: white; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 1.5rem; font-weight: 700;
    margin: 0 auto 15px;
}
.step h3 { margin-bottom: 10px; }
.step p { color: var(--text-secondary); font-size: 0.95rem; }

.faq-section { margin: 50px 0; }
.faq-section h2 { text-align: center; font-size: 1.8rem; margin-bottom: 30px; }
.faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.faq-item { background: var(--bg-secondary); padding: 25px; border-radius: var(--radius-md); }
.faq-item h3 { font-size: 1rem; margin-bottom: 12px; }
.faq-item p { color: var(--text-secondary); font-size: 0.9rem; }

footer { text-align: center; padding: 40px 20px; border-top: 1px solid var(--border-color); }
footer p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 10px; }
footer a { color: var(--accent-primary); text-decoration: none; }

@media (max-width: 600px) {
    h1 { font-size: 2rem; }
    .merge-actions { flex-direction: column; }
}
