/* --- VARIABLES --- */
:root {
    --accent: #6366f1; /* Indigo 500 */
    --accent-hover: #4f46e5;
    --dark-bg: #0f172a; /* Slate 900 */
    --panel-bg: #1e293b; /* Slate 800 */
    --border: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --paper-w: 210mm;
    --paper-h: 297mm;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }

body { background: var(--dark-bg); color: var(--text-main); height: 100vh; overflow: hidden; }

/* --- LAYOUT --- */
.app-container { display: flex; height: 100vh; width: 100%; }

/* --- PROGRESS BAR --- */
.progress-container { position: fixed; top: 0; left: 0; width: 100%; height: 3px; background: #334155; z-index: 9999; }
.progress-bar { height: 100%; width: 0%; background: var(--accent); transition: width 0.3s; box-shadow: 0 0 10px var(--accent); }

/* --- LEFT SIDE: EDITOR --- */
.editor-panel {
    width: 450px;
    background: var(--panel-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    z-index: 10;
}

.editor-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(5px);
}

.editor-header h2 { font-size: 1.2rem; font-weight: 600; color: white; display: flex; gap: 10px; align-items: center; }

#resumeForm {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Scrollbar Styling */
#resumeForm::-webkit-scrollbar { width: 6px; }
#resumeForm::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }

/* Form Elements */
.form-section { margin-bottom: 25px; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.section-head h3 { font-size: 0.95rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 1px; }

.input-group { margin-bottom: 15px; }
.row { display: flex; gap: 10px; }
.row .input-group { flex: 1; }

label { display: block; font-size: 0.85rem; color: #cbd5e1; margin-bottom: 6px; }

input, textarea {
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--border);
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: 0.2s;
}
input:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }

.dynamic-row {
    background: rgba(15, 23, 42, 0.5);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid var(--accent);
    margin-bottom: 10px;
    position: relative;
}
.dynamic-row input { margin-bottom: 8px; }

/* Buttons */
.btn-primary-sm { background: var(--accent); color: white; border: none; padding: 8px 16px; border-radius: 6px; font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: 0.2s; }
.btn-primary-sm:hover { background: var(--accent-hover); }

.btn-icon { background: transparent; border: 1px solid var(--border); color: var(--text-muted); width: 32px; height: 32px; border-radius: 6px; cursor: pointer; transition: 0.2s; }
.btn-icon:hover { color: white; border-color: white; }

.btn-add { background: var(--accent); color: white; border: none; width: 24px; height: 24px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; }

/* --- RIGHT SIDE: PREVIEW --- */
.preview-area {
    flex: 1;
    background: #475569;
    display: flex;
    justify-content: center;
    overflow-y: auto;
    padding: 40px;
}

/* The Paper */
.resume-paper {
    background: white;
    width: 210mm;
    min-height: 297mm; /* A4 Ratio */
    padding: 15mm 18mm;
    color: #1e293b;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform-origin: top center;
    transition: transform 0.3s ease;
}

/* Resume Styling (Clean Tech Style) */
.res-header { border-bottom: 2px solid #0f172a; padding-bottom: 15px; margin-bottom: 20px; }
#resName { font-family: 'Playfair Display', serif; font-size: 2.2rem; color: #0f172a; line-height: 1; margin-bottom: 5px; }
#resTitle { font-size: 1rem; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

.res-contact-line { display: flex; gap: 15px; margin-top: 10px; flex-wrap: wrap; font-size: 0.85rem; color: #475569; }
.res-contact-line i { color: var(--accent); margin-right: 5px; }

.res-body-section { margin-bottom: 20px; }
.res-heading { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #cbd5e1; padding-bottom: 5px; margin-bottom: 12px; color: #0f172a; }

.res-text { font-size: 0.9rem; line-height: 1.5; color: #334155; }

/* Skills Grid */
.res-skills-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.res-skills-grid span { font-size: 0.85rem; background: #e2e8f0; color: #334155; padding: 2px 8px; border-radius: 4px; font-weight: 500; }

/* Experience & Project Items */
.res-item { margin-bottom: 12px; }
.res-item-header { display: flex; justify-content: space-between; align-items: baseline; }
.res-role { font-weight: 700; font-size: 0.95rem; color: #0f172a; }
.res-company { font-weight: 500; font-size: 0.9rem; color: #475569; }
.res-date { font-size: 0.85rem; font-style: italic; color: #64748b; }

/* Bullet Lists */
.res-bullet-list { padding-left: 18px; margin-top: 5px; }
.res-bullet-list li { font-size: 0.9rem; margin-bottom: 4px; color: #334155; line-height: 1.4; }

/* --- RESPONSIVE --- */
@media (max-width: 1000px) {
    .app-container { flex-direction: column; overflow: auto; }
    .editor-panel { width: 100%; height: auto; border-right: none; }
    .preview-area { padding: 20px; height: auto; }
    .resume-paper { width: 100%; min-height: auto; aspect-ratio: 210/297; }
    body { overflow: auto; }
}