/* ============================================
   Resume Builder Styles
   ============================================ */

/* ---------- Builder Navigation ---------- */
.builder-nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}

.back-button {
    position: absolute;
    top: var(--space-xl);
    left: var(--space-xl);
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.back-button:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* ---------- Builder Screens ---------- */
.builder-screen {
    min-height: calc(100vh - 72px);
    display: none;
    padding-top: 72px;
}

.builder-screen.active {
    display: block;
}

/* ---------- Prompt Screen ---------- */
#promptScreen {
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    position: relative;
}

#promptScreen.active {
    display: flex;
}

.prompt-container {
    text-align: center;
    max-width: 600px;
    padding: var(--space-2xl);
}

.prompt-illustration {
    margin-bottom: var(--space-2xl);
}

.illustration-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
}

.prompt-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-md);
}

.prompt-description {
    font-size: 1.125rem;
    color: var(--gray-500);
    margin-bottom: var(--space-2xl);
}

.prompt-buttons {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
}

.prompt-buttons .btn {
    min-width: 140px;
}

/* ---------- Editor Layout ---------- */
#editorScreen {
    background: var(--gray-100);
}

#editorScreen.active {
    display: block;
}

.editor-layout {
    display: flex;
    height: calc(100vh - 72px);
}

/* ---------- Editor Sidebar ---------- */
.editor-sidebar {
    width: 200px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--gray-700);
    transition: all var(--transition-fast);
    text-align: left;
}

.sidebar-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.sidebar-icon {
    width: 20px;
    text-align: center;
}

.sidebar-label {
    flex: 1;
}

.sidebar-divider {
    height: 1px;
    background: var(--gray-200);
    margin: var(--space-md) 0;
}

/* ---------- Editor Main Area ---------- */
.editor-main {
    flex: 1;
    overflow: auto;
    padding: var(--space-xl);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.resume-container {
    background: var(--gray-200);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
}

.resume-page {
    width: 8.5in;
    min-height: 11in;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    padding: 0.75in;
    font-size: 11pt;
    line-height: 1.4;
}

/* ---------- Resume Header ---------- */
.resume-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--primary);
}

.resume-name {
    font-size: 28pt;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-xs);
    outline: none;
}

.resume-title {
    font-size: 14pt;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: var(--space-md);
    outline: none;
}

.resume-contact {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    font-size: 10pt;
    color: var(--gray-600);
}

.resume-contact span {
    outline: none;
}

