/* ==========================================
   RESUME MAKER DESIGN SYSTEM
   ========================================== */

:root {
    /* Dashboard Theme (Dark Mode Default) */
    --bg-main: #0b0f19;
    --bg-panel: #111827;
    --bg-input: #1f2937;
    --border-color: #374151;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --panel-border: 1px solid rgba(255, 255, 255, 0.05);

    /* Resume Document Variables (Updated by App.js) */
    --resume-accent: #1e3a8a;
    --resume-font: 'Inter', sans-serif;
    --resume-text-main: #1f2937;
    --resume-text-light: #4b5563;
    --resume-text-muted: #9ca3af;
    --resume-size: 14px;
    
    /* Layout Variables (Sliders) */
    --resume-padding: 20mm;
    --resume-section-margin: 15px;
    --resume-line-height: 1.45;
}

/* Light Theme Variables (High Contrast) */
body.theme-light {
    --bg-main: #f1f5f9;               /* Slate 100 */
    --bg-panel: #ffffff;              /* Pure White Panel */
    --bg-input: #ffffff;              /* Pure White Inputs */
    --border-color: #cbd5e1;          /* Slate 300 - clearly visible */
    --text-primary: #0f172a;          /* Slate 900 */
    --text-secondary: #475569;        /* Slate 600 */
    --text-muted: #64748b;            /* Slate 500 */
    --panel-border: 1px solid #e2e8f0; /* Slate 200 */
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Outfit', 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* Header Styling */
.main-header {
    background-color: var(--bg-panel);
    border-bottom: var(--panel-border);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-primary);
}

