body {
  font-family: Arial, sans-serif;
  padding: 20px;
}

.upload-box,
select,
input[type="text"],
input[type="email"] {
  width: 100%;
  box-sizing: border-box;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

input,
select,
label {
  display: block;
  width: 100%;
  margin-bottom: 5px;
  font-size: 14px;
}

input[type="text"],
input[type="email"],
select {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
  outline: none;
  border-color: #007bff;
}

input[type="text"].error,
input[type="email"].error,
select.error {
  border-color: #dc3545;
}

input[type="file"] {
  display: none;
}

.upload-box {
  border: 2px dashed #bcdff9; /* soft light-blue */
  padding: 18px;
  text-align: center;
  border-radius: 8px;
  color: #0f172a;
  cursor: pointer;
  margin-bottom: 10px;
  background: #eef8ff; /* light-blue background */
}

.upload-box:hover {
  background-color: #e6f6ff;
}

/* File preview list shown below the upload box */
.file-preview {
  background-color: #ffffff; /* white card per file */
  padding: 10px 12px;
  margin: 8px 0;
  border-radius: 8px;
  font-size: 14px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e6f2fb; /* subtle blue border */
}

.file-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: black;
  border: rgba(0, 0, 0, 0.61) solid 1px;
  border-radius: 5px;
}

.file-thumbnail {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  min-width: 0; /* Allow text to truncate */
}

.file-name {
  font-weight: 600;
  word-break: break-all;
}

.file-size {
  font-weight: 600;
  color: #666;
  font-size: 12px;
}

.file-preview .remove-btn {
  color: white;
  cursor: pointer;
  font-weight: bold;
  font-size: 18px;
  padding: 5px 10px;
  flex-shrink: 0;
  border: rgba(255, 0, 0, 0.61) solid 1px;
  border-radius: 5px;
}

.file-preview .remove-btn:hover {
  color: red;
  background-color: rgba(255, 255, 255, 0.301);
}

.hidden {
  display: none;
}

label {
  font-weight: bold;
  margin-bottom: 8px;
}

.required-star {
  color: red;
  margin-left: 2px;
}

.error-message {
  color: #dc3545;
  font-size: 12px;
  margin-top: 5px;
  display: none;
}

.error-message.show {
  display: block;
}

/* Checkbox styles - Fixed alignment */
.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 15px;
}

.checkbox-container input[type="checkbox"] {
  width: auto;
  margin: 0;
  margin-top: 2px;
  flex-shrink: 0;
}

.checkbox-container label {
  margin: 0;
  font-weight: normal;
  width: auto;
  flex: 1;
}

button {
  background-color: #007bff;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}

button:hover {
  background-color: #0056b3;
}
#choose {
  text-decoration: underline;
  cursor: pointer;
}
#choose:hover {
  color: #0056b3;
}

