/*
 * Rating & Review Addon styles (widget panel + admin rate-customer box).
 *
 * Class names are prefixed with mmhd-rr to avoid colliding with the core
 * widget's own stylesheet.
 */

/* ------------------------------------------------------------------ *
 * Frontend widget review panel
 * ------------------------------------------------------------------ */
.mmhd-rr-panel {
  background: #fff;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
  font-family: inherit;
  padding: 14px 18px;
}

.mmhd-rr-panel-heading {
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
}

.mmhd-rr-panel .mmhd-rr-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.mmhd-rr-option {
  align-items: center;
  background: #f9fafb;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-family: inherit;
  gap: 2px;
  min-width: 56px;
  padding: 8px 12px;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.mmhd-rr-option:hover {
  background: #eef4ff;
  border-color: #007bff;
}

.mmhd-rr-option.selected {
  background: #eef4ff;
  border-color: #007bff;
  box-shadow: inset 0 0 0 1px #007bff;
}

.mmhd-rr-option-emoji {
  font-size: 22px;
  line-height: 1;
}

.mmhd-rr-option-label {
  color: #6b7280;
  font-size: 10px;
  text-align: center;
}

.mmhd-rr-option-score {
  color: #9ca3af;
  font-size: 10px;
}

.mmhd-rr-panel .mmhd-rr-comment,
.mmhd-rr-admin-box .mmhd-rr-comment {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-sizing: border-box;
  color: #111827;
  font-family: inherit;
  font-size: 13px;
  min-height: 52px;
  padding: 8px 10px;
  resize: vertical;
  width: 100%;
}

.mmhd-rr-panel .mmhd-rr-comment:focus,
.mmhd-rr-admin-box .mmhd-rr-comment:focus {
  border-color: #007bff;
  outline: none;
}

.mmhd-rr-submit {
  background: #007bff;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
  padding: 9px 18px;
  transition: background-color 0.15s ease;
}

.mmhd-rr-submit:hover:not(:disabled) {
  background: #0069d9;
}

.mmhd-rr-submit:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.mmhd-rr-panel .mmhd-rr-status {
  color: #6b7280;
  display: block;
  font-size: 12px;
  margin-top: 8px;
}

.mmhd-rr-status.error {
  color: #dc2626;
}

.mmhd-rr-status.success {
  color: #16a34a;
}

.mmhd-rr-summary {
  color: #374151;
  font-size: 13px;
}

.mmhd-rr-summary-row {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.mmhd-rr-summary-emoji {
  font-size: 22px;
  line-height: 1;
}

.mmhd-rr-summary-score {
  color: #111827;
  font-weight: 600;
}

.mmhd-rr-summary-comment {
  color: #4b5563;
  font-size: 12px;
  margin-top: 6px;
  white-space: pre-wrap;
}

.mmhd-rr-summary-date {
  color: #9ca3af;
  font-size: 11px;
  margin-top: 4px;
}

/* ------------------------------------------------------------------ *
 * Admin — rate-customer card (single ticket sidebar)
 *
 * The card uses the dashboard's own Tailwind utilities
 * (bg-white rounded-xl shadow-sm border border-gray-100 p-6) placed on the
 * element by the JS, so only the inner pieces are styled here.
 * ------------------------------------------------------------------ */
.mmhd-rr-admin-heading {
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
}

.mmhd-rr-admin-sub {
  color: #6b7280;
  font-size: 12px;
  margin: 0 0 10px;
}

.mmhd-rr-admin-box .mmhd-rr-options {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.mmhd-rr-admin-box .mmhd-rr-option {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 2px;
}

.mmhd-rr-admin-box .mmhd-rr-option-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mmhd-rr-admin-box .mmhd-rr-comment {
  margin-top: 10px;
  min-height: 46px;
}

.mmhd-rr-admin-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.mmhd-rr-save {
  background: #16a34a;
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
}

.mmhd-rr-save:hover:not(:disabled) {
  background: #15803d;
}

.mmhd-rr-save:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.mmhd-rr-admin-actions .mmhd-rr-status {
  color: #6b7280;
  font-size: 12px;
}

/* ------------------------------------------------------------------ *
 * Settings toggles
 *
 * The core dashboard ships a pre-compiled Tailwind build, so the peer/
 * after: utilities used in the settings markup are NOT compiled for this
 * addon — the checkbox toggles but the switch never changes colour and has
 * no knob. These rules re-implement the switch with plain CSS only.
 * ------------------------------------------------------------------ */
.mmhd-rr-toggle {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.mmhd-rr-toggle-pill {
  background-color: #d1d5db;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-block;
  flex-shrink: 0;
  height: 24px;
  position: relative;
  transition: background-color 0.15s ease;
  width: 44px;
}

.mmhd-rr-toggle-pill::after {
  background-color: #fff;
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 20%);
  content: "";
  height: 20px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: -webkit-transform 0.15s ease;
  transition: transform 0.15s ease;
  width: 20px;
}

.mmhd-rr-toggle:checked + .mmhd-rr-toggle-pill {
  background-color: #16a34a;
}

.mmhd-rr-toggle:checked + .mmhd-rr-toggle-pill::after {
  transform: translateX(20px);
}
