/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --bg-primary: #1a1b23;
    --bg-secondary: #232430;
    --bg-tertiary: #2a2b38;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-input: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(255, 255, 255, 0.02);
    --border-light: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.18);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.45);
    --text-dim: rgba(255, 255, 255, 0.3);
    --accent: #7c6bf0;
    --accent-light: #9d8ff5;
    --accent-hover: #6b59e6;
    --accent-glow: rgba(124, 107, 240, 0.3);
    --accent-subtle: rgba(124, 107, 240, 0.08);
    --danger: #ef4444;
    --danger-light: #f87171;
    --danger-hover: #dc2626;
    --danger-glow: rgba(239, 68, 68, 0.2);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --warning: #f59e0b;
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.3);
    --shadow-accent: 0 4px 20px rgba(124, 107, 240, 0.2);
    --transition-fast: 120ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;
    --font-size-hero: clamp(1.75rem, 5vw, 2.5rem);
    --font-size-body: clamp(0.875rem, 2.5vw, 1rem);
    --font-size-sm: 0.8125rem;
    --font-size-xs: 0.75rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 107, 240, 0.08), transparent),
        radial-gradient(circle at 20% 80%, rgba(124, 107, 240, 0.03), transparent),
        radial-gradient(circle at 80% 20%, rgba(124, 107, 240, 0.03), transparent);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== Navbar ===== */
.navbar {
    background: rgba(26, 27, 35, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo svg {
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

/* ===== Main Layout ===== */
.main {
    padding: 56px 24px 72px;
    min-height: calc(100vh - 58px - 88px);
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    margin-bottom: 48px;
    animation: fadeInUp 400ms ease;
}

.hero h1 {
    font-size: var(--font-size-hero);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.75) 50%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero p {
    font-size: var(--font-size-body);
    color: var(--text-secondary);
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.6;
}

.hero-sep {
    color: var(--accent-light);
    opacity: 0.5;
    margin: 0 6px;
    font-weight: 300;
}

/* ===== Error Message ===== */
.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger-light);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    margin-bottom: 24px;
    display: none;
    animation: slideDown 200ms ease;
    backdrop-filter: blur(8px);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ===== Upload Zone ===== */
.upload-zone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 64px 40px;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-glass) 100%);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 25%, var(--accent-subtle) 50%, transparent 75%);
    background-size: 200% 200%;
    opacity: 0;
    transition: opacity var(--transition-slow);
    animation: shimmer 3s ease infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.upload-zone:hover::before,
.upload-zone.active::before {
    opacity: 1;
}

.upload-zone:hover,
.upload-zone.active {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent-subtle) 0%, var(--bg-card) 100%);
    box-shadow: 0 0 40px var(--accent-glow), inset 0 0 40px rgba(124, 107, 240, 0.05);
}

.upload-zone.active {
    transform: scale(1.01);
}

.upload-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.upload-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-subtle), rgba(124, 107, 240, 0.15));
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-light);
    transition: all var(--transition-normal);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.upload-zone:hover .upload-icon {
    transform: translateY(-8px) scale(1.05);
    box-shadow: var(--shadow-accent);
}

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

.btn-choose {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    margin-bottom: 14px;
    box-shadow: var(--shadow-accent);
    letter-spacing: -0.01em;
}

.btn-choose:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 107, 240, 0.35);
    filter: brightness(1.05);
}

.btn-choose:active {
    transform: translateY(0);
}

.upload-or {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-sub {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

#fileInput,
#pdfFileInput,
#splitFileInput {
    display: none;
}

/* ===== Images Section ===== */
.images-section {
    margin-top: 40px;
    display: none;
}

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

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.section-title svg {
    color: var(--accent);
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.badge {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
    box-shadow: var(--shadow-accent);
}

.section-actions {
    display: flex;
    gap: 8px;
}

.btn-add-more {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-add-more:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: var(--accent-subtle);
}

.btn-clear {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--font-size-sm);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-clear:hover {
    color: var(--danger-light);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.15);
}

/* ===== Image Grid ===== */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.image-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: grab;
    transition: all var(--transition-normal);
}

