/* ============================================
   PDF Merger — Stylesheet
   Design moderne, glassmorphism + gradient
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #ec4899;
    --bg: #0f0f1e;
    --bg-light: #1a1a2e;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --success: #10b981;
    --error: #ef4444;
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
}

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

html, body {
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Background blobs ===== */
.background-blobs {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: #8b5cf6;
    top: 40%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -50px) scale(1.1); }
    66% { transform: translate(-30px, 30px) scale(0.9); }
}

/* ===== Layout ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px 40px;
}

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: 48px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    margin-bottom: 32px;
    font-weight: 600;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.logo svg {
    width: 18px;
    height: 18px;
    color: var(--primary-light);
}

.header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 20px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 540px;
    margin: 0 auto;
}

/* ===== Main Card ===== */
.main-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
}

/* ===== Dropzone ===== */
.dropzone {
    border: 2px dashed var(--border-hover);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.dropzone:hover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

.dropzone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: var(--shadow-glow);
    transform: scale(1.01);
}

.upload-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow);
}

.upload-icon svg {
    width: 32px;
    height: 32px;
}

.dropzone h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.dropzone p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* ===== File list ===== */
.file-list {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: grab;
    transition: all 0.25s ease;
    animation: slideIn 0.3s ease;
}

.file-item:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.file-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.file-item.drag-over {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
}

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

.drag-handle {
    color: var(--text-dim);
    cursor: grab;
    flex-shrink: 0;
}

.file-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #ef4444, #f97316);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.file-remove {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.file-remove svg {
    width: 16px;
    height: 16px;
}

/* ===== Actions ===== */
.actions {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 16px;
}

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn-primary, .btn-secondary, .btn-ghost {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.6);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text);
}

/* ===== Spinner ===== */
.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== Messages ===== */
.message {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.message.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.message.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* ===== Footer ===== */
.footer {
    margin-top: 40px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.feature svg {
    width: 24px;
    height: 24px;
    color: var(--primary-light);
    flex-shrink: 0;
}

.feature strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.feature span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ===== Utils ===== */
.hidden {
    display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .container { padding: 32px 16px; }
    .main-card { padding: 20px; }
    .dropzone { padding: 32px 16px; }
    .action-buttons { flex-direction: column; }
    .action-buttons button { width: 100%; justify-content: center; }
    .header h1 { font-size: 2rem; }
}
