/* ================== Calculator Container ================== */
.calculator {
  width: 100%;
  margin: 10px auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  position: relative;
  padding: 20px;
  overflow: visible; /* Ensure sticky box works properly */
}

/* ================== Service Section ================== */
.service {
  margin-bottom: 40px;
  border-radius: 12px;
  padding: 20px;
}

.service > label {
  padding: 20px;
  background: #1b1b1b;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: #fff;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}

.service > label:hover {
  background-color: #222;
  border-color: #bff747;
  transform: translateY(-2px);
}

.service > label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  background-color: #2a2a2a;
  border: 2px solid #bff747;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.service > label input[type="checkbox"]:hover {
  background-color: #333;
  box-shadow: 0 0 0 2px #bff74755;
}

.service > label input[type="checkbox"]::after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 12px;
  border: solid #1b1b1b;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.service > label input[type="checkbox"]:checked {
  background-color: #bff747;
  border-color: #bff747;
}

.service > label input[type="checkbox"]:checked::after {
  display: block;
}

/* ================== Checkbox Group ================== */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
  gap: 16px;
}

@media (min-width: 600px) {
  .checkbox-group {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* ================== Microservice Card ================== */
.microservice-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #1b1b1b;
  padding: 16px 20px;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.25s ease;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.microservice-item:hover {
  background-color: #222;
  border-color: #bff747;
  transform: translateY(-2px);
}

.microservice-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  background-color: #2a2a2a;
  border: 2px solid #bff747;
  border-radius: 4px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  position: relative;
  margin-bottom: 8px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.microservice-item input[type="checkbox"]:hover {
  background-color: #333;
  box-shadow: 0 0 0 2px #bff74755;
}

.microservice-item input[type="checkbox"]::after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 12px;
  border: solid #1b1b1b;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.microservice-item input[type="checkbox"]:checked {
  background-color: #bff747;
  border-color: #bff747;
}

.microservice-item input[type="checkbox"]:checked::after {
  display: block;
}

.microservice-label {
  font-size: 17px;
  margin-bottom: 6px;
  font-weight: 500;
  color: #fff;
}

.micro-price-box {
  align-self: flex-end;
  background-color: #bff747;
  color: #000;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 15px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ================== Sticky Price Box ================== */
.price-wrapper {
  position: sticky;
  top: 110px;
  z-index: 1;
  padding: 0 20px;
  text-align: right;
}

.price {
  font-size: 24px;
  font-weight: bold;
  padding: 12px 18px;
  color: #000;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background-color: #bff747;
  display: inline-block;
  white-space: nowrap;
  pointer-events: auto;
}

.price-box-flex {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* ================== Proceed Button ================== */
.proceed-btn {
  display: flex;
  margin: 30px auto 10px;
  padding: 14px 24px;
  font-size: 18px;
  font-weight: 600;
  background-color: #bff747;
  color: #1b1b1b;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.proceed-btn:hover {
  background-color: #fff;
}

/* ================== Modal ================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 0.3s ease;
  backdrop-filter: blur(5px);
}

.modal.show {
  display: block;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #1b1b1b;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(40px);
  opacity: 0;
  animation: fadeSlideIn 0.4s ease forwards;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(40px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
  }
}

.modal-content h3 {
  margin-top: 0;
  color: #fff;
}

.modal-content ul {
  list-style-type: disc;
  padding-left: 20px;
  margin-top: 20px;
  max-height: 250px;
  overflow-y: auto;
  padding: 10px 0;
  border-top: 1px solid rgba(128, 128, 128, 0.247);
  border-bottom: 1px solid rgba(128, 128, 128, 0.247);
}

.modal-content ul::-webkit-scrollbar {
  width: 4px;
}

.modal-content ul::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content ul::-webkit-scrollbar-thumb {
  background-color: #bff747;
  border-radius: 4px;
  cursor: pointer;
}

.final-total {
  font-size: 20px;
  font-weight: bold;
  text-align: right;
  color: #fff;
  margin: 10px 0;
}

/* ================== Close Button ================== */
.close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
}

.close:hover {
  color: #fff;
}

/* ================== Confirm & Clear Buttons ================== */
.confirm-btn {
  float: right;
  background-color: #bff747;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  font-size: 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.confirm-btn:hover {
  background-color: #fff;
}

#confirm-btn:disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
  border-color: #aaa;
  opacity: 1;
}

#clearSelectionBtn {
  background: linear-gradient(to bottom, #1b1b1b, #111); /* Slight depth */
  padding: 2px 10px;
  border-radius: 5px;
  border: 1px solid #bff74728;
  color: #bff747;
  font-weight: 300;
  cursor: pointer;
  font-size: 13px;
  transition: color 0.3s ease, box-shadow 0.2s ease, transform 0.1s ease;
  box-shadow: 0 4px 0 #0d0d0d, 0 4px 6px rgba(0, 0, 0, 0.3); /* 3D lift */
  position: relative;
}

#clearSelectionBtn:hover {
  color: #fff;
}

