/* --- Global Reset and Container Setup --- */
:root {
    --color-primary: #1d4ed8; /* Tailwind Blue-700 */
    --color-secondary: #059669; /* Tailwind Green-600 (for actions) */
    --color-background: #f3f4f6; /* Light gray page background */
    --color-border: #d1d5db;
    --color-text: #1f2937;
    --shadow-primary: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    /* Crucial: Prevents horizontal scroll caused by padding/borders */
    min-width: 0; 
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    overflow-x: hidden; 
}

.builder-container {
    max-width: 1400px; 
    margin: 0 auto;
    padding: 1rem;
}

.builder-container h2 {
    /* Font Size: 19px (Maximum) */
    font-size: 19px; 
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
}

/* --- Main Layout Grid (Desktop - TWO COLUMNS) --- */

.builder-grid {
    display: grid;
    /* REVERTED GRID: Form (0.4fr) | Preview (0.6fr) */
    grid-template-columns: 0.3fr 0.5fr; 
    gap: 1.5rem;
    align-items: flex-start; /* Aligns top of columns */
}

/* --- Input Form Section (Left Column) --- */

.form-section {
    /* Make the editor sticky to the top of the viewport */
    position: sticky;
    top: 1rem; 
    max-height: calc(100vh - 2rem); 
    overflow-y: auto; 
    padding: 1.5rem;
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--shadow-primary);
}

.form-section h3 {
    /* Font Size: 15px */
    font-size: 15px; 
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.form-step h4 {
    /* Font Size: 13px */
    font-size: 13px; 
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
    margin-top: 1rem;
}

/* --- Form Elements --- */

label {
    display: block;
    /* Font Size: 11px (Smallest label size) */
    font-size: 11px; 
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.3rem;
    color: #4b5563;
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    /* Font Size: 14px (Text inside fields) */
    font-size: 14px; 
    transition: all 0.2s;
}

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

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

/* Quill Editor Styling (for text inside the rich text editors) */
.ql-editor {
    /* Ensure the content inside the rich text editor is also smaller */
    font-size: 14px; 
    line-height: 1.5;
}


/* --- Buttons --- */

button {
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    margin-top: 1.5rem;
    border: none;
    border-radius: 8px;
    /* Font Size: 14px */
    font-size: 14px;
    font-weight: 700;
    transition: background-color 0.2s, transform 0.1s;
}

.next-step, .print, .ai-enhance-btn {
    background-color: var(--color-primary);
    color: white;
    margin-right: 0.5rem;
}

.next-step:hover, .print:hover, .ai-enhance-btn:hover {
    background-color: #1e40af; /* Darker blue */
}

.prev-step {
    background-color: var(--color-background);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.prev-step:hover {
    background-color: #e5e7eb;
}

#add-education, #add-experience, #add-certification, #add-project {
    background-color: transparent;
    border: 1px dashed var(--color-secondary);
    color: var(--color-secondary);
    font-weight: 600;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    width: 100%;
    /* Font Size: 12px */
    font-size: 12px;
}

#add-education:hover, #add-experience:hover, #add-certification:hover, #add-project:hover {
    background-color: #e0f2f1; /* Light green background */
}

/* Styling for dynamically added items */
.experience-item, .education-item, .cert-item {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb;
    margin-bottom: 1rem;
}

.experience-item h5 {
    /* Font Size: 12px */
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}


/* --- Resume Preview Section (Right Column) --- */

.preview-section {
    padding: 1rem;
    border-radius: 12px;
    background-color: white;
    box-shadow: var(--shadow-primary);
    line-height: 1.5; 
}

/* Ensure the resume content itself is contained for printing */
#resume-preview {
    max-width: 8.5in; 
    margin: 0 auto;
}

/* --- AD SLOT Removal --- */
.adsbygoogle {
    display: none !important;
}


/* --- Mobile Responsiveness (Small Screens) --- */

@media (max-width: 1023px) {
    .builder-grid {
        /* Mobile: Single column layout */
        grid-template-columns: 1fr; 
        gap: 2rem;
    }
    
    .form-section {
        /* Remove sticky behavior on mobile to allow the input form to scroll naturally */
        position: static;
        max-height: none;
        overflow-y: visible;
        border-radius: 0;
    }

    .builder-container {
        padding: 0;
    }

    /* Adjust padding for the form section on mobile */
    .form-section {
        padding: 1.5rem;
    }

    .preview-section {
        padding: 1.5rem;
    }
}


/* 🧩 SKILLS SECTION FIX */
/* Keep Quill-related overrides as they were */
#resume-skills {
  display: block !important;
  flex-wrap: wrap !important;
  white-space: normal !important;
  word-break: break-word !important;
  padding-left: 0.5cm !important; 
}

#resume-skills p,
#resume-skills ul,
#resume-skills li {
  display: block !important;
  margin: 0 0 4px 0 !important;
  line-height: 1.4em !important;
}

#resume-skills ul {
  list-style-type: disc !important;
  margin-left: 1.5em !important; 
  padding-left: 0 !important;
}


/* Quill Editor Resize Handlers */
#skills-quill-editor,
#education-quill-editor,
#summary-quill-editor,
#exp-quill-editor-1,
#certifications-quill-editor,
#languages-quill-editor {
  resize: vertical;          
  overflow: auto;            
  border: 1px solid #ccc; 
}