:root {
    --primary: #2563eb;
    /* Professional Blue */
    --primary-hover: #1d4ed8;
    --secondary: #475569;
    /* Slate Gray */
    --bg-light: #f1f5f9;
    --bg-dark: #0f172a;
    --card-light: rgba(255, 255, 255, 0.98);
    --card-dark: rgba(30, 41, 59, 0.98);
    --text-light: #0f172a;
    --text-dark: #f8fafc;
    --border-light: #cbd5e1;
    --border-dark: #334155;
    --glass-blur: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #f5f3ff 100%);
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.6;
}

body.dark-mode {
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:hover label {
    color: var(--primary);
    opacity: 1;
}

.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.dark-mode .site-header {
    background: rgba(15, 23, 42, 0.95);
    border-color: var(--border-dark);
}

.site-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

#dark-mode-toggle {
    background: var(--card-light);
    border: 1px solid var(--border-light);
    padding: 0.6rem 1.2rem;
    border-radius: 99px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body.dark-mode #dark-mode-toggle {
    background: var(--card-dark);
    border-color: var(--border-dark);
    color: white;
}

.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

#input-form,
.preview-section {
    background: var(--card-light);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-light);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body.dark-mode #input-form,
body.dark-mode .preview-section {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h2:first-of-type {
    margin-top: 0;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    opacity: 0.8;
}

body.dark-mode label {
    color: var(--text-dark);
}

input,
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 2px solid var(--border-light);
    background: white;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1.2rem;
}

body.dark-mode input,
body.dark-mode textarea {
    background: #0f172a;
    border-color: var(--border-dark);
    color: white;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.entry-input,
.skill-input {
    background: rgba(0, 0, 0, 0.03);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    position: relative;
    border: 1px dashed var(--border-light);
}

body.dark-mode .entry-input,
body.dark-mode .skill-input {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-dark);
}

.add-btn,
.remove-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-btn {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    margin-bottom: 2rem;
}

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

.remove-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.remove-btn:hover {
    background: #ef4444;
    color: white;
}

.generate-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1.2rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
    margin-top: 2rem;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.4);
}

/* Preview Section Styling */
.preview-section {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

#preview-content {
    background: white;
    padding: 0; /* Allows edge-to-edge rendering */
    border-radius: 12px;
    overflow: hidden;
    min-height: 400px;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    color: #1e293b;
}

body.dark-mode #preview-content {
    background: #f8fafc;
    color: #1e293b;
}

/* Resume Output View */
#resume-output {
    max-width: 900px;
    margin: 3rem auto;
    background: white;
    padding: 0; /* Allows edge-to-edge for designer */
    border-radius: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    color: #1e293b;
}

.hidden {
    display: none !important;
}

#resume-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 2rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.resume-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--primary);
}

.header-text {
    flex: 1;
}

#resume-header h1 {
    font-size: 3.5rem;
    margin: 0;
    color: #0f172a;
    line-height: 1.1;
}

.section {
    margin-bottom: 2.5rem;
}

.section h2 {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.entry {
    margin-bottom: 1.5rem;
}

.entry h3 {
    font-size: 1.1rem;
    color: #0f172a;
}

.subtitle {
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.5rem;
}

/* Buttons in output */
.print-button,
.reset-button {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    margin-right: 1rem;
}

.print-button {
    background: var(--primary);
    color: white;
}

.reset-button {
    background: #f1f5f9;
    color: #475569;
}

footer {
    text-align: center;
    padding: 3rem;
    opacity: 0.6;
}

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

    .preview-section {
        position: static;
        max-height: none;
    }
}

/* Template Selection Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.template-card {
    background: var(--card-light);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
body.dark-mode .template-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.template-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.template-card.active {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

body.dark-mode .template-card.active {
    background: rgba(37, 99, 235, 0.15);
}

.preview-box {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 1rem;
    border-radius: 8px;
    background: white;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}
.border-ats { border-top: 4px solid #22c55e; }
.border-modern { border-top: 4px solid #3b82f6; }
.border-designer { border-top: 4px solid #d946ef; }


/* Resume Templates Shared Styling */
.resume-ats, .resume-modern, .resume-designer {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #0f172a;
    line-height: 1.6;
    background: white;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
}
.resume-ats, .resume-modern {
    padding: 4rem;
}

