/* Frontend theme vars (can be overridden by Customizer) */
.wpcs-complaint,
.wpcs-live-box,
.account-codes {
  --wpcs-front-bg: #0d121c;
  --wpcs-front-text: #edf2fb;
  --wpcs-front-accent: #4ea1ff;
  --wpcs-front-border: rgba(237, 242, 251, 0.35);
  --wpcs-front-border-strong: rgba(237, 242, 251, 0.5);
  --wpcs-front-muted: rgba(237, 242, 251, 0.72);
  --wpcs-front-panel: rgba(237, 242, 251, 0.08);
  --wpcs-front-panel-strong: rgba(237, 242, 251, 0.12);
  --wpcs-front-surface: rgba(237, 242, 251, 0.14);
  --wpcs-front-input-bg: rgba(237, 242, 251, 0.08);
  --wpcs-front-focus: rgba(78, 161, 255, 0.28);
  --wpcs-front-shadow: 0 24px 50px rgba(13, 18, 28, 0.45);
  --wpcs-front-btn-text: #081019;
  --wpcs-front-radius: 16px;
  --panel: var(--wpcs-front-bg);
  --line: var(--wpcs-front-border);
  --text: var(--wpcs-front-text);
  --shadow: var(--wpcs-front-shadow);
  --accent-color: var(--wpcs-front-accent);
}