/* ---------- Resume Sections ---------- */
.resume-section {
    margin-bottom: var(--space-xl);
    position: relative;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.resume-section:hover {
    background: rgba(10, 102, 194, 0.03);
}

.resume-section:hover .section-controls {
    opacity: 1;
}

.section-controls {
    position: absolute;
    top: 0;
    right: -60px;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.section-control-btn {
    width: 32px;
    height: 32px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.section-control-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.section-control-btn.drag-handle {
    cursor: grab;
}

.section-control-btn.drag-handle:active {
    cursor: grabbing;
}

.section-heading {
    font-size: 12pt;
    font-weight: 600;
    color: var(--gray-800);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--gray-300);
    outline: none;
}

.section-content {
    font-size: 11pt;
    color: var(--gray-700);
    outline: none;
}

/* ---------- Experience & Education Entries ---------- */
.experience-entry,
.education-entry {
    margin-bottom: var(--space-lg);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.entry-title-group {
    flex: 1;
}

.entry-title {
    font-size: 11pt;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
    outline: none;
}

.entry-company {
    font-size: 11pt;
    color: var(--gray-800);
    outline: none;
    font-weight: 500;
}

.entry-meta {
    text-align: right;
    font-size: 10pt;
    color: var(--gray-500);
}

.entry-date,
.entry-location {
    display: block;
    outline: none;
}

.entry-bullets {
    list-style: disc;
    margin-left: var(--space-lg);
    font-size: 11pt;
    color: var(--gray-700);
}

.entry-bullets li {
    margin-bottom: var(--space-xs);
    outline: none;
}

.entry-bullets li:focus {
    background: rgba(10, 102, 194, 0.05);
}

/* ---------- Add Buttons ---------- */
.add-bullet-btn,
.add-entry-btn {
    background: none;
    border: 1px dashed var(--gray-300);
    color: var(--gray-500);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.75rem;
    margin-top: var(--space-sm);
    transition: all var(--transition-fast);
}

.add-bullet-btn:hover,
.add-entry-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(10, 102, 194, 0.05);
}

/* ---------- Skills Container ---------- */
.skills-container {
    font-size: 11pt;
    color: var(--gray-700);
    outline: none;
}

/* ---------- Contenteditable Placeholders ---------- */
[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: var(--gray-400);
    font-style: italic;
}

[contenteditable="true"]:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---------- Upload Modal Enhancements ---------- */
.upload-drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-drop-zone:hover {
    border-color: var(--primary);
    background: rgba(10, 102, 194, 0.02);
}

.upload-drop-zone.dragging {
    border-color: var(--primary);
    background: rgba(10, 102, 194, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.upload-text {
    color: var(--gray-600);
    margin-bottom: var(--space-sm);
}

.upload-primary {
    color: var(--primary);
    font-weight: 500;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--gray-400);
}

.upload-progress {
    padding: var(--space-xl);
    text-align: center;
}

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    width: 0%;
    animation: progressAnimation 2s ease-in-out forwards;
}

@keyframes progressAnimation {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

.progress-text {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* ---------- Add Section Modal ---------- */
.section-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    padding: var(--space-lg) 0;
}

.section-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.section-option-btn:hover {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: var(--shadow-md);
}

.option-icon {
    font-size: 1.5rem;
}

.option-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

/* ---------- Responsive Styles ---------- */
@media (max-width: 1200px) {
    .resume-page {
        width: 100%;
        min-height: auto;
        padding: var(--space-xl);
    }

    .section-controls {
        right: -50px;
    }
}

@media (max-width: 768px) {
    .editor-layout {
        flex-direction: column;
    }

    .editor-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: var(--space-sm);
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }

    .sidebar-section {
        flex-direction: row;
    }

    .sidebar-divider {
        width: 1px;
        height: auto;
        margin: 0 var(--space-sm);
    }

    .sidebar-label {
        display: none;
    }

    .sidebar-btn {
        padding: var(--space-sm);
    }

    .sidebar-icon {
        width: auto;
    }

    .section-controls {
        position: static;
        flex-direction: row;
        opacity: 1;
        margin-bottom: var(--space-sm);
    }

    .prompt-buttons {
        flex-direction: column;
    }

    .section-options {
        grid-template-columns: 1fr;
    }
}

/* ---------- Download Format Modal ---------- */
.download-formats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.format-option {
    cursor: pointer;
}

.format-option input[type="radio"] {
    display: none;
}

.format-card {
    padding: var(--space-xl);
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-fast);
}

.format-option input[type="radio"]:checked+.format-card {
    border-color: var(--primary);
    background: rgba(10, 102, 194, 0.05);
    box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.1);
}

.format-card:hover {
    border-color: var(--primary-light);
}

.format-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.format-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-xs);
}

.format-desc {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Button Loading State */
.btn.loading .btn-text {
    opacity: 0.5;
}

.btn .spinner {
    display: none;
}

.btn.loading .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: var(--space-sm);
}

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

.hidden {
    display: none !important;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.visible {
    display: flex;
}

.modal-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.modal-large {
    max-width: 800px;
}

.download-step {
    transition: all 0.3s ease;
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 36px;
    height: 36px;
    background: var(--gray-100);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.modal-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.modal-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-xs);
}

.modal-subtitle {
    color: var(--gray-500);
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .download-formats {
        grid-template-columns: 1fr;
    }
}

/* ---------- Branding Toggle ---------- */
.sidebar-branding {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
}

.branding-icon {
    font-size: 1rem;
}

.branding-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    margin-left: auto;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

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

.branding-toggle input:checked+.toggle-slider {
    background: #10B981;
}

.branding-toggle input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* ---------- Templates Modal ---------- */
.modal-large {
    max-width: 850px;
    width: 90%;
}

.modal-tabs {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: var(--space-xs);
}

