/**
 * PDF to Image Converter - Standalone Complete Styles
 * NO external dependencies - all styles self-contained
 * Prefix: pti- (pdf-to-image)
 */

/* ========== CSS VARIABLES & BASE STYLES ========== */
:root {
    --bg-1: #8ef3c0;
    --bg-2: #22d3ee;
    --text-main: #041317;
    --text-muted: rgba(4, 19, 23, 0.78);
    --card: rgba(255, 255, 255, 0.97);
    --card-soft: rgba(255, 255, 255, 0.94);
    --glass-bg: rgba(255, 255, 255, 0.97);
    --border-soft: rgba(255, 255, 255, 0.8);
    --accent: #22c55e;
    --accent-blue: #0ea5e9;
    --accent-dark: #022c22;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 28px;
    --radius-xl: 24px;
    --radius-pill: 999px;
    --shadow-soft: 0 18px 50px rgba(15, 23, 42, 0.32);
    --shadow-small: 0 12px 28px rgba(15, 23, 42, 0.18);
    --transition-fast: 200ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-med: 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-1) 100%);
    min-height: 100vh;
}

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

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn.primary {
    background: var(--accent);
    color: white;
}

.btn.primary:hover:not(:disabled) {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn.secondary {
    background: #f1f5f9;
    color: var(--text-main);
}

.btn.secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.btn.small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn.danger {
    color: #dc2626;
}

.btn.danger:hover {
    background: #fee2e2;
}

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

/* ========== ENHANCED HERO SECTION ========== */
.tool-header {
    background: transparent;
    padding: 60px 0 80px;
    position: relative;
    overflow: hidden;
    border-bottom: none;
    margin-bottom: 40px;
}

/* Animated background gradient orbs */
.tool-header::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    top: -200px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.tool-header::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -150px;
    left: -100px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

.tool-header .container {
    position: relative;
    z-index: 1;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 50px;
    width: fit-content;
}

.breadcrumb a {
    color: var(--text-main);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.breadcrumb a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.breadcrumb .separator {
    color: var(--text-muted);
}

.breadcrumb .current {
    color: var(--text-main);
    font-weight: 600;
}

.tool-title {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 20px;
    color: var(--text-main);
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: none;
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-subtitle {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 24px;
    font-weight: 500;
    max-width: 600px;
    line-height: 1.6;
    animation: slideInUp 0.6s ease-out 0.1s backwards;
}

.trust-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: slideInUp 0.6s ease-out 0.2s backwards;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.trust-icon {
    width: 20px;
    height: 20px;
    color: #4ade80;
    filter: drop-shadow(0 2px 4px rgba(74, 222, 128, 0.4));
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* ========== MAIN CONTENT ========== */
.tool-main {
    flex: 1;
    padding-bottom: 100px;
}

/* ========== FOOTER ========== */
.tool-footer {
    background: white;
    border-top: 1px solid var(--border-soft);
    padding: 32px 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-content p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

.footer-content a {
    color: var(--accent);
    text-decoration: none;
}

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

.footer-nav {
    display: flex;
    gap: 24px;
}

.footer-nav a {
    font-size: 14px;
    font-weight: 500;
}

/* ========== Scope Wrapper ========== */
.tool-pdf-to-image {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== Toast Notifications ========== */
.pti-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.pti-toast {
    background: var(--card);
    border: 1px solid var(--border-soft);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: start;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: all;
    animation: pti-toast-in 0.3s ease;
}

.pti-toast.success {
    border-left: 4px solid var(--accent);
}

.pti-toast.error {
    border-left: 4px solid #ef4444;
}

.pti-toast.warning {
    border-left: 4px solid #f59e0b;
}

.pti-toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.pti-toast.success .pti-toast-icon {
    color: var(--accent);
}

.pti-toast.error .pti-toast-icon {
    color: #ef4444;
}

.pti-toast.warning .pti-toast-icon {
    color: #f59e0b;
}

.pti-toast-content {
    flex: 1;
}

.pti-toast-message {
    margin: 0;
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.5;
}

@keyframes pti-toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pti-toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ========== Layout ========== */
.tool-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    margin-top: 32px;
}

/* ========== Cards ========== */
.pti-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.pti-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

.pti-card-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(249, 250, 251, 0.8));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pti-card-title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.pti-header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pti-card-body {
    padding: 28px;
    background: white;
}

/* ========== Dropzone ========== */
.pti-dropzone {
    border: 2px dashed rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    padding: 56px 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.pti-dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.03) 0%, rgba(34, 211, 238, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pti-dropzone:hover::before,
.pti-dropzone:focus::before {
    opacity: 1;
}

.pti-dropzone:hover,
.pti-dropzone:focus {
    border-color: var(--accent);
    border-width: 2px;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
    outline: none;
    transform: translateY(-2px);
}

.pti-dropzone.drag-over {
    border-color: var(--accent);
    border-style: solid;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 211, 238, 0.1) 100%);
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.2);
    transform: scale(1.02);
}

.pti-dropzone.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.5);
}