/* Complaint/chat section */
.wpcs-complaint {
  margin: 0 auto 70px;
  max-width: 960px;
  background: var(--panel, rgba(15, 15, 20, 0.92));
  border-radius: var(--wpcs-front-radius, 22px);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  padding: 24px;
  box-shadow: var(--shadow, 0 30px 60px rgba(0, 0, 0, 0.45));
  color: var(--text, #f6f7fb);
}
.wpcs-complaint h3 {
  margin: 0 !important;
  font-size: clamp(22px, 4vw, 28px);
  text-align: center;
  color: inherit;
}
.top-complaint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.top-complaint h3 {
  margin: 0 !important;
  flex: 1 1 240px;
  text-align: left;
  font-size: 28px;
}
.top-complaint p {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

.top-complaint {
  display: flex;
  align-items: center;
}
.top-complaint__meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}
.top-complaint__item {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}
.top-complaint__label {
  font-size: 12px;
  opacity: 0.6;
}
.top-complaint__value {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.top-complaint__divider {
  opacity: 0.4;
}
.top-complaint__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  letter-sizing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  text-align: center;
  min-width: auto;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.top-complaint__badge.is-open {
  background: rgba(99, 223, 188, 0.15);
  border-color: rgba(99, 223, 188, 0.4);
  color: #bff5e6;
}
.top-complaint__badge.is-closed {
  background: rgba(255, 99, 132, 0.15);
  border-color: rgba(255, 99, 132, 0.4);
  color: #ffb5c4;
}
.wpcs-thread,
.wpcs-thread-front {
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: none;
  overflow: visible;
  align-items: flex-start;
}
.wpcs-msg {
  margin: 0;
  padding: 14px 18px;
  border-radius: 16px;
  max-width: 84%;
  font-size: 15px;
  line-height: 1.45;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  word-wrap: break-word;
}
.wpcs-msg .wpcs-meta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
  opacity: 0.8;
}
.wpcs-msg .wpcs-body p {
  margin: 4px 0 0;
  max-width: 300px;
}

.wpcs-msg .wpcs-body p img {
  border-radius: 12px;
}
.wpcs-msg.wpcs-customer {
  margin-left: auto;
  margin-right: 0;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  text-align: left;
  border-radius: 18px 18px 4px 18px;
  text-align: right;
}
.wpcs-msg.wpcs-customer .wpcs-meta {
  color: rgba(255, 255, 255, 0.8);
}
.wpcs-msg.wpcs-admin {
  margin-right: auto;
  margin-left: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #f6f7fb;
  border-radius: 18px 18px 18px 4px;
  text-align: left;
}
.wpcs-msg.wpcs-admin .wpcs-meta {
  color: rgba(255, 255, 255, 0.7);
}
.wpcs-msg.wpcs-system {
  background: #ff3eb5;
  color: black;
  margin: 0;
  /* max-width: 100%; */
  text-align: left;
  border-radius: 12px;
  /* width: 100%; */
  border: 1px solid var(--accent-color);
}
.wpcs-front-reply {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wpcs-front-reply p {
  margin: 0;
}
.wpcs-front-reply textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-size: 15px;
  padding: 16px 18px;
  min-height: 140px;
  resize: none;
}
.wpcs-message-field {
  position: relative;
}
.wpcs-message-field textarea {
  padding-right: 96px;
  min-height: 180px;
}
.wpcs-message-field .wpcs-file-field {
  position: absolute;
  right: 18px;
  bottom: 18px;
  margin: 0;
}
.wpcs-message-field .wpcs-file-field .wpcs-file-input {
  align-items: flex-end;
}
.wpcs-message-field .wpcs-file-meta {
  display: none !important;
}
.wpcs-file-preview-slot {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.wpcs-file-preview-slot .wpcs-file-preview {
  display: none;
}
.wpcs-message-field + .wpcs-file-preview-slot {
  /* margin-top: 14px; */
  display: none;
}
.wpcs-message-field + .wpcs-file-preview-slot.has-content {
  display: block;
}
.wpcs-file-preview-slot.has-content .wpcs-file-preview {
  display: block;
}
.wpcs-front-reply textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}
.wpcs-front-reply .input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wpcs-file-field {
  gap: 12px;
}
.wpcs-file-input {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wpcs-file-input.is-enhanced input[type="file"] {
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.wpcs-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 22px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.wpcs-file-btn--icon {
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08) !importnat;
  border: none;
  display: flex;
  justify-content: center;
  align-items: centerl;
}
.wpcs-file-btn--icon img {
  width: 50%;
  height: auto;
  object-fit: cover;
  display: block;
}
.wpcs-file-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.wpcs-file-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 3px;
}
.wpcs-file-btn--icon .screen-reader-text,
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.wpcs-file-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  min-height: 20px;
  word-break: break-word;
}
.wpcs-file-preview {
  /* margin-top: 6px; */
  max-width: 100%;
  display: none;
}
.wpcs-file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}
.wpcs-file-thumb {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wpcs-file-preview__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wpcs-file-icon {
  font-size: 22px;
}
.wpcs-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: space-between;
}
.wpcs-file-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 150px;
}
.wpcs-file-remove {
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
}
.wpcs-file-remove:hover {
  background: rgba(255, 255, 255, 0.2);
}
.wpcs-file-input.has-file .wpcs-file-btn {
}
.wpcs-file-input.has-file .wpcs-file-meta {
  color: #fff;
}
.wpcs-file-input.has-preview .wpcs-file-meta {
  display: none;
}
.wpcs-file-input.has-preview .wpcs-file-preview {
  display: block;
}
.wpcs-front-reply button.button,
.wpcs-front-reply .button.button-primary {
  width: 100%;
}
.wpcs-front-reply.is-submitting,
.wpcs-captcha-form.is-submitting {
  opacity: 0.85;
  pointer-events: none;
}
.wpcs-front-reply .button.button-primary,
.wpcs-captcha-form .button.button-primary {
  position: relative;
  overflow: hidden;
  width: 100%;
}
.wpcs-front-reply .button.button-primary.is-loading,
.wpcs-captcha-form .button.button-primary.is-loading {
  padding-right: 48px;
}
.wpcs-front-reply .button.button-primary.is-loading::after,
.wpcs-captcha-form .button.button-primary.is-loading::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  transform: translateY(-50%);
  animation: wpcs-spin 0.8s linear infinite;
}
.account-codes .button {
  padding: 8px 16px !important;
  font-size: 14px !important;
}
.account-codes .wpcs-pager[data-enhanced="1"] {
  display: none;
}
noscript .wpcs-pager--noscript {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.account-codes .wpcs-code-wrap {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 8px 12px;
  text-align: left;
  color: #f6f7fb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: inherit;
}
.account-codes table th:last-of-type,
.account-codes table .wpcs-code-meta td:last-of-type {
  text-align: right;
}
.wpcs-complaint .send-button-wrapper {
  text-align: right;
}
.wpcs-complaint.open-now textarea {
  margin: 16px 0 0;
}

/* Live codes box */
.wpcs-live-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.wpcs-live-box__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  border-bottom: 1px solid #f1f1f3;
  padding-bottom: 10px;
  text-align: center;
  width: 100%;
}

