:root {
    --bg-dark: #0f0f1a;
    --bg-light: #1a1a2e;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b5;
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-gradient: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    --accent-color: #2575fc;
    --accent-glow: rgba(45, 130, 255, 0.5);
}

body { font-family: 'Roboto', sans-serif; background-color: var(--bg-dark); color: var(--text-primary); margin: 0; }
.cv-builder { display: grid; grid-template-columns: 480px 1fr; height: 100vh; overflow: hidden; }
.editor-pane { padding: 30px; background: var(--bg-dark); overflow-y: auto; }
.tool-header h1 { margin: 0; background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 2rem; }
.tool-header { text-align: center; margin-bottom: 20px; }
.tool-header p { color: var(--text-secondary); }
.top-controls { display: flex; gap: 20px; }
.form-section { background: var(--bg-light); padding: 20px; border-radius: 10px; margin-bottom: 20px; border: 1px solid var(--border-color); flex-grow: 1; }
.form-section h2 { margin-top: 0; font-size: 1.2rem; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 15px; }


input, select, textarea { width: 100%; padding: 12px; margin-bottom: 10px; background: var(--bg-dark); border: 1px solid var(--border-color); border-radius: 5px; color: var(--text-primary); font-size: 1rem; box-sizing: border-box;}
/* textarea { min-height: 100px; resize: vertical; } */

textarea {
    min-height: 100px;
    resize: vertical;
    
    /* ADD THIS LINE to force long words to wrap */
    overflow-wrap: break-word; 
}



.add-btn { width: 100%; padding: 10px; border: 1px dashed var(--text-secondary); background: transparent; color: var(--text-secondary); cursor: pointer; border-radius: 5px; transition: all 0.2s ease; }
.add-btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.dynamic-entry { border: 1px solid var(--border-color); padding: 15px; border-radius: 5px; margin-bottom: 10px; }
.skill-input-wrapper { display: flex; gap: 10px; }
#skill-input { flex-grow: 1; }
#add-skill-btn { padding: 10px 20px; border: none; background: var(--accent-gradient); color: white; font-weight: 500; border-radius: 5px; cursor: pointer; }
#skills-container { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.skill-tag { background: var(--bg-dark); padding: 5px 10px; border-radius: 5px; display: flex; align-items: center; }
.skill-tag .remove-skill { margin-left: 8px; cursor: pointer; color: var(--text-secondary); }
#download-pdf-btn { width: 100%; padding: 15px; border: none; border-radius: 8px; font-size: 1.1rem; font-weight: 700; color: #fff; background: var(--accent-gradient); cursor: pointer; transition: all 0.3s ease; }
#download-pdf-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--accent-glow); }
.ats-widget { text-align: center; }
.ats-score-display { font-size: 2.5rem; font-weight: 700; color: var(--accent-color); }
.preview-pane { background: #08080f; padding: 40px; display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; }
#cv-preview-wrapper { width: 210mm; min-height: 296mm; transform: scale(0.9); transform-origin: top center; }
.cv-template { display: none; width: 100%; min-height: 296mm; background: #fff; color: #333; box-shadow: 0 0 30px rgba(0, 0, 0, 0.5); box-sizing: border-box; }
.cv-template.active { display: block; }
.cv-section h2 { border-bottom: 1.5px solid; padding-bottom: 5px; margin-bottom: 10px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; }
.cv-entry { margin-bottom: 15px; }
.cv-entry h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.cv-entry p { margin: 2px 0; font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; }
.cv-entry .dates { font-style: italic; color: #555; font-size: 0.85rem; }
#modern-template { display: flex; font-family: 'Roboto', sans-serif; }
#modern-template .sidebar { width: 35%; background: #2c3e50; color: #fff; padding: 25px; box-sizing: border-box; }
#modern-template .main-content { width: 65%; padding: 25px; box-sizing: border-box; }
#modern-template h1 { font-size: 2.5rem; margin: 0 0 5px 0; color: #2c3e50; }
#modern-template .title { font-size: 1.2rem; margin: 0 0 20px 0; color: #555; }
#modern-template .sidebar h2 { color: #fff; border-color: rgba(255,255,255,0.5); }
#modern-template .sidebar p, #modern-template .sidebar a { color: #eee; font-size: 0.9rem; word-break: break-word; }
#modern-template .skills-list { list-style: none; padding: 0; }
#modern-template .main-content h2 { color: #2c3e50; border-color: #2c3e50; }
#classic-template { padding: 25px; font-family: 'Lora', serif; }
#classic-template .header { text-align: center; border-bottom: 2px solid #333; padding-bottom: 15px; margin-bottom: 15px; }
#classic-template h1 { font-size: 2.8rem; margin: 0; }
#classic-template .title { font-size: 1.3rem; margin: 5px 0; }
#classic-template .contact-info { font-size: 0.9rem; word-break: break-all; }
#classic-template h2 { color: #e51111; border-color: #10e7c3; }
#creative-template { padding: 25px; font-family: 'Roboto', sans-serif; }
#creative-template .header { padding: 20px; text-align: center; color: #fff; background: var(--accent-gradient); }
#creative-template h1 { font-size: 2.8rem; margin: 0; }
#creative-template .title { font-size: 1.3rem; margin: 5px 0; opacity: 0.9; }
#creative-template .main-body { padding-top: 20px; }
#creative-template h2 { color: var(--accent-color); border-color: var(--accent-color); }
@media (max-width: 900px) {
    .cv-builder { grid-template-columns: 1fr; height: auto; }
    .editor-pane { order: 2; }
    .preview-pane { order: 1; padding: 20px 10px; }
    #cv-preview-wrapper { transform: scale(1); width: 100%; min-height: auto; }
    .cv-template { min-height: auto; }
}

/* --- Styles for Profile Photo --- */
.photo-container {
    display: none; /* Hidden by default */
    margin-bottom: 20px;
    text-align: center;
}
.photo-container.photo-visible {
    display: block; /* Shown when photo is uploaded */
}
.photo-container img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid; /* Border color will come from template */
}
/* Inside your mobile media query (e.g., @media (max-width: 900px)) */

/* This tells the browser to display the editor pane first */
.editor-pane {
    order: 1;
}

/* This tells the browser to display the preview pane second */
.preview-pane {
    order: 2;
}