.image-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.image-card.dragging {
    opacity: 0.4;
    transform: scale(0.95) rotate(2deg);
    box-shadow: var(--shadow-lg);
}

.image-card:active {
    cursor: grabbing;
}

.image-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-slow);
}

.image-card:hover img {
    transform: scale(1.05);
}

.image-card .num {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.image-card .card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all var(--transition-fast);
    z-index: 2;
}

.image-card:hover .card-actions {
    opacity: 1;
    transform: translateY(0);
}

.card-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.1);
}

.card-btn.del:hover {
    background: var(--danger);
    border-color: var(--danger);
    box-shadow: 0 0 12px var(--danger-glow);
}

.card-info {
    padding: 6px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.15);
}

.card-size {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ===== Settings Panel ===== */
.settings-panel {
    margin-bottom: 28px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-glass) 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.02);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.settings-header svg {
    color: var(--accent);
    filter: drop-shadow(0 0 4px var(--accent-glow));
}

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

.option label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
}

.option label svg {
    opacity: 0.7;
    color: var(--accent-light);
}

/* ===== Select Dropdown ===== */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 11px 36px 11px 14px;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-family: inherit;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    font-weight: 500;
}

.select-wrapper select:hover {
    border-color: var(--border-hover);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.select-wrapper select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-sm);
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--accent-light);
    opacity: 0.7;
    transition: all var(--transition-fast);
}

.select-wrapper select:focus ~ .select-arrow {
    opacity: 1;
    transform: translateY(-50%) rotate(180deg);
}

.option select {
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    color-scheme: dark;
    font-weight: 500;
}

.option select:hover {
    border-color: var(--border-hover);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.option select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-sm);
}

.option select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px;
}

/* ===== Orientation & Fit Buttons ===== */
.orientation-buttons {
    display: flex;
    gap: 6px;
}

.orientation-btn,
.fit-btn {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.orientation-btn:hover,
.fit-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.orientation-btn.active,
.fit-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-color: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-accent);
}

.orientation-btn.active svg,
.fit-btn.active svg {
    opacity: 1;
}

.orientation-btn svg {
    opacity: 0.6;
}

.fit-buttons {
    display: flex;
    gap: 6px;
}

/* ===== Margin Control ===== */
.margin-control {
    display: flex;
    align-items: center;
    gap: 14px;
}

.margin-control input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
    height: 6px;
    border-radius: 100px;
    background: var(--bg-input);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.margin-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    border: 2px solid var(--bg-primary);
    box-shadow: var(--shadow-sm), 0 0 12px var(--accent-glow);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.margin-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-md), 0 0 16px var(--accent-glow);
}

.margin-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    border: 2px solid var(--bg-primary);
    box-shadow: var(--shadow-sm), 0 0 12px var(--accent-glow);
    cursor: pointer;
}

.margin-value {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--accent-light);
    min-width: 55px;
    text-align: right;
    background: var(--accent-subtle);
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    border: 1px solid rgba(124, 107, 240, 0.15);
}

/* ===== Toggle Switch ===== */
.toggle-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: 100px;
    transition: all var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: #fff;
}

.toggle-switch input:focus-visible + .toggle-slider {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.toggle-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-muted);
    min-width: 28px;
    transition: color var(--transition-fast);
}

.toggle-label.active {
    color: var(--accent-light);
}

/* ===== Convert Area ===== */
.convert-area {
    text-align: center;
    padding: 32px 0;
    border-top: 1px solid var(--border-light);
}

.btn-convert {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    padding: 16px 44px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-fast);
    font-family: inherit;
    box-shadow: 0 8px 32px rgba(124, 107, 240, 0.35);
    letter-spacing: -0.02em;
    position: relative;
    overflow: hidden;
}

.btn-convert::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn-convert:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-convert:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(124, 107, 240, 0.45);
}

.btn-convert:active:not(:disabled) {
    transform: translateY(-1px);
}

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

.btn-convert svg {
    flex-shrink: 0;
}

