.hidden {
  display: none !important;
}

#testimonial-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Fix create testimonial form layout */
.testimonial-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  padding: 20px;
  margin: 20px 0;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  max-width: 600px;
}

/* Align approval section and buttons horizontally */
.status-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-top: 10px;
}

/*testimonial card*/
#reviews {
  margin: 0 100px;
}
.admin-draggable {
  cursor: grab;
}

.testimonial-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  background-color: #ed832f;
  color: white;
}

/*login prompt*/
#login-prompt {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  max-width: 400px;
  margin: 20px auto;
}

#login-prompt a {
  text-decoration: none;
  color: #007bff;
}

#login-prompt a:hover {
  text-decoration: underline;
}

.login-icon {
  color: #007bff;
  margin: 20px;
}

/*submit testimonial*/
#submit-testimonial {
  margin: 20px 100px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.form-control {
  border-radius: 4px;
  border: 1px solid #ced4da;
  padding: 10px;
  font-size: 1rem;
  width: 50rem;
}

.form-control3 {
  border-radius: 4px;
  border: 1px solid #ced4da;
  padding: 10px;
  font-size: 1rem;
  width: 50rem;
  height: 11rem;
}

.btn-primary:hover {
  border-color: #e4cfb3;
}

.sizeControl {
  padding-bottom: 3rem;
}

.testimonial-card2 .btn {
  margin-top: 10px;
}

.badge-success {
  color: #fff;
  background-color: #28a745;
  margin: 1.5rem;
}

.badge-warning {
  color: #fff;
  background-color: #e3130c;
  margin: 1.5rem;
}

.badge-approved {
  width: 100%;
  color: #fff;
  background-color: #558361;
  font-size: 1.4rem;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
  margin: 20px;
}
.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
  margin: 20px;
}
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 30px;
  border-radius: 10px;
  width: 80%;
  max-width: 600px;
  font-size: 14px;
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);
}

.close-button {
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.checkbox-error-msg {
  background-color: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
  padding: 10px 15px;
  margin: 10px 0;
  border-radius: 8px;
  font-size: 14px;
}

/*admin functions - CRUD*/
.testimonial-avatar {
  width: 90px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
}

/* Make testimonial cards draggable with visual feedback */
.admin-draggable {
  cursor: grab;
  transition: transform 0.2s ease;
}

/* While dragging: apply slight scale and shadow */
.admin-draggable.sortable-chosen {
  opacity: 0.8;
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Placeholder space while dragging */
.admin-draggable.sortable-ghost {
  opacity: 0.3;
  height: 60px !important;
  overflow: hidden;
  padding: 10px;
}
/* Collapse the testimonials container */
.testimonial-list.collapsed {
  gap: 0.5rem;
}

/* Shrink and simplify testimonial cards */
#testimonials-list.collapsed .admin-draggable {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  height: auto;
  white-space: nowrap;
  overflow: hidden;
  transition: all 0.3s ease;
  background-color: #f0903c; /* or keep existing bg color */
}

/* Shrink avatar size */
#testimonials-list.collapsed .testimonial-avatar {
  width: 60px;
  height: 60px;
  margin-right: 1rem;
}

/* Keep only basic info */
#testimonials-list.collapsed .testimonial-text,
#testimonials-list.collapsed .testimonial-date2,
#testimonials-list.collapsed .testimonial-program,
#testimonials-list.collapsed form,
#testimonials-list.collapsed .badge-approved,
#testimonials-list.collapsed .buttons {
  display: none !important;
}
/* Default testimonial program styling (for user page) */
.testimonial-program {
  font-size: 1.5rem;
  color: #fff;
  margin-top: 0.5rem;
}

/* Admin specific styling for testimonial program */
#testimonials-list .testimonial-program {
  font-size: 0.75rem !important;
  color: rgba(255, 255, 255, 0.6) !important;
  margin: 3px 0 !important;
  font-style: italic !important;
}