.modal-tab {
    background: none;
    border: none;
    padding: var(--space-sm) var(--space-lg);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.modal-tab:hover {
    color: var(--primary);
}

.modal-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.template-tab-content {
    display: none;
}

.template-tab-content.active {
    display: block;
}

.templates-grid,
.templates-grid-large {
    display: grid;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.templates-grid {
    grid-template-columns: repeat(2, 1fr);
}

.templates-grid-large {
    grid-template-columns: repeat(3, 1fr);
    max-height: 450px;
    overflow-y: auto;
    padding-right: var(--space-sm);
}

.template-card {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
}

/* Category Badges for Premium Themes */
.theme-category-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.template-card:hover {
    transform: translateY(-2px);
}

.template-card.selected .template-preview {
    border: 3px solid #10B981;
}

.template-card.selected::after {
    content: '✓';
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: #10B981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.template-preview {
    height: 180px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    position: relative;
}

.template-professional .preview-header {
    height: 30px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
}

.template-professional .preview-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.preview-line {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
}

.preview-line.wide {
    width: 100%;
}

.preview-line.short {
    width: 60%;
}

/* Template Preview - Modern (for thumbnail only, not resume-page) */
.template-preview.template-modern {
    display: flex;
    gap: var(--space-md);
}

.template-preview.template-modern .preview-sidebar {
    width: 40%;
    background: var(--primary);
    border-radius: var(--radius-sm);
}

.template-preview.template-modern .preview-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding-top: var(--space-md);
}

.template-creative .preview-header-accent {
    height: 40px;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
}

.template-minimal .preview-divider {
    height: 2px;
    background: var(--gray-300);
    margin: var(--space-md) 0;
}

.template-executive .preview-header-dark {
    height: 40px;
    background: #1D2226;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
}

.template-simple-preview .preview-content {
    border-top: 2px solid #333;
    padding-top: var(--space-md);
}

.template-name {
    display: block;
    text-align: center;
    padding: var(--space-md) 0;
    font-weight: 500;
    color: var(--gray-700);
}

.template-card.selected .template-name {
    color: #10B981;
    font-weight: 600;
}

.template-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--gray-200);
    padding-top: var(--space-lg);
}

.doc-size-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
    color: var(--gray-600);
}

.size-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background: var(--white);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.size-btn.active {
    border-color: #10B981;
    color: #10B981;
    background: rgba(16, 185, 129, 0.05);
}

/* ---------- Design & Font Panel ---------- */
.design-panel {
    position: fixed;
    top: 72px;
    right: -350px;
    width: 320px;
    height: calc(100vh - 72px);
    background: var(--white);
    border-left: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: right var(--transition-base);
    overflow-y: auto;
}

.design-panel.visible {
    right: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.panel-close {
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: var(--gray-500);
    transition: all var(--transition-fast);
}

.panel-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.panel-content {
    padding: var(--space-lg);
}

.panel-group {
    margin-bottom: var(--space-xl);
}

.panel-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.slider-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--gray-400);
}

.panel-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    outline: none;
}

.panel-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #10B981;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: var(--space-xs);
}

/* Color Palette */
.color-palette {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.selected {
    border-color: var(--white);
    box-shadow: 0 0 0 3px var(--primary);
}

.color-btn.selected::after {
    content: '✓';
    color: var(--white);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.custom-color-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
}

.custom-color-btn:hover {
    text-decoration: underline;
}

/* Font Select */
.panel-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--gray-900);
    background: var(--white);
    cursor: pointer;
}