.separator {
    color: var(--border-color);
    font-size: 1.2rem;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.logo-text span {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Button UI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.btn-danger:hover {
    background-color: var(--danger-color);
    color: white;
}

.btn-icon-only {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 8px;
    background-color: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-icon-only:hover {
    color: var(--text-primary);
    background-color: var(--border-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Dark/Light Icons Toggle */
#theme-toggle .sun-icon {
    display: none;
}

#theme-toggle .moon-icon {
    display: block;
}

body.theme-light #theme-toggle .sun-icon {
    display: block;
}

body.theme-light #theme-toggle .moon-icon {
    display: none;
}

/* Advertisements placeholders */
.ad-container {
    background-color: var(--bg-panel);
    border: var(--panel-border);
    margin: 8px auto 0;
    max-width: 970px;
    width: 95%;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.top-ad {
    height: 60px;
}

.ad-placeholder {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Workspace Panels */
.app-workspace {
    display: grid;
    grid-template-columns: 480px 1fr;
    flex: 1;
    max-width: 1440px;
    width: 100%;
    margin: 16px auto;
    padding: 0 16px;
    gap: 16px;
    overflow: hidden;
}

/* Form Settings & Inputs (Left Panel) */
.form-panel {
    background-color: var(--bg-panel);
    border-radius: 12px;
    border: var(--panel-border);
    box-shadow: var(--glass-shadow);
    display: flex;
    overflow: hidden;
    height: calc(100vh - 170px);
}

.panel-inner {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar Tab Icons Navigation */
.form-tabs {
    width: 80px;
    background-color: rgba(0, 0, 0, 0.15);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 8px;
}

.tab-btn {
    width: 64px;
    height: 64px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    font-family: inherit;
    transition: all 0.2s;
}

.tab-btn svg {
    transition: transform 0.2s;
}

.tab-btn span {
    font-size: 0.65rem;
    font-weight: 600;
}

.tab-btn:hover {
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.02);
}

.tab-btn:hover svg {
    transform: scale(1.05);
}

.tab-btn.active {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

/* Form Content Area */
.form-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;                        /* Increased spacing from 20px to 24px */
}

.form-group-wrapper {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-group-wrapper.active {
    display: block;
}

.form-group-wrapper h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Grid Layouts inside Forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.span-2 {
    grid-column: span 2;
}

.control-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Input Controls (High Contrast Adjustments) */
.field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); /* Soft inset shadow on fields */
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Light Mode Input Enhancements */
body.theme-light .form-input {
    background-color: #ffffff;
    border-color: #cbd5e1;       /* slate-300: much stronger contrast */
    color: #0f172a;              /* slate-900: very sharp dark text */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

body.theme-light .form-input:hover {
    border-color: #94a3b8;       /* slate-400 on hover */
}

body.theme-light .form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Dropdown selector styling fixes */
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    padding-right: 40px;
}

body.theme-light select.form-input {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.text-area {
    resize: vertical;
    min-height: 80px;
}

.input-helper-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Profile Photo Dashboard Uploader */
.photo-upload-container {
    display: flex;
    gap: 16px;
    align-items: center;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.005);
}

body.theme-light .photo-upload-container {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.photo-preview-wrapper {
    width: 76px;
    height: 76px;
    border-radius: 8px;
    border: 2px dashed var(--border-color);
    background-color: var(--bg-input);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

body.theme-light .photo-preview-wrapper {
    border-color: #cbd5e1;
    background-color: #ffffff;
}

.photo-preview-wrapper:hover {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.photo-preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
}

.photo-placeholder span {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
}

.photo-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.photo-btn-row {
    display: flex;
    gap: 8px;
}

.hidden {
    display: none !important;
}

/* Profile Photo Styles inside Resume Document */
.resume-photo-container {
    flex-shrink: 0;
}

.resume-photo {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid var(--resume-accent);
    display: block;
}

.photo-circle {
    border-radius: 50%;
}

.photo-rounded {
    border-radius: 6px;
}

/* ==========================================
   FORM SECTION GROUP CARDS ("UNTIGHTEN" UI)
   ========================================== */

.form-section-card {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, border-color 0.3s;
}

body.theme-light .form-section-card {
    background-color: #ffffff; /* pure white cards in light mode */
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.form-subheading {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

/* ==========================================
   ADVANCED EXTRA FEATURES UI STYLING
   ========================================== */

/* 1. Strength Meter styling */
.strength-meter-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(0, 0, 0, 0.2));
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg-panel);
}

body.theme-light .strength-meter-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03), #f8fafc);
    border-color: #cbd5e1;
}

.strength-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.strength-label {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.strength-percentage {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 800;
}

.strength-bar-bg {
    height: 8px;
    background-color: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

body.theme-light .strength-bar-bg {
    background-color: #e2e8f0;
}

.strength-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
    transition: width 0.4s ease, background-color 0.4s;
    width: 0%;
}

.strength-tip {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* 2. Range Sliders */
.sliders-section-card,
.toggles-section-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.015);
}

body.theme-light .sliders-section-card,
body.theme-light .toggles-section-card {
    background-color: #ffffff;
    border-color: #cbd5e1;
}

.sliders-section-card h3,
.toggles-section-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.sliders-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.slider-label-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-badge {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    color: var(--text-primary);
}

body.theme-light .slider-badge {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-input);
    outline: none;
    border: 1px solid var(--border-color);
}

body.theme-light .range-slider {
    background-color: #e2e8f0;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: transform 0.1s;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* 3. Toggle Switches */
.section-toggles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 38px;
    height: 20px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    position: relative;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

body.theme-light .toggle-slider {
    background-color: #e2e8f0;
}

.toggle-slider::after {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--text-muted);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s, background-color 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: rgba(37, 99, 235, 0.25);
    border-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(18px);
    background-color: var(--primary-color);
}

.toggle-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 4. Skills Pill buttons suggestions */
.suggestion-skills-box {
    margin-top: 10px;
    border-top: 1px dashed var(--border-color);
    padding-top: 14px;
}

.pills-cat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
}

.pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-pill-btn {
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-secondary);
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

body.theme-light .skill-pill-btn {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.skill-pill-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
    transform: translateY(-1px);
}

/* 5. Experience Descriptions accordion helper */
.helper-suggestion-box {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

body.theme-light .helper-suggestion-box {
    border-color: #cbd5e1;
}

.helper-header {
    background-color: var(--bg-input);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

body.theme-light .helper-header {
    background-color: #f1f5f9;
}

.chevron-icon {
    transition: transform 0.25s;
}

.helper-suggestion-box.active .chevron-icon {
    transform: rotate(180deg);
}

.helper-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
    display: flex;
    flex-direction: column;
}

.helper-suggestion-box.active .helper-content {
    max-height: 350px;
    border-top: 1px solid var(--border-color);
}

.helper-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-bottom: 1px solid var(--border-color);
}

.helper-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 8px 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.helper-tab:hover {
    color: var(--text-secondary);
}

.helper-tab.active {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.08);
}

.helper-bullets-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 250px;
}

.bullet-item {
    font-size: 0.78rem;
    line-height: 1.4;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-secondary);
}

