:root {
    --bg-primary: #111827;
    --bg-secondary: #0f172a;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-pure: #ffffff;
    --text-muted: #9CA3AF;
    --border-color: rgba(255, 255, 255, 0.15);
    --transition: all 0.2s ease-in-out;
    --glass-bg: rgba(31, 41, 55, 0.95);
}

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

body { font-family: 'Inter', sans-serif; background: #0f172a; color: var(--text-pure); min-height: 100vh; display: flex; flex-direction: column; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.full-width { width: 100%; }

.navbar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background: var(--glass-bg); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; }
.logo { display: flex; align-items: center; gap: 0.75rem; font-size: 1.4rem; font-weight: 700; color: #fff; }
.logo i { color: var(--primary-color); }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.btn { padding: 0.6rem 1.2rem; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; transition: var(--transition); font-family: 'Inter', sans-serif; }
.btn.primary { background: var(--primary-color); color: white; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.secondary { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.2); color: white; }
.btn.secondary:hover { background: rgba(255,255,255,0.1); }

/* Workspace Setup */
.workspace { display: flex; flex: 1; height: calc(100vh - 70px); overflow: hidden; }

/* Editor side */
.editor-panel { width: 480px; max-width: 40%; background: #1e293b; border-right: 1px solid var(--border-color); overflow-y: auto; padding: 2rem; }
.editor-panel::-webkit-scrollbar { width: 6px; }
.editor-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.editor-header h2 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.editor-header p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem;}

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.85rem; color: #cbd5e1; font-weight: 500; }
.reset-hint, .settings-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 8px;
    line-height: 1.4;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    padding-right: 40px;
}

.input-with-icon i {
    position: absolute;
    right: 12px;
    color: #64748b;
    transition: color 0.3s;
}

.input-with-icon i:hover {
    color: #3b82f6;
}

.ai-badge {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 8px;
    text-transform: uppercase;
}

.btn-ai-small {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.4);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ai-small:hover {
    background: #8b5cf6;
    color: white;
}

.ai-input-wrapper {
    position: relative;
    width: 100%;
}

.btn-ai-floating {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: #8b5cf6;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: all 0.2s;
    z-index: 10;
}

.btn-ai-floating:hover {
    transform: scale(1.1);
    background: #7c3aed;
}