.convert-info {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.convert-info .sep {
    color: var(--text-dim);
    user-select: none;
}

.convert-info span:not(.sep) {
    font-weight: 500;
}

.convert-info::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success-glow);
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== Spinner ===== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ===== Footer ===== */
.footer {
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid var(--border-light);
    padding: 28px 24px;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.badge-item:hover {
    background: var(--bg-card);
}

.badge-item svg {
    color: var(--accent-light);
    filter: drop-shadow(0 0 4px var(--accent-glow));
}

.footer-content p {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.footer-links a {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-light);
}

.footer-copyright {
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-dim);
}

/* ===== Tab Navigation (in navbar) ===== */
.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-secondary);
    background: var(--bg-card-hover);
}

.tab.active {
    color: var(--accent-light);
    background: var(--accent-subtle);
}

.tab svg {
    flex-shrink: 0;
}

.section-content {
    display: none;
    animation: fadeInUp 300ms ease;
}

.section-content.active {
    display: block;
}

/* ===== PDF Card ===== */
.pdf-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
}

.pdf-card-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
}

.pdf-card-icon {
    color: var(--accent-light);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-card-icon svg {
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

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

.pdf-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

.pdf-card-actions {
    flex-shrink: 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .main {
        padding: 40px 20px 56px;
    }

    .hero {
        margin-bottom: 36px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .upload-zone {
        padding: 48px 24px;
    }

    .upload-icon {
        width: 72px;
        height: 72px;
    }

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

    .options-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 20px;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .image-card img {
        height: 120px;
    }

    .add-more-card {
        min-height: 120px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-actions {
        width: 100%;
    }

    .btn-add-more,
    .btn-clear {
        flex: 1;
        justify-content: center;
    }

    .trust-badges {
        gap: 12px;
    }
}

/* ===== Add More Card ===== */
.add-more-card {
    position: relative;
    background: var(--bg-card);
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    gap: 4px;
    padding: 8px;
}

.add-more-card:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.add-more-card:active {
    transform: translateY(0);
}

.add-more-card-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-light);
    transition: transform var(--transition-fast);
}

.add-more-card:hover .add-more-card-icon {
    transform: scale(1.2) rotate(90deg);
}

.add-more-card-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-light);
}

/* ===== Responsive (768px) ===== */
@media (max-width: 768px) {
    .tab {
        padding: 6px 10px;
        font-size: 12px;
    }
    .tab svg {
        display: none;
    }
}