.wpcs-live-box__head h3 {
  margin: 0 !important;
}

.wpcs-live-box__head h2 {
  width: 100%;
  text-align: center;
}

.wpcs-live-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: white;
}

.wpcs-live-status {
  margin: 16px 0;
  font-size: 15px;
  font-weight: 600;
  color: white;
}

.wpcs-live-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wpcs-live-item {
  border: 1px solid #f1f1f3;
  border-radius: 10px;
  padding: 14px;
  background: none;
}

.wpcs-live-item__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 12px;
}

.wpcs-live-item__top strong {
  font-size: 16px;
}

.wpcs-live-item__codes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wpcs-live-item__codes li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f4f6fb;
  border-radius: 8px;
  padding: 10px 12px;
}

.wpcs-live-item__codes code {
  font-family: inherit;
  font-weight: 500;
  color: #111827;
  font-size: 14px;
  text-align: left;
}

.wpcs-live-copy {
  border: 0;
  background: #111827;
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.wpcs-live-copy:hover {
  background: #334155;
}

.wpcs-live-item__missing {
  margin: 10px 0 0;
  font-size: 13px;
  color: #9f1239;
}

.wpcs-live-placeholder {
  padding: 18px;
  border: 1px dashed #c7c7d1;
  border-radius: 10px;
  background: #fbfbff;
  color: #475467;
  font-size: 14px;
  text-align: center;
}

.wpcs-live-updated {
  font-size: 12px;
}
.top-complaint__meta--inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@keyframes wpcs-spin {
  from {
    transform: translateY(-50%) rotate(0deg);
  }
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.wpcs-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 12, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9999;
}
.wpcs-lightbox.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.wpcs-lightbox__inner {
  position: relative;
  max-width: calc(100vw - 80px);
  max-height: calc(100vh - 80px);
}
.wpcs-lightbox__inner img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}
.wpcs-lightbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  background: rgba(0, 0, 0, 0.8);
  border: 0;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
body.wpcs-lightbox-open {
  overflow: hidden;
}

/* Themeable overrides */
.wpcs-thread,
.wpcs-thread-front,
.wpcs-msg,
.wpcs-front-reply textarea,
.wpcs-file-btn,
.wpcs-file-card,
.wpcs-live-box,
.wpcs-live-item,
.wpcs-live-item__codes li,
.wpcs-live-copy,
.wpcs-live-placeholder,
.account-codes .wpcs-code-wrap {
  border-radius: var(--wpcs-front-radius, 12px);
}