.btn-ai-floating:disabled {
    background: #4b5563;
    cursor: not-allowed;
    transform: none;
}
input, textarea { width: 100%; padding: 0.75rem; background: #0f172a; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: white; font-family: 'Inter', sans-serif; transition: var(--transition); }
input:focus, textarea:focus { outline: none; border-color: var(--primary-color); }

.accordion-item { border: 1px solid rgba(255,255,255,0.05); border-radius: 8px; margin-bottom: 1rem; background: #0f172a; overflow: hidden; }
.accordion-header { padding: 1rem; display: flex; justify-content: space-between; align-items: center; cursor: pointer; background: rgba(255,255,255,0.03); }
.accordion-header h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 0.6rem; }
.accordion-header:hover { background: rgba(255,255,255,0.06); }
.accordion-content { padding: 1.5rem 1rem; display: none; }

.exp-item.editing, .edu-item.editing { background: #1e293b; padding: 1rem 1rem 1rem 2.5rem; border-radius: 6px; margin-bottom: 1rem; border: 1px solid rgba(255,255,255,0.1); position: relative; display: flex; flex-direction: column; gap: 0.6rem; }
.btn-delete { position: absolute; right: 0.5rem; top: 0.5rem; background: none; border: none; color: #ef4444; cursor: pointer; opacity: 0.7; }
.btn-delete:hover { opacity: 1; transform: scale(1.15); }
.add-btn { background: transparent; border: 1px dashed rgba(255,255,255,0.3); color: white; width: 100%; justify-content: center; margin-top: 0.5rem; padding: 0.8rem; }
.add-btn:hover { border-color: #10b981; color: #10b981; }

/* Experience/Project/Education editor input grids */
.exp-header { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.exp-header input { font-size: 0.85rem; padding: 0.5rem 0.7rem; }
.edu-header { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.edu-header input { font-size: 0.85rem; padding: 0.5rem 0.7rem; }
.exp-desc { font-size: 0.85rem; resize: vertical; padding: 0.5rem 0.7rem; }

/* Drag and Drop Styles */
.drag-handle { position: absolute; left: 0.5rem; top: 50%; transform: translateY(-50%); font-size: 1rem; color: #64748b; cursor: grab; padding: 4px; transition: color 0.15s; }
.drag-handle:hover { color: #cbd5e1; }
.drag-handle:active { cursor: grabbing; }
.exp-item.editing[draggable="true"], .edu-item.editing[draggable="true"] { cursor: grab; transition: border-color 0.2s, padding 0.2s, opacity 0.2s, transform 0.2s; }
.exp-item.editing[draggable="true"]:active, .edu-item.editing[draggable="true"]:active { cursor: grabbing; }
.dragging { opacity: 0.5; border: 1px dashed var(--primary-color) !important; transform: scale(0.98); }
.drop-target { border-top: 4px solid var(--primary-color) !important; border-top-left-radius: 2px; border-top-right-radius: 2px; }

/* Editor Footer & Reset */
.editor-footer { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); text-align: center; }
.reset-btn { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #ef4444; width: 100%; justify-content: center; }
.reset-btn:hover { background: #ef4444; color: white; }
.reset-hint { margin-top: 1rem; font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
/* 
 * --------------------------------------------------------
 * 100% PERFECT ATS SCORE RESUME STYLING (Harvard Standard)
 * --------------------------------------------------------
 */
.preview-panel { flex: 1; padding: 2rem; background: #e2e8f0; overflow-y: auto; display: flex; justify-content: center; }
.preview-panel::-webkit-scrollbar { width: 8px; }
.preview-panel::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }
.resume-wrapper { display: flex; justify-content: center; align-items: flex-start; }

.resume-document.ATS-word-template {
    width: 8.5in;
    min-height: 11in;
    background: #ffffff;
    color: #000000;
    padding: 0.5in;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    
    /* Arial is consistently ranked highest by ATS parsers alongside Garamond & Times */
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 
    font-size: 10.5pt;
    line-height: 1.4;
}

/* Header Config */
.resume-header { text-align: center; margin-bottom: 18px; }
.resume-header .resume-name { font-size: 20pt; font-weight: bold; margin-bottom: 6px; text-transform: uppercase; color: #000; letter-spacing: 0.5px;}
.resume-header .resume-contact { font-size: 10pt; color: #000; display: block;}
.resume-header .divider { margin: 0 4px; color: #000; }

.resume-section {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid #000;
}

.resume-section:last-of-type {
    border-bottom: none;
}

.section-title {
    font-size: 11pt;
    text-transform: uppercase;
    margin-top: 10px;
    margin-bottom: 6px;
    font-weight: bold;
    color: #000;
    letter-spacing: 0.5px;
}
.resume-summary { text-align: justify; margin-bottom: 12px; }

/* Item Blocks (Experience / Education / Projects) */
.exp-item-out, .edu-item-out { margin-bottom: 14px; }
.item-row { display: flex; justify-content: space-between; align-items: baseline; }

.item-title-org { font-weight: bold; color: #000; }
.item-location { font-style: italic; color: #000; }
.item-role-italic { font-style: italic; color: #000; }
.item-date-right { font-weight: normal; color: #000; }

.item-out-desc { padding-left: 18px; margin-top: 4px;}
.item-out-desc ul { list-style-type: disc;}
.item-out-desc li { margin-bottom: 4px; padding-left: 2px;}

/* Skills block standard parser */
.skills-info-container { display: flex; flex-direction: column; gap: 4px; }
.skills-block-text { display: block; }
.skills-block-text strong { display: inline-block; width: 110px; }

/* Mock Modal */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); justify-content: center; align-items: center; }
.modal.show { display: flex; }
.modal-content { background: #1e293b; padding: 2rem; border-radius: 8px; width: 500px; position: relative; border: 1px solid var(--border-color); }
.modal-content h2 { margin-bottom: 1rem; color: white; }
.close-modal { position: absolute; top: 1rem; right: 1.5rem; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.close-modal:hover { color: white; }
#aiLoader { margin-top: 1rem; text-align: center; color: var(--primary-color); font-weight: 500;}
.loader-hidden { display: none; }

.print-spacer { display: none; }

@media print {
    @page { size: letter; margin: 0; }
    body { background: white; -webkit-print-color-adjust: exact; print-color-adjust: exact;}
    .hide-on-print { display: none !important; }
    .workspace { display: block; height: auto; overflow: visible; }
    .preview-panel { display: block; background: white; padding: 0; width: 100%; flex: none; overflow: visible; }
    .resume-wrapper { display: block; }
    .resume-document.ATS-word-template { border: none; box-shadow: none; width: 100%; min-height: auto; padding: 0 0.5in; margin: 0; }
    thead.print-spacer { display: table-header-group; }
    tfoot.print-spacer { display: table-footer-group; }
    .print-spacer td { height: 0.5in; padding: 0; border: none; }
    .print-spacer div { height: 0.5in; color: transparent; overflow: hidden; }
}

/* Mobile Responsiveness */
@media screen and (max-width: 992px) {
    .workspace {
        flex-direction: column;
        height: auto;
        overflow-y: visible;
    }
    .editor-panel {
        width: 100%;
        max-width: 100%;
        overflow-y: visible;
        padding: 1rem;
    }
    .preview-panel {
        width: 100%;
        overflow-x: auto;
        padding: 1rem;
        display: block;
        text-align: center;
    }
    .resume-wrapper {
        margin: 0 auto;
        display: inline-block;
        text-align: left;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
}