/* ===== Responsive (480px) ===== */
@media (max-width: 480px) {
    .navbar {
        padding: 12px 16px;
    }

    .nav-content {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .logo {
        font-size: 16px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .hero p {
        font-size: 14px;
    }

    .upload-zone {
        padding: 36px 16px;
    }

    .btn-choose {
        padding: 12px 24px;
        font-size: 14px;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .image-card img {
        height: 100px;
    }

    .add-more-card {
        min-height: 100px;
    }

    .btn-convert {
        padding: 14px 32px;
        font-size: 15px;
        width: 100%;
        justify-content: center;
    }

    .trust-badges {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
}

/* ===== Card Animations ===== */
.card-enter {
    animation: cardEnter 350ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.card-exit {
    animation: cardExit 300ms ease-in both;
}

@keyframes cardExit {
    from {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
    to {
        opacity: 0;
        transform: scale(0.85) translateX(-30px);
    }
}

.card-flip {
    animation: cardFlip 400ms ease both;
}

@keyframes cardFlip {
    0% { transform: rotateY(0); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0); }
}

/* ===== Enhanced Spinner ===== */
.spinner-enhanced {
    display: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #fff;
    animation: spin 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

/* ===== Preview Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
    animation: overlayIn 250ms ease;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay.closing {
    animation: overlayOut 200ms ease forwards;
}

@keyframes overlayOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.modal-content {
    background: linear-gradient(145deg, rgba(35, 36, 48, 0.95), rgba(26, 27, 35, 0.98));
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 960px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(124, 107, 240, 0.1);
    animation: modalIn 300ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    gap: 12px;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modal-title svg {
    color: var(--accent);
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.filename-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.filename-input {
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 4px 10px;
    width: 110px;
    outline: none;
    transition: all var(--transition-fast);
}

.filename-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    width: 140px;
}

.filename-ext {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    user-select: none;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-light);
}

.preview-pages {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.preview-page {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    animation: cardEnter 350ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.preview-page:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.preview-page canvas {
    width: 100%;
    height: auto;
    display: block;
    background: #fff;
}

.preview-page-num {
    padding: 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding: 18px 24px;
    border-top: 1px solid var(--border-light);
    justify-content: flex-end;
    flex-shrink: 0;
}

.btn-modal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    border: none;
    letter-spacing: -0.01em;
}

.btn-modal-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
}

.btn-modal-secondary:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: var(--accent-subtle);
}

.btn-modal-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    box-shadow: 0 4px 16px rgba(124, 107, 240, 0.3);
}

.btn-modal-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 107, 240, 0.4);
}

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

/* ===== Ad Containers ===== */
.ad-container {
    min-height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.ad-container ins {
    max-width: 100%;
}

.ad-footer {
    padding: 16px 0 8px;
    border-top: 1px solid var(--border-light);
    margin-top: 16px;
}

.ad-modal {
    padding: 12px 24px;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    margin: 0;
}

/* ===== Zoom Overlay ===== */
.zoom-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.zoom-overlay.active {
    display: flex;
    animation: overlayIn 200ms ease;
}

.zoom-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-medium);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
}

.zoom-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-light);
    border-color: rgba(239, 68, 68, 0.3);
}

.zoom-content {
    max-width: 90vw;
    max-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-content canvas {
    max-width: 100%;
    max-height: 72vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl), 0 0 80px rgba(124, 107, 240, 0.08);
    animation: modalIn 250ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
    background: #fff;
}

.zoom-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.zoom-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-medium);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(8px);
}

.zoom-nav-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent-light);
    background: var(--accent-subtle);
}

.zoom-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.zoom-page-info {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    min-width: 100px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ===== Progress Overlay ===== */
.progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.progress-overlay.active {
    display: flex;
    animation: overlayIn 250ms ease;
}

.progress-card {
    background: linear-gradient(145deg, rgba(35, 36, 48, 0.95), rgba(26, 27, 35, 0.98));
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 40px 48px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-xl), 0 0 80px rgba(124, 107, 240, 0.12);
    animation: modalIn 300ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.progress-icon {
    color: var(--accent-light);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.progress-icon svg circle:last-child {
    animation: ringRotate 1.5s linear infinite;
}

@keyframes ringRotate {
    to { stroke-dashoffset: 0; }
}

.progress-icon.complete {
    color: var(--success);
}

.progress-icon.complete svg circle:last-child {
    animation: none;
}

.progress-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
    min-height: 28px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 14px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 100px;
    transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px var(--accent-glow);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s ease infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-variant-numeric: tabular-nums;
}

.btn-cancel {
    background: none;
    border: 1px solid var(--border-medium);
    color: var(--text-muted);
    padding: 8px 24px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-cancel:hover {
    border-color: var(--danger);
    color: var(--danger-light);
    background: rgba(239, 68, 68, 0.08);
}

/* ===== Cookie Consent Banner ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1300;
    background: rgba(26, 27, 35, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-medium);
    padding: 16px 24px;
    transform: translateY(100%);
    transition: transform 300ms ease;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner.hidden {
    display: none;
}

.cookie-content {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cookie-text p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.cookie-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.cookie-content a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 500;
}

.cookie-content a:hover {
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.btn-cookie {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.btn-cookie-outline {
    background: none;
    border: 1px solid var(--border-medium);
    color: var(--text-muted);
}

.btn-cookie-outline:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.btn-cookie-reject {
    background: none;
    border: 1px solid var(--border-medium);
    color: var(--text-muted);
}

.btn-cookie-reject:hover {
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

.btn-cookie-accept {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    box-shadow: 0 2px 8px rgba(124, 107, 240, 0.3);
}

.btn-cookie-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(124, 107, 240, 0.4);
}

/* ===== Cookie Preferences Modal ===== */
.cookie-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.cookie-modal-overlay.active {
    display: flex;
    animation: overlayIn 200ms ease;
}

.cookie-modal {
    background: linear-gradient(145deg, rgba(35, 36, 48, 0.97), rgba(26, 27, 35, 0.99));
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(124, 107, 240, 0.08);
    animation: modalIn 300ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
    overflow: hidden;
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.cookie-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.cookie-modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.cookie-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-light);
}

.cookie-modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cookie-pref-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.cookie-pref-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.cookie-pref-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.cookie-pref-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.toggle-switch.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cookie-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .cookie-text {
        align-items: center;
    }

    .cookie-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }

    .btn-cookie {
        flex: 1;
        min-width: 0;
        padding: 8px 12px;
        font-size: 12px;
    }

    .cookie-banner {
        padding: 14px 16px;
    }

    .cookie-modal-overlay {
        padding: 12px;
    }
}