/* Styles copied/adjusted from upload_ui.html, scoped to lalith classes */
.lalith-upload-container { display:flex;flex-direction:column;align-items:center;gap:12px;padding-top:6px; }
.lalith-file-list .file-item, .file-item { display:flex;align-items:center;justify-content:space-between;background:#f1f3f6;padding:10px;margin-top:10px;border-radius:8px;width:100%;box-sizing:border-box; }
.lalith-file-list .file-left, .file-left { display:flex;align-items:center;gap:10px; }
.lalith-file-list .file-icon, .file-icon { font-size:20px;color:#e74c3c; }
.lalith-file-list .file-details .name, .file-details .name { font-weight:bold; }

.thread-controls {
  border: 1px solid #eee;
  margin: 0;
  background-color: #e0ecff;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.thread-controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  width: 100%;
  background-color: rgba(37,99,235,0.04);
  border-bottom: 1px solid #eee;
}

.toggle-thread {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #2563eb;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  padding: 6px 12px;
  border-radius: 4px;
}

.toggle-thread:hover {
  background-color: transparent; /* no background on hover */
}

/* Active state when conversation is expanded/clicked */
.toggle-thread.active {
  color: #2563eb;
  background-color: transparent; /* keep background transparent even when active */
  border-radius: 4px;
}
.toggle-thread.active i {
  color: #2563eb;
}

.reply-button {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.reply-button:hover {
  background-color: #1d4ed8;
}

.flow-step {
  margin-bottom: 0 !important;
}

/* Ensure thread-controls sit flush under the preceding flow-step */
.thread-controls {
  margin: 0; /* keep controls flush to the flow-step; spacing is handled by flow-step itself */
  padding-top: 0; /* ensure no top gap */
}

/* If two flow-steps appear consecutively (no thread-controls between them), keep equal spacing */
.flow-step + .flow-step {
  margin-top: 16px;
}

/* If a thread-controls follows a flow-step, remove any extra top margin so they are attached */
.flow-step + .thread-controls {
  margin-top: 0;
}

/* If a flow-step follows a thread-controls, ensure it doesn't add extra space on top */
.thread-controls + .flow-step {
  margin-top: 0;
}

/* Keep default flow-step spacing inside the main flow card used by Stage 3/4
   (these stages render multiple flow-step items; maintain a visible gap between
   consecutive steps while keeping thread-controls attached to the preceding step) */
.flow-card .flow-step {
  margin-top: 16px; /* visible separation for stage flow steps */
}

/* Specific: For Stage 3 and Stage 4 rendered areas we want each flow-step to keep
   its top margin (so the timeline looks like stacked cards). We still rely on the
   sibling selectors below to attach thread-controls when present. */
/* Target flow-steps rendered by functions/new.php which are inside .flow-card */
.flow-card .flow-step + .flow-step {
  margin-top: 16px; /* explicit between-step spacing */
}

.toggle-thread {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #2563eb;
  cursor: pointer;
  padding: 4px 8px;
  margin: 0;
}

.toggle-thread:hover {
  color: #1d4ed8;
}

.reply-button {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  margin: 0;
}

.reply-button:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.thread-container {
  border-top: 1px solid #eee;
  padding: 16px;
  margin: 0;
  background-color: #e0ecff;
  display: none;
}

.thread-container.expanded {
  border-radius: 0 0 8px 8px;
  display: block;
}

.thread-controls {
  background: #e0ecff;
  border: 1px solid #e5e7eb;
  border-radius: 0 0 8px 8px;
  margin-bottom: 0;
}

.thread-controls.open {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background-color: #e0ecff !important;
}

.thread-controls button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.thread-controls .view-conversation {
  color: #2563eb;
  font-weight: 600;
  font-size: 14px;
}

.thread-controls .view-conversation:hover {
  background-color: transparent; /* no blue background on hover */
}

.thread-controls .view-conversation:focus,
.thread-controls .view-conversation:active {
  background-color: transparent; /* no blue background on focus/active */
  outline: none;
}

/* Slightly smaller chevron icon inside view conversation */
.thread-controls .view-conversation i {
  font-size: 12px;
}

.thread-controls .reply-button {
  background-color: #3b82f6;
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
}

.thread-controls .reply-button:hover {
  background-color: #2563eb;
}

.reply-box {
  display: none;
  padding: 16px;
  border-top: 1px solid #eee;
  background-color: #fff;
  width: 100%;
  box-sizing: border-box;
}

.reply-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 2px solid #89abf5e3;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box;
}

.reply-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.reply-box.show {
  display: block;
}

.reply-textarea { width: 100%; min-height: 80px; padding: 8px; border-radius: 4px; border: 1px solid #ddd; margin-bottom: 8px; }
.reply-actions { display: flex; justify-content: flex-end; gap: 8px; }
.reply-button.cancel { background-color: #f0f0f0; color: #333; }
.reply-button.send { background-color: #2563eb; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.reply-button.send:hover { background-color: #1d4ed8; }
.lalith-upload-btn { width:160px;text-align:center;padding:10px 20px;background:#007bff;color:#ffffff;border-radius:5px;border:none;cursor:pointer;font-weight:700; }
.lalith-upload-btn:hover { background:#0056b3; }
.hidden {
display: none;
}

.no-replies{
    text-align: center;
    padding-top: 12px;
    color: #6b7280;
    font-size: 14px;
    background-color: #e0ecff;
    border-radius: 8px;
}

/* Shared styling for thread reply forms (Stage 3 & 4) */
.reply-form {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.send-button{
    padding: 6px 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

 .cancel-button{
    padding: 6px 12px;
    background: #ced0d3;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