.pti-dropzone-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    color: var(--accent);
    filter: drop-shadow(0 2px 8px rgba(34, 197, 94, 0.2));
}

.pti-dropzone-text {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.pti-dropzone-subtext {
    margin: 0 0 16px;
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 500;
}

.pti-dropzone-formats {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== Pages Grid ========== */
.pti-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.pti-page-item {
    cursor: pointer;
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.pti-page-item:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.pti-page-item.selected {
    border-color: var(--accent);
    border-width: 3px;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15), 0 4px 12px rgba(34, 197, 94, 0.2);
    transform: translateY(-2px);
}

.pti-page-item.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent) 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
    animation: checkmark-pop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkmark-pop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

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

.pti-page-number {
    padding: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    background: linear-gradient(to bottom, rgba(249, 250, 251, 1), rgba(255, 255, 255, 1));
}

/* ========== Results Grid ========== */
.pti-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.pti-result-item {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.pti-result-item:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    border-color: var(--accent);
}

.pti-result-preview {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    background: #f9fafb;
}

.pti-result-info {
    padding: 16px;
}

.pti-result-name {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pti-result-meta {
    margin: 0 0 14px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

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

.pti-result-actions .btn {
    flex: 1;
    font-size: 13px;
    padding: 10px 14px;
    font-weight: 600;
}

/* ========== Settings ========== */
.pti-setting-group {
    margin-bottom: 28px;
}

.pti-setting-group:last-child {
    margin-bottom: 0;
}

.pti-label {
    display: block;
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.pti-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pti-radio {
    display: flex;
    align-items: start;
    gap: 12px;
    cursor: pointer;
    padding: 14px 16px;
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    transition: all 0.2s ease;
    background: white;
}

.pti-radio:hover {
    border-color: var(--accent);
    background: rgba(34, 197, 94, 0.02);
    transform: translateX(2px);
}

.pti-radio:has(input:checked) {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(34, 211, 238, 0.05) 100%);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.pti-radio input[type="radio"] {
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.pti-radio-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pti-radio-label strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.pti-radio-label small {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== Buttons ========== */
.pti-btn-text {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pti-btn-text:hover {
    background: rgba(34, 197, 94, 0.1);
}

.pti-btn-text.danger {
    color: #ef4444;
}

.pti-btn-text.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.pti-btn-text svg {
    width: 16px;
    height: 16px;
}

/* ========== Action Bar ========== */
.pti-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-top: 1px solid var(--border-soft);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    z-index: 100;
    padding: 20px 0;
}

.pti-action-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pti-action-info {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
}

.pti-action-info span {
    color: var(--accent);
    font-weight: 700;
}

.pti-action-buttons {
    display: flex;
    gap: 12px;
}

/* ========== Progress ========== */
.pti-progress {
    margin-top: 16px;
}

.pti-progress-bar {
    height: 6px;
    background: var(--bg-subtle);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

.pti-progress-text {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* ========== Phase 2: UX Redesign Styles ========== */

/* Upload States */
.pti-upload-empty,
.pti-upload-parsing,
.pti-upload-summary,
.pti-upload-error {
    transition: opacity 0.3s ease;
}

.pti-upload-parsing {
    text-align: center;
    padding: 40px 20px;
}

.pti-parsing-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border: 4px solid rgba(148, 163, 184, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: pti-spin 0.8s linear infinite;
}

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

.pti-parsing-text {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
}

/* File Summary */
.pti-upload-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(34, 211, 238, 0.05) 100%);
    border: 2px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    gap: 16px;
}

.pti-file-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.pti-file-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    color: var(--accent);
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.pti-file-icon svg {
    width: 28px;
    height: 28px;
}

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

.pti-file-name {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pti-file-meta {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.pti-file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Error State */
.pti-upload-error {
    text-align: center;
    padding: 40px 20px;
}

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

.pti-error-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #ef4444;
}

.pti-error-message {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Selection Toolbar */
.pti-selection-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(to bottom, rgba(249, 250, 251, 1), rgba(255, 255, 255, 1));
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.pti-page-range {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.pti-page-range-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
}

.pti-page-range-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.pti-page-range-input::placeholder {
    color: var(--text-muted);
}

/* Range Validation */
.pti-range-validation {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pti-range-validation.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.pti-range-validation.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #059669;
}

/* Selection Summary */
.pti-selection-summary {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(34, 211, 238, 0.05) 100%);
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.pti-summary-count {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--text-main);
}

.pti-summary-count strong {
    color: var(--accent);
    font-weight: 700;
}

.pti-summary-size {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* Settings Sections */
.pti-setting-section {
    margin-bottom: 28px;
}

.pti-setting-section:last-child {
    margin-bottom: 0;
}

/* Helper Text */
.pti-helper-text {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.5;
}

/* Text Input */
.pti-text-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
}

.pti-text-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* File Preview */
.pti-file-preview {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

/* Advanced Toggle */
.pti-advanced-toggle {
    margin-top: 24px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.pti-advanced-summary {
    padding: 14px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    background: linear-gradient(to bottom, rgba(249, 250, 251, 1), rgba(255, 255, 255, 1));
    transition: all 0.2s ease;
    list-style: none;
    user-select: none;
}

.pti-advanced-summary::-webkit-details-marker {
    display: none;
}

.pti-advanced-summary:hover {
    background: rgba(34, 197, 94, 0.05);
}

.pti-advanced-content {
    padding: 16px;
    background: white;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.pti-warning-note {
    display: flex;
    align-items: start;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.5;
    margin: 0;
}

.pti-warning-note svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #f59e0b;
}

/* Action Bar Success State */
.pti-success-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 211, 238, 0.1) 100%);
    border-radius: 12px;
    border: 2px solid rgba(34, 197, 94, 0.3);
}

.pti-success-message {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}

.pti-success-actions {
    display: flex;
    gap: 12px;
}

/* Skeleton Loaders */
.pti-skeleton {
    background: linear-gradient(90deg,
            rgba(148, 163, 184, 0.1) 0%,
            rgba(148, 163, 184, 0.2) 50%,
            rgba(148, 163, 184, 0.1) 100%);
    background-size: 200% 100%;
    animation: pti-skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

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

    100% {
        background-position: -200% 0;
    }
}

.pti-skeleton-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1.4;
    border-radius: 12px;
}

/* ========== Responsive ========== */
@media (max-width: 968px) {
    .tool-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

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

    .pti-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }

    .pti-action-content {
        flex-direction: column;
        gap: 16px;
    }

    .pti-action-buttons {
        width: 100%;
    }

    .pti-action-buttons .btn {
        flex: 1;
    }
}

@media (max-width: 640px) {
    .tool-title {
        font-size: 28px;
    }

    .pti-dropzone {
        padding: 32px 16px;
    }

    .pti-dropzone-icon {
        width: 48px;
        height: 48px;
    }

    .pti-dropzone-text {
        font-size: 16px;
    }

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

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

    .pti-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .pti-toast {
        min-width: auto;
        max-width: calc(100vw - 48px);
    }

    .pti-toast-container {
        left: 24px;
        right: 24px;
    }

    .pti-selection-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .pti-page-range {
        flex-direction: column;
        min-width: 100%;
    }

    .pti-file-actions {
        flex-direction: column;
        width: 100%;
    }

    .pti-file-actions .btn {
        width: 100%;
    }

    .pti-success-state {
        flex-direction: column;
        gap: 16px;
    }

    .pti-success-actions {
        width: 100%;
        flex-direction: column;
    }

    .pti-success-actions .btn {
        width: 100%;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-nav {
        flex-direction: column;
        gap: 12px;
    }
}