.panel-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ---------- Branding Payment Modal ---------- */
.branding-features {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.feature-item {
    padding: var(--space-sm) 0;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.feature-item:first-child {
    padding-top: 0;
}

.branding-price {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

.price-period {
    display: block;
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: var(--space-xs);
}

.branding-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: var(--space-md);
}

/* ---------- Drag & Drop / Rearrange Mode ---------- */
.rearrange-mode .resume-section {
    border: 2px dashed var(--gray-300);
    cursor: grab;
}

.rearrange-mode .resume-section:hover {
    border-color: var(--primary);
    background: rgba(10, 102, 194, 0.05);
}

.rearrange-mode .resume-section.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.rearrange-mode .resume-section.drag-over {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.05);
}

.rearrange-hint {
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: var(--white);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    z-index: 100;
    display: none;
}

.rearrange-mode .rearrange-hint {
    display: block;
}

/* ---------- Theme Variable Mapping ---------- */
/* Maps master-resume.html variables to builder classes */

.resume-page[data-style] {
    background-color: var(--bg-color);
}

.resume-page[data-style] .resume-name {
    color: var(--primary-color);
    font-family: var(--font-heading);
}

.resume-page[data-style] .resume-title {
    color: var(--secondary-color);
    font-family: var(--font-heading);
}

.resume-page[data-style] .resume-contact {
    display: flex;
    gap: 1rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.resume-page[data-style] .section-heading {
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

.resume-page[data-style="underlined"] .section-heading {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 4px;
}

.resume-page[data-style="boxed"] .section-heading {
    background-color: var(--primary-color);
    color: white !important;
    padding: 8px;
    border-radius: 4px;
}

.resume-page[data-style] .entry-title {
    color: var(--text-color);
}

.resume-page[data-style] .entry-company {
    color: var(--gray-800);
}

.resume-page[data-style] .resume-section {
    margin-bottom: var(--spacing-unit);
}

.resume-page[data-style] .section-content,
.resume-page[data-style] .entry-bullets li {
    font-family: var(--font-body);
    color: var(--text-color);
}

/* ============================================
   STANDARD TEMPLATE STYLES
   Each template has unique visual identity
   ============================================ */

/* ---------- Professional Template ---------- */

.resume-page.template-professional .resume-header {
    text-align: center;
    border-bottom: 3px solid #0A66C2;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.resume-page.template-professional .resume-name {
    color: #1F2937;
    font-size: 28pt;
    letter-spacing: 0.02em;
}

.resume-page.template-professional .resume-title {
    color: #0A66C2;
}

.resume-page.template-professional .section-heading {
    color: #0A66C2;
    border-bottom: 2px solid #0A66C2;
    padding-bottom: 0.25rem;
}

/* ---------- Modern Template ---------- */
.resume-page.template-modern {
    position: relative;
    padding-left: 1in;
}

.resume-page.template-modern::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    background: linear-gradient(180deg, #1E3A5F 0%, #3B82F6 100%);
}

.resume-page.template-modern .resume-header {
    text-align: left;
    border-bottom: none;
    border-left: none;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.resume-page.template-modern .resume-name {
    color: #1E3A5F;
    font-size: 26pt;
    font-weight: 700;
}

.resume-page.template-modern .resume-title {
    color: #3B82F6;
    font-weight: 500;
}

.resume-page.template-modern .resume-contact {
    justify-content: flex-start;
    gap: 1.5rem;
}

.resume-page.template-modern .section-heading {
    color: #1E3A5F;
    border-bottom: none;
    position: relative;
    padding-left: 1rem;
}

.resume-page.template-modern .section-heading::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #3B82F6;
    border-radius: 2px;
}

/* ---------- Creative Template ---------- */
.resume-page.template-creative {
    padding-top: 0;
}

.resume-page.template-creative .resume-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    margin: -0.75in -0.75in 1.5rem -0.75in;
    text-align: center;
    border-bottom: none;
}

.resume-page.template-creative .resume-name {
    color: white;
    font-size: 30pt;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.resume-page.template-creative .resume-title {
    color: rgba(255, 255, 255, 0.9);
}

.resume-page.template-creative .resume-contact {
    color: rgba(255, 255, 255, 0.85);
}

.resume-page.template-creative .section-heading {
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.25rem;
}

.resume-page.template-creative .entry-company {
    color: #764ba2;
}

/* ---------- Executive Template ---------- */
.resume-page.template-executive {
    padding-top: 0;
}

.resume-page.template-executive .resume-header {
    background: #1D2226;
    color: white;
    padding: 1.5rem;
    margin: -0.75in -0.75in 1.5rem -0.75in;
    text-align: center;
    border-bottom: none;
}

.resume-page.template-executive .resume-name {
    color: white;
    font-size: 28pt;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.resume-page.template-executive .resume-title {
    color: #C4A052;
    font-weight: 500;
}

.resume-page.template-executive .resume-contact {
    color: rgba(255, 255, 255, 0.8);
}

.resume-page.template-executive .section-heading {
    color: #1D2226;
    border-bottom: 2px solid #C4A052;
    padding-bottom: 0.25rem;
}

.resume-page.template-executive .entry-company {
    color: #C4A052;
}

/* ---------- Simple Template ---------- */
.resume-page.template-simple {
    font-family: 'Georgia', 'Times New Roman', serif;
}

.resume-page.template-simple .resume-header {
    text-align: left;
    border-bottom: 1px solid #333;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.resume-page.template-simple .resume-name {
    color: #000;
    font-size: 24pt;
    font-weight: normal;
}

.resume-page.template-simple .resume-title {
    color: #333;
    font-style: italic;
}

.resume-page.template-simple .resume-contact {
    justify-content: flex-start;
    gap: 1rem;
    font-size: 10pt;
    color: #666;
}

.resume-page.template-simple .section-heading {
    color: #000;
    border-bottom: 1px solid #333;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 11pt;
    padding-bottom: 0.25rem;
}

.resume-page.template-simple .entry-company {
    color: #333;
}


@media (max-width: 768px) {
    .design-panel {
        width: 100%;
        right: -100%;
    }

    .templates-grid {
        grid-template-columns: 1fr;
    }

    .template-footer {
        flex-direction: column;
        gap: var(--space-lg);
    }
}

/* ============================================
   Clean Download Modal Styles
   ============================================ */

.download-modal-container {
    max-width: 520px;
    padding: var(--space-2xl);
}

.modal-header-centered {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.modal-icon-circle {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    color: #0284C7;
}

.modal-icon-circle.payment-icon {
    background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
    color: #0284C7;
}

.modal-icon-circle.success-icon {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    color: #059669;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-xs);
}

.modal-step-text {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Format Selection Grid */
.download-format-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.download-format-card {
    cursor: pointer;
    display: block;
}

.download-format-card input[type="radio"] {
    display: none;
}

.format-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl) var(--space-lg);
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    text-align: center;
}

.download-format-card:hover .format-card-inner {
    border-color: var(--primary-light);
    background: var(--gray-50);
}

.download-format-card.selected .format-card-inner,
.download-format-card input[type="radio"]:checked~.format-card-inner {
    border-color: #0284C7;
    background: rgba(2, 132, 199, 0.04);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.08);
}

.format-icon-large {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.format-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.format-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.format-subtitle {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Price Bar */
.download-price-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    font-size: 1rem;
    color: var(--gray-700);
}

.download-price-bar .price-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* Next Button */
.download-next-btn {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-next-btn:hover {
    background: linear-gradient(135deg, #0369A1 0%, #075985 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.download-next-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Button Spinner */
.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.download-next-btn.loading .btn-text {
    opacity: 0.7;
}

.download-next-btn.loading .btn-spinner {
    display: inline-block;
}

/* Payment Order Summary */
.payment-order-summary {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.order-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    color: var(--gray-600);
    font-size: 0.95rem;
}

.order-row.total {
    border-top: 1px solid var(--gray-200);
    margin-top: var(--space-sm);
    padding-top: var(--space-md);
    font-weight: 600;
    color: var(--gray-900);
}

.order-row .total-price {
    font-size: 1.25rem;
    color: var(--gray-900);
}

/* Demo Notice */
.payment-demo-notice {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.demo-badge {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #92400E;
    margin-bottom: var(--space-xs);
}

.payment-demo-notice p {
    font-size: 0.85rem;
    color: #B45309;
    margin: 0;
}

/* Back Link */
.back-link {
    width: 100%;
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 0.9rem;
    padding: var(--space-md);
    margin-top: var(--space-sm);
    cursor: pointer;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--gray-700);
}

/* Success Animation */
.success-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-2xl) 0;
}

.checkmark-circle {
    width: 100px;
    height: 100px;
}

.checkmark-circle-bg {
    fill: none;
    stroke: #10B981;
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    fill: none;
    stroke: #10B981;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

/* Download Help Text */
.download-help-text {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-top: var(--space-lg);
}

/* Responsive */
@media (max-width: 480px) {
    .download-format-grid {
        grid-template-columns: 1fr;
    }

    .download-modal-container {
        padding: var(--space-lg);
    }

    .format-card-inner {
        flex-direction: row;
        text-align: left;
        padding: var(--space-lg);
    }

    .format-icon-large {
        font-size: 2rem;
        margin-bottom: 0;
        margin-right: var(--space-md);
    }
}