/* ===== Tool Description ===== */
.tool-description {
    margin-bottom: 20px;
}

.tool-description p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.split-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 8px !important;
    line-height: 1.5;
}

/* ===== Split PDF Grid ===== */
.split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    padding: 16px 0;
}

.split-page-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.split-page-card.split-page-unchecked {
    opacity: 0.45;
}

.split-page-card.split-page-unchecked .split-page-label {
    border-color: var(--border-light);
}

.split-page-checkbox {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.split-page-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow: hidden;
    position: relative;
}

.split-page-checkbox:checked + .split-page-label {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.split-page-label:hover {
    border-color: var(--accent);
}

.split-page-thumb {
    width: 100%;
    height: auto;
    display: block;
    background: #fff;
}

.split-page-num {
    position: absolute;
    bottom: 4px;
    left: 6px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.55);
    padding: 1px 6px;
    border-radius: 3px;
    user-select: none;
    line-height: 1.4;
}

.split-page-checkbox:checked + .split-page-label .split-page-num {
    color: #fff;
}

@media (max-width: 480px) {
    .split-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 10px;
    }

    .split-page-checkbox {
        width: 18px;
        height: 18px;
        top: 4px;
        right: 4px;
    }

    .split-page-num {
        font-size: 10px;
    }
}

/* ===== Responsive Modal ===== */
@media (max-width: 768px) {
    .progress-card {
        padding: 32px 24px;
        max-width: 100%;
    }

    .progress-title {
        font-size: 16px;
    }

    .modal-overlay {
        padding: 12px;
    }

    .modal-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    .filename-input {
        width: 100%;
    }

    .filename-input:focus {
        width: 100%;
    }

    .ad-modal {
        padding: 10px 16px;
    }

    .preview-pages {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
        padding: 16px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn-modal {
        justify-content: center;
    }

    .zoom-content {
        max-height: 65vh;
    }

    .zoom-content canvas {
        max-height: 65vh;
    }
}

@media (max-width: 480px) {
    .ad-footer { display: none; }

    .filename-group {
        width: 100%;
    }

    .preview-pages {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-content {
        max-height: 92vh;
        border-radius: var(--radius-lg);
    }

    .zoom-nav-btn {
        width: 38px;
        height: 38px;
    }

    .zoom-page-info {
        font-size: 13px;
        min-width: 80px;
    }
}

/* ===== SEO Content Sections ===== */
.seo-content {
    padding: 32px 0 16px;
    border-top: 1px solid var(--border-light);
    margin-top: 8px;
}

.seo-content h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.seo-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-light);
    margin: 20px 0 6px;
}

.seo-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0 0 12px;
}

.seo-content ol {
    margin: 0 0 12px 20px;
    padding: 0;
}

.seo-content ol li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 6px;
}

.seo-content ol li strong {
    color: var(--text-primary);
    font-weight: 600;
}

@media (max-width: 480px) {
    .seo-content {
        padding: 24px 0 12px;
    }
    
    .seo-content h2 {
        font-size: 1.05rem;
    }
}
