/* ── WC Dispute Case Manager — Frontend CSS ── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ─── RESET & WRAP ─── */
.wcd-wrap {
  --wcd-bg:       #f8f8f6;
  --wcd-white:    #ffffff;
  --wcd-border:   #e3e3de;
  --wcd-text:     #1a1a18;
  --wcd-muted:    #6b6b68;
  --wcd-accent:   #2563eb;
  --wcd-accent-h: #1d4ed8;
  --wcd-green:    #16a34a;
  --wcd-yellow:   #ca8a04;
  --wcd-red:      #dc2626;
  --wcd-blue:     #2563eb;
  --wcd-radius:   12px;
  --wcd-shadow:   0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.05);

  font-family: 'DM Sans', sans-serif;
  color: var(--wcd-text);
  background: var(--wcd-bg);
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

/* ─── HEADER ─── */
.wcd-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.wcd-header-icon {
  width: 52px; height: 52px;
  background: #fef3c7;
  border: 1.5px solid #fde68a;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #d97706;
  flex-shrink: 0;
}
.wcd-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.wcd-subtitle {
  font-size: 0.9rem;
  color: var(--wcd-muted);
  margin: 0;
}

/* ─── TABS ─── */
.wcd-tabs {
  display: flex;
  gap: 8px;
  background: var(--wcd-white);
  border: 1.5px solid var(--wcd-border);
  border-radius: var(--wcd-radius);
  padding: 6px;
  margin-bottom: 24px;
}
.wcd-tab {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--wcd-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s ease;
}
.wcd-tab.active {
  background: var(--wcd-text);
  color: #fff;
}
.wcd-tab:hover:not(.active) {
  background: var(--wcd-bg);
  color: var(--wcd-text);
}

/* ─── STEPS ─── */
.wcd-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
}
.wcd-step {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--wcd-muted);
  white-space: nowrap;
}
.wcd-step.active { color: var(--wcd-text); }
.wcd-step.active .wcd-step-num {
  background: var(--wcd-text);
  color: #fff;
  border-color: var(--wcd-text);
}
.wcd-step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--wcd-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--wcd-white);
  flex-shrink: 0;
  transition: all .25s;
}
.wcd-step-line {
  flex: 1;
  height: 1.5px;
  background: var(--wcd-border);
  margin: 0 12px;
}

/* ─── NOTICE ─── */
.wcd-notice {
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 10px;
}
.wcd-notice.error {
  background: #fef2f2; color: var(--wcd-red); border: 1px solid #fecaca;
}
.wcd-notice.success {
  background: #f0fdf4; color: var(--wcd-green); border: 1px solid #bbf7d0;
}

/* ─── PANEL (card) ─── */
.wcd-panel {
  background: var(--wcd-white);
  border: 1.5px solid var(--wcd-border);
  border-radius: var(--wcd-radius);
  padding: 28px;
  box-shadow: var(--wcd-shadow);
  animation: wcdFadeIn .22s ease;
}

@keyframes wcdFadeIn {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ─── FORM ELEMENTS ─── */
.wcd-form-section { margin-bottom: 20px; }
.wcd-label {
  display: block;
  font-size: 0.87rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--wcd-text);
  letter-spacing: 0.01em;
}
.wcd-req { color: var(--wcd-red); }
.wcd-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--wcd-border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.93rem;
  color: var(--wcd-text);
  background: var(--wcd-bg);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.wcd-input:focus {
  border-color: var(--wcd-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  background: #fff;
}
.wcd-textarea { resize: vertical; min-height: 110px; }

/* ─── BUTTONS ─── */
.wcd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .18s ease;
  width: 100%;
  letter-spacing: 0.01em;
}
.wcd-btn-primary {
  background: var(--wcd-text);
  color: #fff;
}
.wcd-btn-primary:hover:not(:disabled) {
  background: #333330;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.wcd-btn-primary:disabled {
  opacity: 0.65; cursor: not-allowed;
}
.wcd-btn-ghost {
  background: transparent;
  color: var(--wcd-muted);
  border: 1.5px solid var(--wcd-border);
  margin-top: 14px;
  font-size: 0.85rem;
}
.wcd-btn-ghost:hover {
  background: var(--wcd-bg);
  color: var(--wcd-text);
  border-color: #ccc;
}

/* ─── CASE HEADER ─── */
.wcd-case-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap; gap: 10px;
}
.wcd-case-id-badge {
  font-family: 'DM Mono', monospace;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--wcd-text);
}
.wcd-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.wcd-status-badge.status-open         { background:#fef9c3; color:#a16207; border:1px solid #fde68a; }
.wcd-status-badge.status-in_progress  { background:#dbeafe; color:#1e40af; border:1px solid #bfdbfe; }
.wcd-status-badge.status-resolved     { background:#dcfce7; color:#15803d; border:1px solid #bbf7d0; }
.wcd-status-badge.status-closed       { background:#f1f5f9; color:#64748b; border:1px solid #e2e8f0; }

/* ─── ORDER INFO ─── */
.wcd-order-info {
  background: var(--wcd-bg);
  border: 1.5px solid var(--wcd-border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.wcd-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--wcd-border);
  font-size: 0.88rem;
}
.wcd-info-row:last-child { border-bottom: none; }
.wcd-info-label { color: var(--wcd-muted); font-weight: 500; }
.wcd-info-value { font-weight: 600; text-align: right; }

/* ─── SECTION TITLE ─── */
.wcd-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--wcd-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

/* ─── CHAT ─── */
.wcd-chat {
  min-height: 120px;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--wcd-border) transparent;
}
.wcd-chat:empty::before {
  content: 'No messages yet. Start the conversation below.';
  color: var(--wcd-muted);
  font-size: 0.88rem;
  text-align: center;
  margin: 24px auto;
  display: block;
}

/* Chat bubbles */
.wcd-bubble {
  max-width: 88%;
  animation: wcdFadeIn .2s ease;
}
.wcd-bubble.customer {
  align-self: flex-end;
}
.wcd-bubble.admin {
  align-self: flex-start;
}
.wcd-bubble-body {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.6;
}
.customer .wcd-bubble-body {
  background: var(--wcd-text);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.admin .wcd-bubble-body {
  background: var(--wcd-white);
  border: 1.5px solid var(--wcd-border);
  color: var(--wcd-text);
  border-bottom-left-radius: 4px;
}
.wcd-bubble-meta {
  font-size: 0.75rem;
  color: var(--wcd-muted);
  margin-top: 5px;
  display: flex; align-items: center; gap: 6px;
}
.customer .wcd-bubble-meta { justify-content: flex-end; }

/* ─── REPLY BOX ─── */
.wcd-reply-box {
  border-top: 1.5px solid var(--wcd-border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── SPINNER ─── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .7s linear infinite; }

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
  .wcd-wrap { padding: 20px 12px 40px; }
  .wcd-panel { padding: 20px 16px; }
  .wcd-tab  { font-size: 0.8rem; padding: 8px 10px; }
  .wcd-step span { display: none; }
}
