/* Form Section Box */
.form-section-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.form-section-box:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.section-title {
  font-weight: 700;
  font-size: 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 1rem;
  line-height: 1.5; /* เพิ่มระยะห่างระหว่างบรรทัด */
}

/* Modern Selection Chips */
.selection-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-item {
  background: #ffffff;
  border: 2px solid #dee2e6;
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  user-select: none;
}

.chip-item:hover {
  border-color: #2e93ff;
  color: #2e93ff;
  background: #f0f7ff;
  transform: translateY(-2px);
}

.chip-item.active {
  background: #e7f3ff;
  border-color: #2e93ff;
  color: #0061c2;
  box-shadow: 0 4px 12px rgba(46, 147, 255, 0.15);
  transform: translateY(-2px);
}

.chip-item i {
  font-size: 1.1rem;
  color: #6c757d;
  transition: all 0.25s ease;
}

.chip-item.active i {
  color: #0061c2;
}

/* Animation Checkmark */
.chip-item.active::after {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  margin-left: 8px;
  font-size: 0.8rem;
  color: #0061c2;
}

@media (max-width: 576px) {
  .chip-item {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}

/* Patient Type & Issue Type Checkboxes - MODERN BUTTON STYLE */
.patient-type-checkbox,
.issue-type-checkbox {
  background: #ffffff;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  height: 60px; /* ให้ทุกปุ่มสูงเท่ากัน */
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.patient-type-checkbox:hover,
.issue-type-checkbox:hover {
  border-color: #2e93ff;
  background: #f8fbff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 147, 255, 0.15);
}

/* เมื่อถูกเลือก - ACTIVE STATE (สี Primary อ่อน) */
.patient-type-checkbox:has(.form-check-input:checked),
.issue-type-checkbox:has(.form-check-input:checked) {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-color: #64b5f6;
  box-shadow: 0 4px 16px rgba(100, 181, 246, 0.3);
  transform: translateY(-3px);
}

.patient-type-checkbox:has(.form-check-input:checked) .form-check-label,
.issue-type-checkbox:has(.form-check-input:checked) .form-check-label {
  color: #1565c0;
  font-weight: 600;
}

.patient-type-checkbox:has(.form-check-input:checked) .form-check-label i,
.issue-type-checkbox:has(.form-check-input:checked) .form-check-label i {
  color: #1976d2;
  transform: scale(1.1);
}

/* เพิ่ม checkmark icon เมื่อเลือก */
.patient-type-checkbox:has(.form-check-input:checked)::after,
.issue-type-checkbox:has(.form-check-input:checked)::after {
  content: "\f00c";
  /* Font Awesome check icon */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  top: 8px;
  right: 10px;
  color: #1976d2;
  font-size: 0.9rem;
  animation: checkPop 0.3s ease;
}

@keyframes checkPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ซ่อน checkbox แบบเดิม */
.patient-type-checkbox .form-check-input,
.issue-type-checkbox .form-check-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Label styling */
.patient-type-checkbox .form-check,
.issue-type-checkbox .form-check {
  margin: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.patient-type-checkbox .form-check-label,
.issue-type-checkbox .form-check-label {
  cursor: pointer;
  margin: 0 !important;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: #495057;
  transition: all 0.25s ease;
  width: 100%;
  line-height: 1.2;
}

/* Icon styling */
.patient-type-checkbox .form-check-label i,
.issue-type-checkbox .form-check-label i {
  font-size: 1.1rem;
  margin-right: 0.6rem;
  transition: all 0.25s ease;
}

/* Responsive - mobile */
@media (max-width: 768px) {
  .form-section-box {
    padding: 1rem 0.75rem !important;
  }

  .section-title {
    line-height: 1.6; /* เพิ่มระยะห่างระหว่างบรรทัดให้มากขึ้นบน mobile */
    padding-bottom: 0.75rem;
    font-size: 0.95rem; /* ลดขนาดฟอนต์เพื่อให้พอดีบรรทัดเดียว */
  }

  /* ทำให้ small text ใน section-title อยู่บรรทัดเดียวกัน */
  .section-title small,
  .section-title .small,
  .section-title .text-muted {
    font-size: 0.75rem !important; /* ลดขนาดข้อความเสริม */
    white-space: nowrap; /* ไม่ให้ตัดบรรทัด */
    display: inline !important;
  }

  .patient-type-checkbox,
  .issue-type-checkbox {
    padding: 0.3rem 0.5rem;
    height: 55px; /* ความสูงเท่ากันทุกปุ่มบนมือถือ */
    border-radius: 8px;
  }

  .patient-type-checkbox .form-check-label,
  .issue-type-checkbox .form-check-label {
    font-size: 0.8rem; /* ลดขนาดตัวอักษรเพื่อไม่ให้คำแตก */
    letter-spacing: -0.2px;
  }

  .patient-type-checkbox .form-check-label i,
  .issue-type-checkbox .form-check-label i {
    font-size: 1rem;
    margin-right: 0.4rem;
  }

  .patient-type-checkbox:has(.form-check-input:checked)::after,
  .issue-type-checkbox:has(.form-check-input:checked)::after {
    font-size: 0.75rem;
    top: 5px;
    right: 6px;
  }
}

/* Image Preview Styles */
.image-preview-item {
  position: relative;
  transition: transform 0.2s ease;
}

.image-preview-item:hover {
  transform: scale(1.02);
}

.btn-remove-image {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ff4d4d;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: all 0.2s ease;
  pointer-events: auto;
}

.btn-remove-image:hover {
  background: #ff0000;
  transform: scale(1.1);
}

.btn-remove-image i {
  font-size: 12px;
}

/* Privacy Policy Styles */
.privacy-section-title {
  color: #0d6efd;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.privacy-modal-content p {
  line-height: 1.8;
  color: #475569;
  margin-bottom: 1rem;
}

.privacy-modal-content ul {
  margin-bottom: 1.5rem;
  padding-left: 1.25rem;
}

.privacy-modal-content li {
  margin-bottom: 0.5rem;
  color: #475569;
  line-height: 1.6;
  list-style-type: disc;
}

.contact-card {
  background: #f8fafc;
  border-radius: 16px;
  padding: 20px;
  margin-top: 25px;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #0d6efd;
}
