/* --- 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);
    /* Ensures no horizontal overflow from body itself */
    overflow-x: hidden; 
}

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

.builder-container h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
}

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

.builder-grid {
    display: grid;
    /* Desktop: 35% Input (sticky) | 65% Preview */
    grid-template-columns: 0.35fr 0.65fr; 
    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; 
    
    /* Set max height to prevent the whole column from being taller than the screen */
    max-height: calc(100vh - 2rem); 
    overflow-y: auto; /* Enable vertical scrolling within the form */
    padding: 1.5rem;
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--shadow-primary);
}

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

.form-step h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
    margin-top: 1rem;
}

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

label {
    display: block;
    font-size: 0.875rem; /* text-sm */
    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: 1rem;
    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); /* ring-primary effect */
    outline: none;
}

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

/* --- Buttons --- */

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

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

.next-step:hover, .print: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%;
}

#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: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

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

.preview-section {
    /* No max-height or overflow: auto; here. Let the preview content define the column height. */
    padding: 1rem;
    border-radius: 12px;
    background-color: white;
    box-shadow: var(--shadow-primary);
    line-height: 1.5; /* Improve readability */
}

/* Ensure the resume content itself is contained for printing */
#resume-preview {
    /* You may want to set a max-width here if the preview template is a fixed paper size (e.g., A4 or Letter) */
    max-width: 8.5in; /* A common width for a letter-sized preview */
    margin: 0 auto;
}

/* --- AD SLOT Removal --- */
/* The ad slot column is implicitly removed by the 2-column grid definition, but hide its content if it's still present in the HTML outside the grid */
.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; /* Full width mobile section */
    }

    .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 */
#resume-skills {
  display: block !important;
  flex-wrap: wrap !important;
  white-space: normal !important;
  word-break: break-word !important;
  padding-left: 0.5cm !important; /* <-- Adds the 5cm indent */
}

/* Ensure paragraphs and list items still show properly */
#resume-skills p,
#resume-skills ul,
#resume-skills li {
  display: block !important;
  margin: 0 0 4px 0 !important;
  line-height: 1.4em !important;
}

/* Optional: Style the bullet list nicely if Quill uses one */
#resume-skills ul {
  list-style-type: disc !important;
  margin-left: 1.5em !important; /* inner bullet offset */
  padding-left: 0 !important;
}




#skills-quill-editor {
  resize: vertical;          /* 👈 allows dragging up/down */
  overflow: auto;            /* required for resize to work properly */
  border: 1px solid #ccc;    /* visible boundary for grip area */
}

#education-quill-editor{
  resize: vertical;          /* 👈 allows dragging up/down */
  overflow: auto;            /* required for resize to work properly */
  border: 1px solid #ccc;   
}

#summary-quill-editor{
  resize: vertical;          /* 👈 allows dragging up/down */
  overflow: auto;            /* required for resize to work properly */
  border: 1px solid #ccc; 
}
#exp-quill-editor-1{
      resize: vertical;          /* 👈 allows dragging up/down */
  overflow: auto;            /* required for resize to work properly */
  border: 1px solid #ccc; 
}

#certifications-quill-editor {
          resize: vertical;          /* 👈 allows dragging up/down */
  overflow: auto;            /* required for resize to work properly */
  border: 1px solid #ccc; 
}

#languages-quill-editor{
              resize: vertical;          /* 👈 allows dragging up/down */
  overflow: auto;            /* required for resize to work properly */
  border: 1px solid #ccc; 
}