:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --upload-border: #cbd5e1;
    --upload-bg: #f8fafc;
    --upload-hover: #eef2ff;
}

body {
    background-color: #ffffff;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body.toolistfy-embed {
    overflow: hidden;
    background: #fff;
}

body.toolistfy-embed .tool-header {
    display: none;
}

.tool-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.toolistify-brand {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.toolistify-brand-logo {
    width: 156px;
    height: auto;
    display: block;
}

body.toolistfy-embed .hero-section {
    display: none !important;
}

body.toolistfy-embed .hero-section h1 {
    font-size: clamp(2.3rem, 4vw, 3.35rem);
    line-height: 1.1;
}

body.toolistfy-embed > .container,
body.toolistfy-embed main > .container {
    max-width: 1120px;
    padding-top: 2.25rem !important;
    padding-bottom: 1.75rem !important;
}

body.toolistfy-embed .upload-area {
    padding: 2.4rem 2rem;
}

body.toolistfy-embed #faqSection {
    display: none !important;
}

.hero-section {
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
}

.upload-area {
    border: 2px dashed var(--upload-border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--upload-bg);
    transition: all 0.25s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: var(--upload-hover);
    transform: translateY(-2px);
}

.upload-icon {
    color: var(--primary-color);
}

.upload-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.file-list .list-group-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px !important;
    margin-bottom: 0.5rem;
    transition: box-shadow 0.2s ease;
}

.file-list .list-group-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.file-list .list-group-item.sortable-ghost {
    opacity: 0.4;
    background: #eef2ff;
}

.drag-handle {
    cursor: grab;
    color: #94a3b8;
    font-size: 1.25rem;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.pdf-icon {
    width: 40px;
    height: 40px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-info .file-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-info .file-meta {
    font-size: 0.875rem;
    color: #64748b;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-primary:disabled {
    background-color: #a5b4fc;
    border-color: #a5b4fc;
}

#processingSection {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.page-list .page-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.page-list .page-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.page-list .page-item.sortable-ghost {
    opacity: 0.4;
    background: #eef2ff;
}

.page-number-badge {
    min-width: 2.5rem;
    height: 2.5rem;
    background: var(--primary-color);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.page-item-info {
    flex: 1;
    min-width: 0;
}

.page-item-info .page-title {
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.page-item-info .page-source {
    font-size: 0.8125rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .file-list .list-group-item {
        flex-wrap: wrap;
    }
}
