:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-body: #f9fafb;
    --bg-white: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-light: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.875rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.hero {
    text-align: center;
    padding: 4rem 0 3rem;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 1rem auto 0;
}

/* Tool Interface */
.tool-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    min-height: 400px;
    transition: all 0.3s ease;
    margin-bottom: 4rem;
}

/* Upload Zone */
.upload-zone {
    padding: 4rem 2rem;
    text-align: center;
    border: 2px dashed var(--border-light);
    margin: 2rem;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8fafc;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Workspace (Settings) */
.workspace {
    display: none;
    /* Hidden by default */
    padding: 2rem;
}

.workspace.active {
    display: block;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

@media (max-width: 768px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

.settings-panel h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Position Grid */
.position-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    width: 150px;
    margin-top: 0.5rem;
}

.pos-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.pos-btn:hover {
    background: #eff6ff;
    border-color: var(--primary);
}

.pos-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
}

/* Live Preview */
.preview-container {
    background: #e5e7eb;
    padding: 2rem;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.pdf-page {
    background: white;
    width: 300px;
    height: 424px;
    /* A4 aspect ratio approx */
    position: relative;
    box-shadow: var(--shadow-md);
    border-radius: 2px;
}

.page-number-preview {
    position: absolute;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    padding: 4px;
}

/* Positioning Preview Classes */
.pos-tl {
    top: 20px;
    left: 20px;
}

.pos-tc {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.pos-tr {
    top: 20px;
    right: 20px;
}

.pos-ml {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

.pos-mc {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pos-mr {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

.pos-bl {
    bottom: 20px;
    left: 20px;
}

.pos-bc {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.pos-br {
    bottom: 20px;
    right: 20px;
}

/* SEO Content */
.content-section {
    max-width: 800px;
    /* Reading width */
    margin: 0 auto 4rem;
}

.content-section p,
.content-section ul,
.content-section li {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.content-section ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-item {
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

/* FAQ */
.faq-item {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-question {
    padding: 1.25rem;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-answer {
    padding: 0 1.25rem 1.25rem;
    color: var(--text-muted);
}

/* Footer */
footer {
    background: #111827;
    color: #9ca3af;
    padding: 4rem 0;
    margin-top: 4rem;
}

footer h4 {
    color: white;
    margin-bottom: 1rem;
}

footer ul {
    list-style: none;
    padding: 0;
}

footer li {
    margin-bottom: 0.5rem;
}

footer a {
    color: inherit;
}

footer a:hover {
    color: white;
}

/* Responsive */
@media (max-width: 640px) {
    h1 {
        font-size: 1.875rem;
    }

    .upload-zone {
        padding: 2rem 1rem;
        margin: 1rem;
    }
}