/* Modern Resume Builder Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Merriweather:wght@300;400;700&display=swap');

:root {
    --primary-color: #9a2b3d;
    --primary-hover: #7d2230;
    --bg-dark: #f8fafc;
    --bg-panel: #ffffff;
    --text-light: #1e293b;
    --text-dim: #64748b;
    --border-color: #e2e8f0;
    --paper-bg: #ffffff;
    --paper-text: #1e293b;
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(154, 43, 61, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    display: flex;
    flex-direction: column;
    /* Stack top-nav and app-container */
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    flex: 1;
    /* Take remaining space */
    width: 100%;
    overflow: hidden;
}

/* Editor Section (Left) */
.editor-section {
    width: 40%;
    min-width: 400px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.editor-header {
    margin-bottom: 2rem;
}

.editor-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.editor-header p {
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.form-group:hover {
    border-color: var(--primary-color);
}

.form-group h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-full {
    width: 100%;
    margin-bottom: 1rem;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

input,
textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(154, 43, 61, 0.2);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

button.add-btn {
    background-color: transparent;
    border: 1px dashed var(--border-color);
    color: var(--text-dim);
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

button.add-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(154, 43, 61, 0.05);
}

.dynamic-item {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #f8fafc;
    position: relative;
}

.remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: inline-block;
}

.remove-btn:hover {
    text-decoration: underline;
}

.skill-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.skill-remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

/* Experience Points Styles */
.exp-points-container {
    margin-top: 1rem;
}

.exp-points-list {
    margin-bottom: 0.5rem;
}

.point-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.point-item input {
    flex: 1;
}

.point-remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
    min-width: 24px;
}

.point-remove-btn:hover {
    color: #dc2626;
}

.add-point-btn {
    background-color: transparent;
    border: 1px dashed var(--border-color);
    color: var(--text-dim);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    width: 100%;
}

.add-point-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(154, 43, 61, 0.05);
}

/* Project Details Styles */
.proj-details-container {
    margin-top: 1rem;
}

.proj-details-container>label {
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: block;
}

.proj-detail-item {
    margin-bottom: 0.75rem;
}

.proj-detail-item label {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
    font-weight: 500;
}

/* Preview Section (Right) */
.preview-section {
    flex: 1;
    background-color: #f1f5f9;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 30px 30px;
    display: flex;
    flex-direction: column;
    /* Stack pages vertically */
    align-items: center;
    padding: 3rem;
    overflow-y: auto;
    gap: 3rem;
    /* Space between pages */
}

.resume-page {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    background-color: var(--paper-bg);
    color: var(--paper-text);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 20mm;
    box-sizing: border-box;
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* Page break visual indicator - No longer needed as pages are discrete */
.resume-page::after {
    content: "Page " attr(data-page);
    position: absolute;
    bottom: 5mm;
    right: 10mm;
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Page break helpers */
.resume-section {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

.resume-item {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 1rem;
}

/* Secondary Page Header */
.secondary-page-header {
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
}

.secondary-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.page-number-top {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 600;
}

/* Resume Content Styling */
.resume-header {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-left h1 {
    font-family: 'Merriweather', serif;
    font-size: 20px;
    color: #1e293b;
    margin-bottom: 5px;
    line-height: 1.2;
}

.header-left p {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.header-contact-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: #475569;
    margin-top: 5px;
}

.header-contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.header-contact-info a:hover {
    text-decoration: underline;
}

.separator {
    color: #cbd5e1;
    font-size: 0.8rem;
}

.resume-section {
    margin-bottom: 25px;
}

.resume-section h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-weight: 700;
}

.resume-item {
    margin-bottom: 15px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.item-title {
    font-size: 11px;
    font-weight: 700;
    color: #334155;
}

.item-subtitle {
    font-size: 10px;
    font-weight: 500;
    color: #64748b;
    font-style: italic;
}

.item-date {
    font-size: 10px;
    color: #94a3b8;
}

.item-description {
    font-size: 10px;
    line-height: 1.5;
    color: #475569;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    background-color: #f1f5f9;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    color: #475569;
    font-weight: 500;
}

/* SGPA Styles */
.sgpa-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    background: rgba(0, 0, 0, 0.02);
    padding: 0.5rem;
    border-radius: 4px;
}

.sgpa-inputs input {
    font-size: 0.8rem;
    padding: 0.4rem;
}

.sgpa-preview-table {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 5px;
}

.sgpa-item {
    font-size: 10px;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f8fafc;
}

.sgpa-item span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Print Styles */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body {
        margin: 0;
        padding: 0;
        background: white;
    }

    .editor-section,
    .actions,
    .controls {
        display: none !important;
    }

    .preview-section {
        display: block;
        padding: 0;
        background: transparent;
        overflow: visible;
    }

    .resume-page {
        box-shadow: none;
        margin: 0;
        padding: 20mm;
        page-break-after: always;
        width: 100% !important;
        height: 100% !important;
    }

    .resume-page:last-child {
        page-break-after: auto;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 100;
}

.action-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(154, 43, 61, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(154, 43, 61, 0.5);
    background-color: var(--primary-hover);
}

/* ── Skill chips ── */
.skill-input-wrapper { position: relative; }

.skill-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.chip {
    display: inline-block;
    padding: 4px 11px;
    background: white;
    border: 1.5px solid #cbd5e1;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.chip:hover {
    border-color: #9a2b3d;
    color: #9a2b3d;
    background: #fde8ec;
}

.chip.chip-selected {
    background: #9a2b3d;
    border-color: #9a2b3d;
    color: white;
}

/* CGPA mandatory highlight */
.cgpa-required {
    border-left: 3px solid #ef4444 !important;
}
.cgpa-required:focus {
    box-shadow: 0 0 0 3px rgba(239,68,68,0.15) !important;
}