/* =========================
   Base / Container
   ========================= */
.coverad-form {
  background: #f8f8f8;
  padding: 20px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  border-radius: 8px;
  max-width: 100%;
  position: relative;
  color: #464243;
  box-sizing: border-box;
}

/* Section wrappers (optional headings) */
.form-section { margin: 18px 0; }
.section-title { margin: 0 0 10px; color: #333; font-size: 1.2rem; font-weight: 700; }

/* =========================
   Rows / Inputs
   ========================= */
.form-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.form-row label {
  flex: 1 0 150px;
  font-weight: 600;
}

.form-row input,
.form-row select,
.form-row textarea {
  flex: 2 0 200px;
  max-width: 320px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  color: #464243;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-row textarea {
  max-width: 100%;
  min-height: 100px;
  resize: vertical;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: #ed1c24;
  outline: none;
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.15);
}

/* Numeric dims row */
.dimension-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.dimension-row label {
  flex: 0 0 20px;
  margin-right: 5px;
  font-weight: 600;
}

.dimension-row input {
  flex: 0 0 80px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* =========================
   Accordion
   ========================= */
#radiator-rows { list-style: none; padding: 0; margin: 0; }

.accordion-item {
  border: 1px solid #ccc;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #fff;
  cursor: grab;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.accordion-header {
  background: #464243;
  color: #fff;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: bold;
  user-select: none;
  position: relative;
}

/* Caret (CSS-only) */
.accordion-header::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #fff;  /* caret */
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.2s ease;
}

.accordion-item.open .accordion-header::after {
  transform: translateY(-50%) rotate(180deg);
}

.accordion-item.open .accordion-header,
.accordion-header:hover {
  background: #ed1c24;
}

.accordion-body {
  display: none;
  padding: 15px;
  background: #fff;
}

.accordion-body.active { display: block; }

.coverad-input {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Drag placeholder (jQuery UI + fallback) */
.ui-sortable-placeholder,
.accordion-placeholder {
  background: #eee !important;
  border: 2px dashed #aaa !important;
  visibility: visible !important;
  height: 60px !important;
  margin-bottom: 10px;
  border-radius: 8px;
}

/* Disable text selection while sorting (added class via JS if desired) */
.sorting .accordion-header { user-select: none; }

/* =========================
   Buttons
   ========================= */
#add-radiator,
button[type="submit"] {
  background-color: #ed1c24;
  color: #fff;
  border: none;
  padding: 10px 20px;
  margin: 10px auto;
  cursor: pointer;
  border-radius: 6px;
  display: block;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.2s ease, transform 0.06s ease;
}

#add-radiator:hover,
button[type="submit"]:hover {
  background-color: #464243;
}

#add-radiator:active,
button[type="submit"]:active {
  transform: translateY(1px);
}

button.remove-radiator {
  align-self: flex-end;
  background-color: #ed1c24;
  color: #fff;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.06s ease;
}

button.remove-radiator:hover { background-color: #464243; }
button.remove-radiator:active { transform: translateY(1px); }

#clear-storage {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  background: #fff;
  color: #464243;
  border: 2px solid #464243;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#clear-storage:hover { background-color: #e0e0e0; }

/* =========================
   Progress (global + per-item)
   ========================= */
#upload-progress {
  background: #f0f0f0;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 6px;
  margin: 15px 0;
  display: none;
}

#progress-bar {
  width: 100%;
  height: 22px;
  border-radius: 5px;
  appearance: none;
  -webkit-appearance: none;
  background: #ddd;
  overflow: hidden;
}

#progress-bar::-webkit-progress-bar { background-color: #ddd; border-radius: 5px; }
#progress-bar::-webkit-progress-value { background-color: #ed1c24; border-radius: 5px; transition: width 0.3s ease; }
#progress-bar::-moz-progress-bar { background-color: #ed1c24; border-radius: 5px; transition: width 0.3s ease; }

#progress-percent {
  display: inline-block;
  margin-left: 10px;
  font-weight: 600;
  color: #464243;
  font-size: 1rem;
  vertical-align: middle;
}

/* Inline progress inside each item */
.upload-progress-bar {
  width: 100%;
  height: 6px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 5px;
}

.upload-progress-bar .progress {
  height: 100%;
  width: 0%;
  background: #ed1c24;
  transition: width 0.3s ease;
  border-radius: 4px;
}

/* =========================
   Responsive tweaks
   ========================= */
@media (max-width: 720px) {
  .form-row { flex-direction: column; align-items: stretch; }
  .form-row input,
  .form-row select,
  .form-row textarea { max-width: 100%; }
  .dimension-row .dim { flex: 1 1 45%; }
}