body.theme-light .bullet-item {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

.bullet-item:hover {
    border-color: var(--success-color);
    color: var(--text-primary);
    background-color: rgba(16, 185, 129, 0.05);
}

/* 6. Indian Declaration Form card styling */
.declaration-form-card {
    border-top: 1px dashed var(--border-color);
    padding-top: 16px;
    margin-top: 10px;
    transition: max-height 0.3s ease, opacity 0.3s;
    overflow: hidden;
}

.declaration-form-card.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

.declaration-form-card.visible {
    max-height: 500px;
    opacity: 1;
}

.declaration-form-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* 7. Toast Alerts */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.toast-message {
    background-color: #1e293b;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.2s ease-out forwards;
}

.toast-message.success {
    border-left-color: var(--success-color);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Design Section Layout options */
.template-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.template-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    background-color: rgba(255, 255, 255, 0.01);
}

.template-card span {
    font-size: 0.75rem;
    font-weight: 600;
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
}

.template-card:hover {
    border-color: var(--text-muted);
}

.template-card.active {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.template-card.active span {
    color: var(--primary-color);
}

/* Template Thumbnail Previews */
.template-thumb {
    height: 60px;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.template-thumb .line {
    background-color: #e5e7eb;
    height: 4px;
    border-radius: 2px;
}

.template-thumb .line.header {
    background-color: #9ca3af;
    width: 60%;
    margin-bottom: 2px;
}

.template-thumb .line.header.centered {
    margin-left: auto;
    margin-right: auto;
}

.template-thumb .line.body {
    width: 100%;
}

.thumb-modern {
    flex-direction: row;
    padding: 0;
}

.thumb-modern .left-bar {
    width: 25%;
    background-color: #f3f4f6;
    border-right: 1px solid #e5e7eb;
}

.thumb-modern .right-content {
    flex: 1;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Color dot palettes */
.color-options {
    display: flex;
    gap: 8px;
}

.color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-dot.active {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

/* Dynamic List Repeaters (Experience/Education cards) */
.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header-flex h2 {
    margin-bottom: 0;
}

.dynamic-list-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.list-item-card {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

body.theme-light .list-item-card {
    background-color: #ffffff;
    border-color: #cbd5e1;
}

.item-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
}

.action-btn-mini {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn-mini:hover {
    color: var(--text-primary);
    background-color: var(--border-color);
}

.action-btn-mini.delete:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Preview Panel (Right Side) */
.preview-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 170px);
}

.preview-toolbar {
    background-color: var(--bg-panel);
    border: var(--panel-border);
    border-bottom: none;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zoom-btn {
    width: 28px;
    height: 28px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

#zoom-factor {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
}

.preview-viewport-scroll {
    flex: 1;
    background-color: rgba(0, 0, 0, 0.2);
    border: var(--panel-border);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px;
    position: relative;
}

/* paper simulation A4 Layout */
.paper-container {
    transform-origin: top center;
    transition: transform 0.2s ease;
}

.resume-preview-container {
    width: 210mm;
    min-height: 297mm;
    background-color: #ffffff;
    color: var(--resume-text-main);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    padding: var(--resume-padding);
    font-family: var(--resume-font);
    font-size: var(--resume-size);
    line-height: var(--resume-line-height);
    position: relative;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ==========================================
   RESUME TEMPLATE STYLES WITH CONTACT ICONS
   ========================================== */

/* 1. Common Elements */
.resume-preview-container * {
    box-sizing: border-box;
}

.resume-preview-container a {
    color: var(--resume-accent);
    text-decoration: none;
}

.resume-section {
    margin-bottom: var(--resume-section-margin);
}

.resume-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: var(--resume-accent);
    border-bottom: 2px solid var(--resume-accent);
    padding-bottom: 3px;
}

.resume-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Contact details icon-wrapping */
.resume-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.88em;
}

.resume-contact-item svg {
    width: 12px;
    height: 12px;
    stroke: var(--resume-accent);
    stroke-width: 2.2;
    fill: none;
    display: inline-block;
    vertical-align: middle;
}

/* Experiece & Education Item Blocks */
.resume-item {
    margin-bottom: 12px;
}

.resume-item-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: var(--resume-text-main);
}

.resume-item-subheader {
    display: flex;
    justify-content: space-between;
    font-style: italic;
    color: var(--resume-text-light);
    font-size: 0.95em;
    margin-bottom: 4px;
}

.resume-item-desc {
    color: var(--resume-text-light);
    font-size: 0.9em;
    white-space: pre-line;
}

.resume-skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.resume-skill-tag {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--resume-text-main);
    border-left: 3px solid var(--resume-accent);
}

/* Printing-specific Declaration box on resume */
.resume-declaration {
    margin-top: 20px;
    border-top: 1px dashed var(--resume-text-muted);
    padding-top: 12px;
}

.dec-statement {
    font-size: 0.9em;
    font-style: italic;
    color: var(--resume-text-light);
    margin-bottom: 16px;
}

.dec-meta-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.9em;
    color: var(--resume-text-main);
}

.dec-meta-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dec-meta-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.signature-styled {
    font-family: 'Yellowtail', 'Lora', cursive;
    font-size: 1.6rem;
    color: var(--resume-accent);
    line-height: 1;
    margin-bottom: 2px;
}

.signature-line {
    width: 150px;
    border-top: 1px solid var(--resume-text-main);
    margin-top: 4px;
}

/* Fonts Support */
.font-inter {
    --resume-font: 'Inter', sans-serif;
}
.font-outfit {
    --resume-font: 'Outfit', sans-serif;
}
.font-lora {
    --resume-font: 'Lora', serif;
}

/* Accent Colors */
.theme-navy { --resume-accent: #1e3a8a; }
.theme-teal { --resume-accent: #0f766e; }
.theme-forest { --resume-accent: #15803d; }
.theme-burgundy { --resume-accent: #991b1b; }
.theme-charcoal { --resume-accent: #374151; }
.theme-purple { --resume-accent: #6d28d9; }

/* 2. Template ATS-Friendly (Traditional, Elegant, Plain) */
.template-ats {
    padding: var(--resume-padding);
}

.template-ats .resume-header {
    text-align: center;
    margin-bottom: 16px;
}

.template-ats .resume-name {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--resume-accent);
    margin-bottom: 2px;
}

.template-ats .resume-title {
    font-size: 1.1rem;
    color: var(--resume-text-light);
    font-weight: 600;
    margin-bottom: 8px;
}

.template-ats .resume-contact {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.85rem;
    color: var(--resume-text-light);
    align-items: center;
}

.template-ats .resume-contact .resume-contact-item::after {
    content: " • ";
    margin-left: 14px;
    color: var(--resume-text-muted);
}

.template-ats .resume-contact .resume-contact-item:last-child::after {
    content: "";
}

/* 3. Template Modern Corporate (Split Panel) */
.template-modern {
    padding: 0;
    display: grid;
    grid-template-columns: 28% 1fr;
    min-height: 297mm;
}

.template-modern .sidebar-panel {
    background-color: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: var(--resume-padding) 6mm;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.template-modern .main-panel {
    padding: var(--resume-padding) 10mm;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.template-modern .resume-name {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--resume-text-main);
    margin-bottom: 4px;
}

.template-modern .resume-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--resume-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.template-modern .contact-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--resume-text-light);
    word-break: break-all;
}

.template-modern .contact-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-modern .contact-item strong {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--resume-accent);
    margin-bottom: 2px;
}

.template-modern .sidebar-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--resume-text-main);
    border-bottom: 1.5px solid var(--resume-accent);
    padding-bottom: 2px;
    margin-bottom: 8px;
}

.template-modern .resume-section-title {
    border-bottom: 1.5px solid #cbd5e1;
    position: relative;
}

.template-modern .resume-section-title::after {
    content: "";
    position: absolute;
    bottom: -1.5px;
    left: 0;
    width: 50px;
    height: 1.5px;
    background-color: var(--resume-accent);
}

/* 4. Template Minimalist */
.template-minimalist {
    padding: var(--resume-padding);
}

.template-minimalist .resume-header {
    border-bottom: 4px solid var(--resume-accent);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.template-minimalist .resume-name {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--resume-text-main);
    line-height: 1;
}

.template-minimalist .resume-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--resume-accent);
    margin-top: 4px;
}