/* ================== Modal Form ================== */
.modal-form-first-last,
.modal-form-phone-email {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 5px 0;
}

.modal-form-input-1,
.modal-form-input-2,
.modal-form-input-3,
.modal-form-input-4 {
  flex: 1 1 48%;
  min-width: 200px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--divider-color, #444);
  background-color: #111;
  color: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s ease;
}

.modal-form-input-1:focus,
.modal-form-input-2:focus,
.modal-form-input-3:focus,
.modal-form-input-4:focus,
.modal-form-input-details:focus {
  border-color: #bff747;
}

.modal-form-details {
  margin: 5px 0;
}

.modal-form-input-details {
  width: 100%;
  height: 60px;
  min-width: 200px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--divider-color, #444);
  background-color: #111;
  color: #fff;
  font-size: 16px;
  outline: none;
  resize: none;
  transition: border-color 0.3s ease;
}

.modal-form .form-modal-ul {
  list-style-type: disc;
  padding-left: 20px;
  margin: 10px 0;
  max-height: 120px;
  overflow-y: auto;
  color: #fff;
  font-size: 15px;
  line-height: 1.6;
}

/* ================== Summary and Edit and Back ================== */
.summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

#editSummaryBtn {
  background: none;
  color: #bff747;
  border: 1px solid #bff747;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

#editSummaryBtn:hover {
  background-color: #bff747;
  color: #1b1b1b;
}

.back-btn {
  background: none;
  color: #bff747;
  border: 1px solid #bff747;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background-color: #bff747;
  color: #1b1b1b;
}
.remove-item i {
  color: rgb(255, 98, 98);
  font-size: 15px;
  transition: color 0.2s ease-in-out;
}

.remove-item i:hover {
  color: #fff;
}

/* ================== Placeholder Styling ================== */
input::placeholder,
textarea::placeholder {
  color: #fff;
}

/* ================== Responsive Styles ================== */
@media (max-width: 768px) {
  .modal-form-input-1,
  .modal-form-input-2,
  .modal-form-input-3,
  .modal-form-input-4 {
    flex: 1 1 100%;
    font-size: 14px;
    padding: 10px 12px;
  }

  .modal-form-first-last,
  .modal-form-phone-email {
    gap: 8px;
    margin-bottom: 8px;
  }

  .modal-form .form-modal-ul {
    font-size: 14px;
    max-height: 150px;
  }

  .final-total {
    font-size: 14px;
  }

  .confirm-btn {
    font-size: 15px;
    padding: 12px;
  }

  .modal-form h5 {
    font-size: 18px;
  }

  .service > label {
    font-size: 18px;
  }

  .microservice-label {
    font-size: 15px;
  }

  .micro-price-box {
    font-size: 13px;
    padding: 4px 10px;
  }

  .price-wrapper {
    top: 100px;
  }

  .price {
    font-size: 20px;
    padding: 12px;
    margin: 0 12px;
  }

  .proceed-btn {
    font-size: 16px;
    padding: 12px 20px;
  }

  .modal-content {
    padding: 20px;
  }

  .modal-content h3 {
    font-size: 18px;
  }

  .modal-content ul {
    font-size: 14px;
  }

  .final-total {
    font-size: 18px;
  }

  .confirm-btn {
    font-size: 14px;
    padding: 8px 16px;
  }
}

@media (max-width: 480px) {
  .modal-form-input-1,
  .modal-form-input-2,
  .modal-form-input-3,
  .modal-form-input-4 {
    padding: 8px 10px;
    font-size: 13px;
  }

  .modal-form .form-modal-ul {
    max-height: 120px;
    font-size: 13px;
  }

  .final-total {
    font-size: 13px;
  }

  .confirm-btn {
    font-size: 14px;
    padding: 10px;
  }

  .modal-form h5 {
    font-size: 16px;
  }

  .service > label {
    font-size: 16px;
    padding: 16px;
  }

  .microservice-label {
    font-size: 14px;
  }

  .price-wrapper {
    top: 105px;
  }

  .price {
    font-size: 18px;
    padding: 10px;
  }

  .proceed-btn {
    font-size: 15px;
    padding: 10px 18px;
  }

  .modal-content h3 {
    font-size: 16px;
  }

  .modal-content ul {
    font-size: 13px;
  }

  .final-total {
    font-size: 16px;
  }

  .confirm-btn {
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .modal-form-input-1,
  .modal-form-input-2,
  .modal-form-input-3,
  .modal-form-input-4 {
    padding: 6px 8px;
    font-size: 12px;
  }

  .modal-form .form-modal-ul {
    font-size: 12px;
  }

  .final-total {
    font-size: 12px;
  }

  .confirm-btn {
    font-size: 13px;
    padding: 8px;
  }

  .modal-form h5 {
    font-size: 15px;
  }
}