/* User page specific styling - override admin styles */
#reviews #testimonials .testimonial-program {
  font-size: 1.5rem !important;
  color: #fff !important;
  margin-top: 0.5rem !important;
  font-style: normal !important;
}
/* Center the filter form */
.filter-form {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Avatar styling */
.testimonial-avatar {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.filter-form select,
.filter-form input,
.filter-form button {
  height: 40px;
  font-size: 1rem;
  padding: 0 12px;
  border-radius: 5px;
  border: 1px solid #ccc;
  box-shadow: none;
}

.edit-row {
  padding: 1em;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 1em;
}

/* 修复Quill编辑器内容区字体颜色和背景色 */
.ql-editor {
  color: #222 !important;
  background: #fff !important;
}

/* 调整Create Testimonial表单中Quill编辑器的尺寸 */
#admin-testimonial-content .ql-editor {
  min-height: 150px !important;
  height: 150px !important;
  width: 100% !important;
}

#admin-testimonial-content .ql-container {
  height: 150px !important;
  width: 100% !important;
}

/* 增加表单容器的最大宽度 */
.testimonial-form {
  max-width: 1200px !important;
  width: 90% !important;
}

/* 增加Content标签与上面文字的间距 */
.content-div label {
  margin-top: 20px !important;
  margin-bottom: 10px !important;
  display: block;
}

/* 增加Username和Avatar字段之间的间距 */
.username-div {
  margin-bottom: 20px !important;
}

.photo-div {
  margin-bottom: 20px !important;
}

.program-div {
  margin-bottom: 20px !important;
}

.edit-btn {
  background: rgb(46, 76, 248);
}

/* 美化Edit按钮 */
.edit-btn,
.db-send-button,
.db-copy-button,
.delete-btn {
  background: rgb(46, 76, 248);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 6px 16px;
  font-size: 1rem;
  font-weight: normal;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  margin: 0 0 0 10px;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-block;
  vertical-align: middle;
}
.edit-btn:hover {
  background: #0056b3;
}

.del-testimonial-form {
  display: inline;
}

.delete-btn {
  background: #d7263d; /* Unique red, different from .badge-warning */
}
.delete-btn:hover {
  background: rgb(247, 56, 56);
  color: #fff;
}

/* Specific variants */
.db-copy-button {
  background: #23a802;
  color: #fff;
}

.db-send-button {
  background: #e7395c;
  color: #fff;
}

.buttons {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.move-up,
.move-down,
.drag-handle {
  font-size: 1.2rem;
  color: black;
  padding: 0.3rem 0.6rem;
  background-color: whitesmoke;
  border-radius: 4px;
}

@media (max-width: 600px) {
  /* Mobile view: make each card take one row, remove side margins */
  #reviews {
    margin: 0 5px !important;
  }
  #testimonials.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 16px;
  }
  .testimonial-card {
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
  /* Mobile view: reduce heading font size in intro section */
  #testimonial-intro h1 {
    font-size: 1.6rem !important;
    text-align: center;
  }
  #testimonial-intro h1 span,
  #testimonial-intro h1 b {
    font-size: inherit !important;
  }
  #testimonial-intro p {
    font-size: 1rem !important;
  }
}

/* ======================= Responsive Design ======================= */
@media (max-width: 768px) {
  .testimonial-form,
  .modal-content {
    width: 95% !important;
    padding: 15px !important;
  }

  .form-control,
  .form-control3 {
    width: 100% !important;
    font-size: 1rem;
  }

  .buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-left: auto;
  margin-right: auto;
}


  .edit-btn,
.db-send-button,
.db-copy-button,
.delete-btn {
  width: auto;
  min-width: 200px;
  max-width: 90%;
  padding: 10px 20px;
  text-align: center;
  display: block;
}


  .testimonial-card {
    padding: 15px;
    font-size: 1rem;
  }

  .testimonial-avatar {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
  }

  .status-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .badge-approved,
  .badge-warning,
  .badge-success {
    font-size: 1rem;
    width: 100%;
    text-align: center;
  }

  .alert-success,
  .alert-danger {
    font-size: 0.95rem;
    padding: 10px;
  }

  .filter-form {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .filter-form input[type="text"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}


  .filter-form select,
  .filter-form input,
  .filter-form button {
    width: 100%;
  }

  #submit-testimonial,
  #login-prompt {
    margin: 20px 10px !important;
  }

  .modal-content {
    margin: 15% auto !important;
    max-width: 90%;
  }
}