.template-minimalist .resume-contact {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--resume-text-light);
}

.template-minimalist .resume-section-title {
    border: none;
    border-left: 4px solid var(--resume-accent);
    padding-left: 10px;
    padding-bottom: 0;
    margin-bottom: 12px;
}

/* Flex layout modifiers when profile photo is active */
.ats-header-flex {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: left !important;
    width: 100%;
}
.ats-header-flex .resume-contact {
    justify-content: flex-start !important;
}

.minimal-header-flex {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: left !important;
    width: 100%;
}
.minimal-header-flex .resume-contact {
    align-items: flex-start !important;
}

/* ==========================================
   MODAL DIALOG STYLES & SPINNING LOADER
   ========================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-panel);
    border: var(--panel-border);
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    animation: fadeIn 0.25s ease;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

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

.modal-body {
    padding: 20px;
}

/* Loader style inside modal */
.download-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

body.theme-light .loading-spinner {
    border-color: rgba(0, 0, 0, 0.05);
    border-top-color: var(--primary-color);
}

.loader-status-text {
    margin-top: 16px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Collapsible tips content */
.download-tips-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

.download-tips-content.collapsed {
    display: none;
}

.download-success-msg {
    color: var(--success-color);
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 14px;
}

.modal-tips {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.85rem;
}

.modal-tips ul {
    margin-top: 6px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-ad {
    height: 150px;
    background-color: rgba(0, 0, 0, 0.2);
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px dashed var(--border-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

/* ==========================================
   MOBILE FOOTER AND RESPONSIVENESS
   ========================================== */

.mobile-bar {
    display: none;
}

@media (max-width: 1024px) {
    .app-workspace {
        grid-template-columns: 1fr;
        height: auto;
        padding-bottom: 80px; /* Space for mobile bar */
    }

    .form-panel {
        height: auto;
        max-height: none;
    }

    .preview-panel {
        display: none; /* Hidden by default on mobile, toggled via JS */
        height: auto;
    }

    .mobile-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: var(--bg-panel);
        border-top: var(--panel-border);
        padding: 12px 16px;
        gap: 12px;
        z-index: 99;
    }

    .mobile-nav-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        background-color: var(--bg-input);
        color: var(--text-primary);
        font-family: inherit;
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
    }

    .mobile-nav-btn.highlight {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
        color: white;
    }

    .mobile-nav-btn .icon-form {
        display: block;
    }
    .mobile-nav-btn .icon-eye {
        display: none;
    }

    /* Toggle visibility on mobile */
    body.show-preview .form-panel {
        display: none;
    }

    body.show-preview .preview-panel {
        display: flex;
    }

    body.show-preview .mobile-nav-btn .icon-form {
        display: none;
    }
    body.show-preview .mobile-nav-btn .icon-eye {
        display: block;
    }
    
    .preview-viewport-scroll {
        padding: 10px;
    }
    
    .paper-container {
        width: 100%;
    }
    
    .resume-preview-container {
        width: 100% !important;
        min-height: 0;
        padding: 10mm;
    }
}

@media (max-width: 640px) {
    .header-container {
        padding: 0 4px;
    }
    .header-actions #import-btn span,
    .header-actions #export-btn span {
        display: none; /* Hide labels on mobile header, keep only icon */
    }
    .header-actions #import-btn,
    .header-actions #export-btn {
        width: 42px;
        height: 42px;
        padding: 0;
    }
    .logo-text {
        font-size: 1.1rem;
    }
    .separator, .back-link span {
        display: none; /* Clean up mobile title bar */
    }
    
    .form-tabs {
        width: 60px;
    }
    .tab-btn {
        width: 48px;
        height: 48px;
    }
    .tab-btn span {
        display: none; /* Only show icons on narrow tabs */
    }
    .form-content {
        padding: 16px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    .span-2 {
        grid-column: span 1;
    }
    .template-options {
        grid-template-columns: 1fr;
    }
    .section-toggles-grid {
        grid-template-columns: 1fr;
    }
    .helper-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================
   PRINT STYLESHEET (PIXEL PERFECT PDF)
   ========================================== */

@media print {
    /* Hide dashboard UI, headers, sidebars, and ads */
    .main-header,
    .ad-container,
    .form-panel,
    .preview-toolbar,
    .mobile-bar,
    .modal,
    .toast-container,
    .zoom-controls {
        display: none !important;
    }

    /* Ensure workspace fills the document area */
    .app-workspace {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Position the preview panel to occupy the entire print sheet */
    .preview-panel {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: #ffffff !important;
        overflow: visible !important;
        z-index: 9999 !important;
    }

    /* Reset scroll containers and wrappers */
    .preview-viewport-scroll {
        display: block !important;
        width: 210mm !important;
        height: 297mm !important;
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    /* Reset zoom transform scale back to 1.0 */
    .paper-container {
        display: block !important;
        width: 210mm !important;
        height: 297mm !important;
        transform: scale(1) !important;
        transform-origin: top left !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    /* Style A4 preview paper specifically */
    #resume-preview {
        display: block !important;
        width: 210mm !important;
        height: 297mm !important;
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: var(--resume-padding) !important;
        background-color: #ffffff !important;
        box-sizing: border-box !important;
        position: relative !important;
    }

    #resume-preview.template-modern {
        display: grid !important;
        grid-template-columns: 28% 1fr !important;
        padding: 0 !important;
        height: 297mm !important;
        min-height: 297mm !important;
    }
    
    .template-modern .sidebar-panel {
        background-color: #f8fafc !important;
    }

    /* Force all browsers to render background colors and graphics */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Reset page print settings */
    @page {
        size: A4 portrait;
        margin: 0;
    }
}