.wpcs-msg.wpcs-customer,
.wpcs-msg.wpcs-admin {
  background: var(--wpcs-front-panel, rgba(255, 255, 255, 0.08));
  color: var(--wpcs-front-text, #f6f7fb);
}

.wpcs-msg .wpcs-meta,
.top-complaint__meta,
.top-complaint p,
.wpcs-file-meta {
  color: var(--wpcs-front-muted, rgba(255, 255, 255, 0.72));
}

.wpcs-front-reply textarea,
.wpcs-complaint input[type="number"],
.wpcs-complaint input[type="email"] {
  background: var(--wpcs-front-input-bg, rgba(255, 255, 255, 0.08));
  border: 1px solid var(--wpcs-front-border-strong, var(--wpcs-front-border, rgba(255, 255, 255, 0.35))) !important;
  color: var(--wpcs-front-text, #f6f7fb);
}

.wpcs-front-reply textarea::placeholder,
.wpcs-complaint input[type="number"]::placeholder,
.wpcs-complaint input[type="email"]::placeholder {
  color: var(--wpcs-front-muted, rgba(255, 255, 255, 0.72));
}

.wpcs-front-reply textarea:focus,
.wpcs-complaint input[type="number"]:focus,
.wpcs-complaint input[type="email"]:focus {
  border-color: var(--wpcs-front-accent, #4ea1ff) !important;
  box-shadow: 0 0 0 2px var(--wpcs-front-focus, rgba(78, 161, 255, 0.28));
  outline: none;
}

/* Keep complaint verification inputs visible even when theme has stronger global input rules. */
.wpcs-complaint .wpcs-captcha-form .input-wrapper {
  margin: 0 0 12px;
}

.wpcs-complaint .wpcs-captcha-form .input-wrapper.button-wrapper {
  margin-bottom: 0;
}

.wpcs-complaint .wpcs-captcha-form input[type="number"],
.wpcs-complaint .wpcs-captcha-form input[type="email"] {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  font-size: 16px;
  line-height: 1.3;
  border-radius: var(--wpcs-front-radius, 12px);
  border: 1px solid var(--wpcs-front-border-strong, var(--wpcs-front-border, rgba(255, 255, 255, 0.35))) !important;
  background: var(--wpcs-front-input-bg, rgba(255, 255, 255, 0.08));
  color: var(--wpcs-front-text, #f6f7fb);
  -webkit-text-fill-color: var(--wpcs-front-text, #f6f7fb);
  opacity: 1;
  visibility: visible;
}

.wpcs-complaint .wpcs-captcha-form input[type="number"]::placeholder,
.wpcs-complaint .wpcs-captcha-form input[type="email"]::placeholder {
  color: var(--wpcs-front-muted, rgba(255, 255, 255, 0.72));
  opacity: 1;
}

.wpcs-complaint .wpcs-captcha-form input[type="number"]:focus,
.wpcs-complaint .wpcs-captcha-form input[type="email"]:focus {
  border-color: var(--wpcs-front-accent, #4ea1ff) !important;
  box-shadow: 0 0 0 2px var(--wpcs-front-focus, rgba(78, 161, 255, 0.28));
  outline: none;
}

.wpcs-file-btn {
  border-color: var(--wpcs-front-border, rgba(255, 255, 255, 0.22));
  background: var(--wpcs-front-panel, rgba(255, 255, 255, 0.08));
  color: var(--wpcs-front-text, #f6f7fb);
}

.wpcs-file-btn:hover {
  background: var(--wpcs-front-panel-strong, rgba(255, 255, 255, 0.12));
}

.wpcs-file-remove {
  background: var(--wpcs-front-panel-strong, rgba(255, 255, 255, 0.12));
  color: var(--wpcs-front-text, #f6f7fb);
}

.wpcs-live-item {
  border-color: var(--wpcs-front-border, rgba(255, 255, 255, 0.22));
}

.wpcs-live-item__codes li {
  background: var(--wpcs-front-panel, rgba(255, 255, 255, 0.08));
}

.wpcs-live-item__codes code {
  color: var(--wpcs-front-text, #f6f7fb);
}

.wpcs-live-copy {
  background: var(--wpcs-front-accent, #4ea1ff);
  color: var(--wpcs-front-btn-text, #081019);
}

.wpcs-live-copy:hover {
  filter: brightness(0.94);
}

.wpcs-complaint .button.button-primary,
.wpcs-front-reply .button.button-primary,
.wpcs-captcha-form .button.button-primary {
  background: var(--wpcs-front-accent, #4ea1ff);
  border-color: var(--wpcs-front-accent, #4ea1ff);
  color: var(--wpcs-front-btn-text, #081019);
  border-radius: var(--wpcs-front-radius, 12px);
}

.wpcs-live-status,
.wpcs-live-meta {
  color: var(--wpcs-front-text, #f6f7fb);
}

.wpcs-live-placeholder {
  border-color: var(--wpcs-front-border, rgba(255, 255, 255, 0.22));
  background: var(--wpcs-front-panel, rgba(255, 255, 255, 0.08));
  color: var(--wpcs-front-text, #f6f7fb);
}

.account-codes .wpcs-code-wrap {
  background: var(--wpcs-front-panel, rgba(255, 255, 255, 0.08));
  color: var(--wpcs-front-text, #f6f7fb);
  border-color: var(--wpcs-front-border, rgba(255, 255, 255, 0.22));
}
