/* ========== PDFMerge — Vercel-Style Design ========== */

:root {
    --bg: #ffffff;
    --fg: #000000;
    --muted: #666666;
    --border: #eaeaea;
    --border-hover: #d4d4d4;
    --accent: #000000;
    --accent-bg: #000000;
    --accent-fg: #ffffff;
    --radius: 8px;
    --shadow: 0 0 0 1px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
    --shadow-lg: 0 0 0 1px rgba(0,0,0,0.08), 0 8px 30px rgba(0,0,0,0.08);
    --font: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ========== Header ========== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.badge {
    font-size: 12px;
    color: var(--muted);
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

/* ========== Hero ========== */
.hero { text-align: center; padding: 60px 0 40px; }

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.hero .highlight { color: var(--muted); }

.subtitle {
    font-size: 18px;
    color: var(--muted);
    max-width: 500px;
    margin: 0 auto;
}

/* ========== Tool ========== */
.tool { margin-bottom: 60px; }

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 60px 40px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 24px;
    -webkit-tap-highlight-color: transparent;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: #fafafa;
}

.drop-zone:active {
    transform: scale(0.99);
    transition: transform 0.1s ease-out;
}

.drop-icon { font-size: 48px; margin-bottom: 16px; }

.drop-text {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.drop-sub {
    font-size: 14px;
    color: var(--muted);
}

.drop-sub .link {
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
}

/* File List */
.file-list {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fafafa;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 500;
}

.btn-text {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.btn-text:hover { color: var(--fg); background: #f0f0f0; }

.files {
    max-height: 300px;
    overflow-y: auto;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 8px, black calc(100% - 8px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, black 8px, black calc(100% - 8px), transparent 100%);
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

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

.file-icon { font-size: 20px; }

.file-name { flex: 1; font-weight: 500; }

.file-size { color: var(--muted); font-size: 13px; }

.file-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.5;
}

.file-remove:hover { opacity: 1; background: #f0f0f0; }

.file-move-up,
.file-move-down {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 4px;
    opacity: 0.4;
    color: var(--fg);
    font-weight: 600;
}

.file-move-up:hover:not(:disabled),
.file-move-down:hover:not(:disabled) {
    opacity: 1;
    background: #f0f0f0;
}

.file-move-up:disabled,
.file-move-down:disabled {
    opacity: 0.15;
    cursor: not-allowed;
}

/* ========== Buttons ========== */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    background: var(--accent-bg);
    color: var(--accent-fg);
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: scale(0.97);
    transition: transform 0.1s ease-out;
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-icon { font-size: 18px; }

/* ========== Progress ========== */
.progress {
    margin-top: 20px;
    text-align: center;
}

.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    color: var(--muted);
}

/* ========== Counter ========== */
.counter {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--muted);
}

.counter span { font-weight: 600; color: var(--fg); }

/* ========== Modal ========== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px) saturate(180%);
    -webkit-backdrop-filter: blur(8px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
    opacity: 0;
    animation: modalOverlayIn 0.25s ease forwards;
}

.modal-content {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg), 0 16px 48px rgba(0,0,0,0.12);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    opacity: 0;
    animation: modalContentIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.05s forwards;
    will-change: transform, opacity;
}

@keyframes modalOverlayIn {
    to { opacity: 1; }
}

@keyframes modalContentIn {
    to { transform: scale(1); opacity: 1; }
}

.payment-modal { padding: 36px 32px; }

/* Close button */
.payment-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.payment-close:hover {
    color: var(--fg);
    background: #f0f0f0;
}

.payment-close:active {
    transform: scale(0.9);
    transition: transform 0.1s ease-out;
}

.modal-icon { font-size: 48px; margin-bottom: 16px; }

.modal-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-desc {
    color: var(--muted);
    margin-bottom: 24px;
    font-size: 15px;
}

.pricing { margin-bottom: 20px; }

.price-card {
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px;
}

.price-title {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.price-amount {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.price-desc { font-size: 14px; color: var(--muted); }

/* Payment network badge */
.payment-network { margin-bottom: 20px; }

.network-badge {
    display: inline-block;
    background: #f0f0f0;
    color: var(--fg);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
}

/* QR Code section */
.qr-section {
    margin-bottom: 24px;
}

.payment-qr {
    width: 180px;
    height: 180px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: block;
    margin: 0 auto 12px;
}

.qr-hint {
    font-size: 13px;
    color: var(--muted);
}

/* Address copy section */
.address-section {
    margin-bottom: 24px;
    text-align: left;
}

.payment-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 8px;
    text-align: left;
}

.address-box {
    display: flex;
    gap: 8px;
}

.address-box input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: var(--fg);
    background: #fafafa;
    min-width: 0;
}

.btn-copy {
    padding: 12px 20px;
    background: var(--accent-bg);
    color: var(--accent-fg);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-copy:hover {
    transform: translateY(-1px);
}

.btn-copy.copied {
    background: #22c55e;
}

/* TXID section */
.txid-section {
    text-align: left;
}

.txid-input-group {
    display: flex;
    gap: 8px;
}

.txid-input-group input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: var(--fg);
    background: var(--bg);
    min-width: 0;
}

.txid-input-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-verify {
    padding: 12px 24px;
    background: var(--accent-bg);
    color: var(--accent-fg);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-verify:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-verify:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Payment status */
.payment-status {
    margin-top: 12px;
    font-size: 14px;
    text-align: left;
    min-height: 20px;
}

.payment-status.success {
    color: #22c55e;
    font-weight: 600;
}

.payment-status.error {
    color: #ef4444;
    font-weight: 500;
}

.payment-status.loading {
    color: var(--muted);
}

/* Spinner */
.payment-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.payment-note {
    font-size: 13px;
    color: var(--muted);
    margin-top: 16px;
}

/* ========== Features ========== */
.features { margin-bottom: 60px; }

.features h2 {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.feature {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.feature:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow);
}

.feature:active {
    transform: scale(0.98);
    transition: transform 0.1s ease-out;
}

.feature-icon { font-size: 28px; margin-bottom: 12px; }

.feature h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
}

/* ========== FAQ ========== */
.faq { margin-bottom: 60px; }

.faq h2 {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
}

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}

.faq-item h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.faq-item p {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.6;
}

/* ========== Footer ========== */
.footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
}

.footer-small {
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.7;
}

/* ========== Mobile ========== */
@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .header { padding: 16px 0; }
    .header .badge { font-size: 11px; padding: 3px 8px; }
    .hero { padding: 32px 0 24px; }
    .hero h1 { font-size: 28px; }
    .subtitle { font-size: 16px; }
    .drop-zone { padding: 32px 16px; }
    .drop-icon { font-size: 36px; }
    .drop-text { font-size: 16px; }
    .drop-sub { font-size: 13px; }
    .btn-primary { padding: 14px 20px; font-size: 15px; }
    .feature-grid { grid-template-columns: 1fr; gap: 16px; }
    .feature { padding: 20px; }
    .modal-content { padding: 24px; }
    .price-amount { font-size: 36px; }
    .file-item { padding: 10px 12px; gap: 8px; }
    .file-list-header { padding: 10px 12px; }
    .file-name { font-size: 13px; }
    .file-size { font-size: 12px; }
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.file-item { animation: fadeIn 0.2s ease; }

/* ========== Reduced Motion (Apple Design — accessibility) ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .modal {
        animation: none;
        opacity: 1;
    }

    .modal-content {
        animation: none;
        transform: none;
        opacity: 1;
    }

    .file-item {
        animation: none;
    }
}