.ats-bullets, .modern-bullets, .designer-bullets {
    white-space: pre-line;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.6;
}

/* 1. ATS Template */
.resume-ats {
    font-family: Arial, sans-serif !important;
    font-size: 11px;
    color: #111;
    line-height: 1.4;
    padding: 3rem 4rem; /* Tight page margins */
    width: 210mm;
    min-height: 297mm;
    box-sizing: border-box;
    margin: 0 auto;
    background: white;
}
.ats-header-top {
    display: flex;
    align-items: center;    
    margin-bottom: 12px;
}
.ats-photo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    margin-right: 15px;
    border: 1px solid #ddd;
}
.ats-header-right {
    flex: 1;
}
.resume-ats .ats-name {
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    margin: 0 0 4px 0;
    text-align: left;
    letter-spacing: normal;
}
.resume-ats .ats-contact {
    margin: 0;
    font-size: 11px;
    color: #333;
    text-align: left;
}
.resume-ats .ats-section {
    margin-bottom: 12px;
}
.resume-ats .ats-heading {
    border-bottom: 1px solid #999;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    margin: 0 0 6px 0;
    padding-bottom: 2px;
    color: #111;
    letter-spacing: normal;
}
.resume-ats .ats-entry {
    margin-bottom: 8px;
}
.resume-ats .ats-header-line {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}
.ats-date {
    white-space: nowrap;
}
.resume-ats .ats-bullets-list {
    margin: 3px 0 0 0;
    padding-left: 20px;
}
.resume-ats .ats-bullets-list li {
    margin-bottom: 2px;
    font-size: 11px;
}
.resume-ats .ats-skills-list {
    margin: 0;
    padding: 0;
    list-style: none;
    column-count: 2;
    column-gap: 20px;
}
.resume-ats .ats-skills-list li {
    position: relative;
    padding-left: 12px;
    margin-bottom: 2px;
    break-inside: avoid;
    font-size: 11px;
}
.resume-ats .ats-skills-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
}


/* 2. Modern Clean Template */
.resume-modern {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.resume-modern .modern-header {
    text-align: center;
    margin-bottom: 25px;
}
.resume-modern .modern-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 5px;
}
.resume-modern .modern-title {
    font-size: 1.2rem;
    color: #64748b;
    margin-bottom: 10px;
}
.resume-modern .modern-contact {
    font-size: 0.9rem;
    color: #475569;
}
.resume-modern .modern-contact.links span {
    margin: 0 10px;
    color: #2563eb;
    font-weight: 500;
}
.resume-modern .modern-section {
    margin-bottom: 20px;
}
.resume-modern .modern-heading {
    font-size: 1.25rem;
    color: #1e3a8a;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 5px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.resume-modern .modern-entry {
    margin-bottom: 15px;
}
.resume-modern .modern-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.resume-modern .modern-entry-header h3 {
    font-size: 1.1rem;
    color: #0f172a;
    margin: 0;
}
.resume-modern .modern-date {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
}
.resume-modern .modern-entry-subheader {
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 5px;
}
.resume-modern .modern-skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.resume-modern .modern-skills-list span {
    background: #f1f5f9;
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 0.9rem;
    color: #334155;
    font-weight: 500;
}

.color-swatch {
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    cursor: pointer; 
    border: 2px solid transparent; 
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.color-swatch:hover { 
    transform: scale(1.1); 
}
.color-swatch.active { 
    transform: scale(1.15); 
    border-color: var(--primary); 
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary); 
}

