:root {
    --primary: #6366f1;
    --primary-light: #e0e7ff;
    --secondary: #10b981;
    --bg: #f8fafc;
    --text: #1e293b;
    --border: #e2e8f0;
    --sidebar-width: 480px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
    display: flex;
}

/* Left side: Form Editor */
.editor-sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.editor-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.editor-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.steps-nav {
    display: flex;
    padding: 15px 24px;
    background: #f8fafc;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.step-indicator {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    transition: all 0.3s;
}

.step-indicator.active {
    background: var(--primary);
}

.form-container {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2.step-title {
    margin-bottom: 8px;
    font-size: 1.25rem;
    font-weight: 700;
}

p.step-desc {
    margin-bottom: 24px;
    color: #64748b;
    font-size: 0.875rem;
}

.form-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.profile-photo-upload {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    background: white;
    transition: all 0.2s;
    flex-shrink: 0;
}

.profile-photo-upload:hover {
    border-color: var(--primary);
    background: #f1f5f9;
}

.photo-preview-placeholder {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
}

.show-more-toggle {
    display: inline-block;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    user-select: none;
}

.show-more-toggle:hover {
    text-decoration: underline;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.repeatable-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.repeatable-item .remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
}

.pv-element,
.cv-element {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.add-btn {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    margin-top: 8px;
}

.btn-group {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}

.btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* Right side: Live Preview */
.preview-pane {
    flex: 1;
    background: #64748b;
    /* Darker background for professional feel */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    overflow-y: auto;
}

/* Margins Toolbar styles removed */


.resume-paper {
    width: 210mm;
    background: transparent;
    padding: 0;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    /* Space between pages */
}

.page-sheet {
    width: 210mm;
    height: 297mm;
    background: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.page-indicator {
    position: absolute;
    right: -100px;
    top: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Template Item Grid */
.template-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.template-item {
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: #f1f5f9;
    transition: all 0.2s;
}

.template-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.template-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.template-item.active::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body {
        margin: 0;
        padding: 0;
        background: white;
        overflow: visible !important;
        height: auto !important;
    }

    .editor-sidebar,
    .btn-group,
    .page-indicator,
    .lang-selectors,
    #shape-customizer-sidebar,
    #photo-customizer-sidebar,
    #cust-toolbar {
        display: none !important;
    }

    .preview-pane {
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        overflow: visible !important;
        display: block !important;
    }

    .resume-paper {
        width: 100% !important;
        gap: 0 !important;
        display: block !important;
    }

    .page-sheet {
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
        page-break-after: always;
        position: relative;
        left: 0;
        top: 0;
        width: 210mm !important;
        height: 297mm !important;
    }

    /* Keep absolute elements positioned correctly in print layout */
    .pv-element {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}