/* ==================== Resume Builder Modal ==================== */
#modalOverlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow-y: auto;
  padding: 20px;
}

#modalOverlay.active {
  display: flex;
}

#modalBody {
  background: #fff;
  border-radius: 12px;
  max-width: 1000px;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}

#closeModal {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.modal-body-flex {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.resume-builder-form {
  flex: 1 1 400px;
  min-width: 300px;
  max-width: 500px;
}

#previewContainer {
  flex: 1 1 300px;
  min-width: 280px;
  max-width: 450px;
  background: #f7f7f7;
  padding: 15px;
  border-radius: 8px;
  overflow-y: auto;
  max-height: 80vh;
}

.resume-builder-form h4,
#previewContainer h3 {
  margin-top: 15px;
  margin-bottom: 6px;
  font-size: 16px;
}

.resume-builder-form input,
.resume-builder-form textarea {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
  box-sizing: border-box;
}

button {
  padding: 8px 12px;
  margin-top: 6px;
  margin-bottom: 12px;
  border: none;
  border-radius: 6px;
  background: #0073aa;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #005f8a;
}

/* Experience / Education blocks */
.experienceBlock,
.educationBlock {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
  background: #fafafa;
}

.experienceBlock input,
.experienceBlock textarea,
.educationBlock input {
  margin-bottom: 6px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .modal-body-flex {
    flex-direction: column;
  }
  #previewContainer {
    max-height: 50vh;
    margin-top: 15px;
  }
}

@media (max-width: 600px) {
  #modalBody {
    padding: 15px;
    max-height: 95vh;
  }
  button {
    font-size: 13px;
    padding: 6px 10px;
  }
  .resume-builder-form input,
  .resume-builder-form textarea {
    font-size: 13px;
    padding: 6px 8px;
  }
  #previewContainer {
    max-height: 50vh;
  }
}

/* Summary remaining counter */
#summaryRemaining {
  font-size: 12px;
  color: #555;
  margin-top: 6px;
}

/* Scrollbar styling for preview & modal body */
#modalBody::-webkit-scrollbar,
#previewContainer::-webkit-scrollbar {
  width: 6px;
}

#modalBody::-webkit-scrollbar-thumb,
#previewContainer::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}

#modalBody::-webkit-scrollbar-track,
#previewContainer::-webkit-scrollbar-track {
  background: transparent;
}