/* 3. Designer Template */
.resume-designer {
    display: flex;
    padding: 0;
    width: 100%; /* Take full available width of container to look larger */
    min-height: 1000px; /* Expansive height */
    box-shadow: none;
    margin: 0 auto;
    box-sizing: border-box;
}
.designer-sidebar {
    background: var(--designer-bg, #2e1065);
    color: white;
    width: 35%; /* slightly wider sidebar to fit long emails */
    padding: 3rem 2.5rem; 
    box-sizing: border-box;
}
.designer-main {
    width: 65%;
    padding: 3.5rem 3rem; 
    background: white;
    box-sizing: border-box;
}
.designer-photo-container {
    text-align: center;
    margin-bottom: 3rem;
}
.designer-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.2); /* Softer border */
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}
.designer-photo-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}
.designer-sidebar h2 {
    color: white;
    font-size: 1.25rem;
    text-transform: capitalize;
    border-bottom: none;
    padding-bottom: 0px;
    margin-bottom: 8px;
    letter-spacing: normal;
    font-weight: 700;
    position: relative;
}
.designer-sidebar h2::after {
    content: '';
    display: block;
    width: 30px;
    height: 3px;
    background: white;
    margin-top: 8px;
    margin-bottom: 1.5rem;
}
.designer-contact-item {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
}
.designer-contact-item span {
    display: block;
    font-size: 0.9rem;
    color: white;
    text-transform: capitalize;
    margin-bottom: 2px;
    font-weight: 700;
    letter-spacing: normal;
    opacity: 1;
}
.designer-contact-item p {
    font-size: 0.85rem;
    margin: 0;
    white-space: normal; 
    word-break: break-word;
    line-height: 1.4;
    color: rgba(255,255,255,0.85); /* Slightly dimmer */
    font-weight: 400;
}
.designer-skills-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.designer-skills-list li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
}
.designer-skills-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: white;
}

.designer-header {
    margin-bottom: 2rem;
    padding-bottom: 1.2rem;
}
.designer-header h1 {
    font-size: 2.5rem;
    color: #0f172a;
    line-height: 1.1;
    margin: 0 0 8px 0;
    font-weight: 800;
    word-break: break-word;
    letter-spacing: -0.02em;
}
.designer-header h3 {
    font-size: 1.15rem;
    color: var(--designer-accent, #6d28d9);
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.designer-section {
    margin-bottom: 2rem;
}
.designer-section h2 {
    color: #0f172a;
    font-size: 1.3rem;
    border-bottom: none;
    padding-bottom: 0px;
    margin-bottom: 8px;
    text-transform: capitalize;
    letter-spacing: normal;
    font-weight: 700;
    position: relative;
}
.designer-section h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: #0f172a;
    margin-top: 8px;
    margin-bottom: 1.2rem;
}
.designer-entry {
    margin-bottom: 1.5rem;
    display: block; /* No longer row based with date on left */
}
.designer-entry-content {
    width: 100%;
}
.designer-entry-content h3 {
    margin: 0 0 4px 0;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 700;
}
.designer-entry-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    align-items: baseline;
}
.designer-entry-meta h4 {
    margin: 0;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 400; /* Regular weight for company like the image */
}
.designer-date {
    font-size: 0.85rem;
    color: #334155;
    white-space: nowrap;
}
.designer-bullets-list {
    margin: 3px 0 0 0;
    padding-left: 20px;
    color: #334155;
    font-size: 0.85rem;
    line-height: 1.5;
}
.designer-bullets-list li {
    margin-bottom: 4px;
}

@media print {
    body {
        background: white;
    }

    .site-header,
    footer,
    #input-form,
    .preview-section,
    .print-button,
    .reset-button,
    .no-print {
        display: none !important;
    }

    .container {
        display: block;
        padding: 0;
        margin: 0;
        max-width: 100%;
        gap: 0;
    }

    #resume-output {
        box-shadow: none;
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: none;
    }
    
    .resume-ats, .resume-modern, .resume-designer {
        padding: 0;
    }

    .designer-sidebar {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .designer-photo {
         -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .designer-skills span {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}