/* ===== PDF Splitter – Redesign ===== */

:root {
    --primary: #18cc63;
    --primary-light: #d1fae5;
    --primary-dark: #10b054;
    --primary-glow: rgba(24, 204, 99, .15);

    --bg-page: #f4f6f9;
    --bg-card: #ffffff;
    --bg-surface: #f8f9fb;
    --border: #e2e5ea;
    --border-light: #eff1f4;

    --text-main: #1a1f2b;
    --text-secondary: #5a6173;
    --text-muted: #8b91a0;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --shadow-xs: 0 1px 3px rgba(0,0,0,.04);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
    --shadow-md: 0 8px 30px rgba(0,0,0,.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,.10);
    --shadow-primary: 0 4px 16px rgba(24, 204, 99, .25);

    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --transition: .25s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-main);
    background: var(--bg-page);
    color: var(--text-main);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

h1, h2, h3, h4 { line-height: 1.3; letter-spacing: -.01em; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

/* ── Header ───────────────────────────────────── */
.main-header {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
}
.logo { height: 32px; }

.brand-name { opacity: .85; }

nav { display: flex; gap: 6px; }
.nav-link {
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 500;
    transition: var(--transition);
}
.nav-link:hover {
    background: var(--primary-glow);
    color: var(--primary-dark);
}

/* ── Hero Section ─────────────────────────────── */
.hero-section {
    padding: 56px 0 48px;
    text-align: center;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, var(--primary-glow), transparent),
        linear-gradient(to bottom, #f0f8f4 0%, var(--bg-page) 100%);
}

.hero-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-main), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

/* ── Tool Card ────────────────────────────────── */
.tool-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    max-width: 640px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    position: relative;
}

/* ── Upload / Drop Zone ───────────────────────── */
.drop-zone {
    border: 2px dashed var(--border);
    padding: 52px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 60%, var(--primary-glow), transparent 70%);
    opacity: 0;
    transition: opacity .35s;
}
.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: #f6fef9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.drop-zone:hover::before,
.drop-zone.drag-over::before { opacity: 1; }

.icon-upload {
    font-size: 48px;
    margin-bottom: 14px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.drop-zone h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.drop-zone p {
    font-size: .88rem;
    color: var(--text-muted);
}

/* ── File Info Bar ────────────────────────────── */
.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 22px;
    border: 1px solid var(--border-light);
}
.filename {
    flex: 1;
    font-weight: 600;
    font-size: .92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.badge {
    background: var(--primary-light);
    color: #065f46;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}
.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.15rem;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
    line-height: 1;
}
.btn-text:hover { color: #ef4444; background: #fef2f2; }

/* ── Tab System ───────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--bg-surface);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}
.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: .85rem;
    color: var(--text-muted);
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
}
.tab-btn:hover { color: var(--text-main); background: rgba(0,0,0,.03); }
.tab-btn.active {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: var(--shadow-xs);
}

.tab-content {
    display: none;
    animation: fadeSlide .3s ease;
    text-align: left;
}
.tab-content.active { display: block; }
@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.info-text {
    font-size: .93rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
}
.help-text {
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ── Form Controls ────────────────────────────── */
.input-modern {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 6px;
    font-size: .93rem;
    font-family: inherit;
    color: var(--text-main);
    background: var(--bg-card);
    transition: var(--transition);
    outline: none;
}
.input-modern:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.input-modern::placeholder { color: var(--text-muted); }

/* Custom Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    cursor: pointer;
    user-select: none;
    font-size: .93rem;
    color: var(--text-secondary);
}
.checkbox-wrapper input { display: none; }
.checkbox-wrapper .checkmark {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: 5px;
    position: relative;
    transition: var(--transition);
}
.checkbox-wrapper input:checked ~ .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}
.checkbox-wrapper input:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    left: 5px; top: 1px;
    width: 5px; height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Sensitivity Slider */
.sensitivity-control {
    margin-top: 16px;
}
.sensitivity-control label {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-main);
    display: block;
    margin-bottom: 8px;
}
.sensitivity-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    transition: var(--transition);
}
.sensitivity-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(24,204,99,.35);
    transition: var(--transition);
}
.sensitivity-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 10px rgba(24,204,99,.5);
}
.small-text {
    display: block;
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ── Action Area & Button ─────────────────────── */
.action-area { margin-top: 24px; }

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,.15));
    opacity: 0;
    transition: opacity .25s;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Progress ─────────────────────────────────── */
.progress-container {
    margin-top: 18px;
    text-align: center;
}
.progress-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #34d399);
    width: 0%;
    transition: width .3s ease;
    border-radius: 3px;
}
#progress-text {
    font-size: .82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Status Message ───────────────────────────── */
.status-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    text-align: center;
}

/* ── Features Section ─────────────────────────── */
.features-section {
    padding: 64px 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 40px;
    font-size: .95rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.card {
    padding: 28px 24px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
    border-color: var(--border);
}
.card-icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: var(--primary-glow);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.card p {
    font-size: .9rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ── How-To Section ───────────────────────────── */
.howto-section {
    padding: 56px 0;
}
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 28px;
    counter-reset: step;
}
.step {
    text-align: center;
    position: relative;
}
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    border-radius: 50%;
    margin-bottom: 14px;
    box-shadow: var(--shadow-primary);
}
.step h4 {
    font-size: .98rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.step p {
    font-size: .87rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ── Footer ───────────────────────────────────── */
.main-footer {
    background: #1a1f2b;
    color: #ccc;
    padding: 36px 0;
    margin-top: auto;
}
.footer-content {
    text-align: center;
}
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 14px;
}
.footer-logo img { height: 24px; filter: brightness(0) invert(1); opacity: .7; }
.footer-nav {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 14px;
}
.footer-nav a {
    color: #8b91a0;
    font-size: .88rem;
    transition: color var(--transition);
}
.footer-nav a:hover { color: var(--primary); }
.copyright {
    font-size: .8rem;
    color: #5a6173;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 640px) {
    .hero-section { padding: 40px 0 32px; }
    .tool-wrapper { padding: 24px 18px; border-radius: var(--radius-md); }
    .drop-zone { padding: 36px 16px; }
    .tabs { flex-direction: column; }
    .tab-btn { text-align: center; }
    .header-content { flex-wrap: wrap; gap: 10px; }
    nav { width: 100%; justify-content: center; }
    .steps { gap: 20px; }
}