/* =============================================================================
   NANUSHTY — SUPPORT CHAT STYLES
   Add to: assets/css/chat.css  (or import as support-chat.css)
   Used by: support.html + admin panel (admin can reuse .sc-* classes)
   ============================================================================= */

/* ── Wrapper card ────────────────────────────────────────────────────────────── */

#supportChatCard {
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  max-width: 780px;
  margin: 0 auto 2.5rem;
}

/* ── Message scroll area ─────────────────────────────────────────────────────── */

.sc-messages {
  height: 420px;
  overflow-y: auto;
  padding: 1.25rem 1rem;
  scroll-behavior: smooth;
}

.sc-messages::-webkit-scrollbar {
  width: 5px;
}

.sc-messages::-webkit-scrollbar-track {
  background: transparent;
}

.sc-messages::-webkit-scrollbar-thumb {
  background: #dee2e6;
  border-radius: 999px;
}

/* ── Input area ──────────────────────────────────────────────────────────────── */

.sc-input {
  border-color: transparent !important;
  box-shadow: none !important;
  background: var(--bs-body-bg);
  border-radius: 2rem !important;
  font-size: 0.9rem;
  padding-left: 1rem;
}

.sc-input:focus {
  border-color: transparent !important;
  box-shadow: none !important;
}

/* ── Icon buttons (paperclip / send) ────────────────────────────────────────── */

.sc-icon-btn {
  background: none;
  border: none;
  color: #6c757d;
  font-size: 1rem;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  line-height: 1;
}

.sc-icon-btn:hover {
  color: var(--bs-primary);
  background: rgba(13, 110, 253, 0.08);
}

.sc-send-btn {
  color: var(--bs-primary);
}

.sc-send-btn:hover {
  color: #fff;
  background: var(--bs-primary);
}

/* ── Avatars ─────────────────────────────────────────────────────────────────── */

.sc-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  user-select: none;
}

.sc-avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.7rem;
}

/* Support agent avatar — dark brand colour */

.sc-avatar-support {
  background: #1a1a2e;
  color: #fff;
}

/* User avatar — primary tint */

.sc-avatar-user {
  background: var(--bs-primary);
  color: #fff;
  letter-spacing: 0.03em;
}

/* ── Chat bubbles ────────────────────────────────────────────────────────────── */

.sc-bubble {
  background: var(--bs-primary-bg-subtle);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  color: var(--bs-dark);
}

/* ── Image attachments in chat ───────────────────────────────────────────────── */

.sc-attachment-img {
  max-width: 220px;
  max-height: 200px;
  border-radius: 0.75rem;
  cursor: pointer;
  object-fit: cover;
  transition: opacity 0.15s;
  display: block;
  margin-bottom: 0.25rem;
}

.sc-attachment-img:hover {
  opacity: 0.88;
}

/* ── Image preview strip (before send) ──────────────────────────────────────── */

.sc-image-preview {
  border-top: 1px solid var(--bs-border-color, #dee2e6);
  background: var(--bs-body-bg, #fff);
}

.sc-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  flex-shrink: 0;
}

/* ── Date divider label ──────────────────────────────────────────────────────── */

.sc-divider-label {
  font-size: 0.72rem;
  color: #adb5bd;
  white-space: nowrap;
}

/* Divider lines */

.divider::after, .divider::before {
  content: "";
  flex: 1;
  height: 1px;
  background: #eee;
}

/* ── Dark mode ───────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .sc-input {
  background: rgba(255, 255, 255, 0.06);
  color: #e9ecef;
}

[data-bs-theme="dark"] .divider::after, [data-bs-theme="dark"] .divider::before {
  background: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .sc-image-preview {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .sc-thumb {
  border-color: rgba(255, 255, 255, 0.15);
}

/* =============================================================================
   SUPPORT CONTACT FORM CARD — mobile-first
   ============================================================================= */

/* ── Card container ──────────────────────────────────────────────────────────── */

.sc-form-card {
  max-width: 560px;
  margin: 0 auto 2.5rem;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

/* ── Guest notice ────────────────────────────────────────────────────────────── */

.contact-guest-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: rgba(13, 110, 253, 0.07);
  border: 1px solid rgba(13, 110, 253, 0.2);
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

/* ── Form rows & groups ──────────────────────────────────────────────────────── */

.sc-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 480px) {
  .sc-form-row {
    grid-template-columns: 1fr 1fr;
    gap: 0 0.75rem;
  }
}

.sc-form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.sc-form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  color: var(--bs-secondary-color, #6c757d);
}

.sc-label-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.78rem;
}

/* ── Inputs, selects, textarea ───────────────────────────────────────────────── */

.sc-form-group input, .sc-form-group select, .sc-form-group textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.6rem;
  background: var(--bs-body-bg, #fff);
  color: var(--bs-body-color, #212529);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.sc-form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236c757d' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
}

.sc-form-group textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.sc-form-group input:focus, .sc-form-group select:focus, .sc-form-group textarea:focus {
  outline: none;
  border-color: var(--bs-primary, #0d6efd);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

/* ── Order hint ──────────────────────────────────────────────────────────────── */

.order-prefill-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: #198754;
  font-weight: 500;
}

/* ── Upload zone — big tap target on mobile ──────────────────────────────────── */

.sc-upload-zone {
  border: 2px dashed var(--bs-border-color, #dee2e6);
  border-radius: 0.75rem;
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}

.sc-upload-zone:hover, .sc-upload-zone.drag-over {
  border-color: var(--bs-primary, #0d6efd);
  background: rgba(13, 110, 253, 0.04);
}

.sc-upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: var(--bs-secondary-color, #6c757d);
  font-size: 0.9rem;
  pointer-events: none;
}

.sc-upload-hint {
  font-size: 0.75rem;
  opacity: 0.7;
}

.sc-upload-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  justify-content: center;
}

/* Preview thumbnails */

.sc-upload-previews .preview-item {
  position: relative;
  width: 72px;
  height: 72px;
}

.sc-upload-previews .preview-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
}

.sc-upload-previews .preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.sc-upload-error {
  color: #dc3545;
  font-size: 0.8rem;
  margin: 0.5rem 0 0;
}

/* ── Submit button — full width, big touch target ────────────────────────────── */

.sc-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 52px;
  background: var(--bs-primary, #0d6efd);
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.sc-submit-btn:active {
  transform: scale(0.98);
}

.sc-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.sc-submit-btn .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.sc-submit-btn.loading .btn-spinner {
  display: block;
}

.sc-submit-btn.loading .btn-text {
  opacity: 0.7;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Feedback message ────────────────────────────────────────────────────────── */

.sc-form-feedback {
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: none;
}

.sc-form-feedback:not(:empty) {
  display: block;
}

.sc-form-feedback.success {
  background: rgba(25, 135, 84, 0.1);
  color: #198754;
  border: 1px solid rgba(25, 135, 84, 0.25);
}

.sc-form-feedback.error {
  background: rgba(220, 53, 69, 0.08);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

/* ── Dark mode ───────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .sc-form-group input, [data-bs-theme="dark"] .sc-form-group select, [data-bs-theme="dark"] .sc-form-group textarea {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: #e9ecef;
}

[data-bs-theme="dark"] .sc-upload-zone {
  border-color: rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"] .sc-upload-previews .preview-item img {
  border-color: rgba(255, 255, 255, 0.15);
}

/* ── Clear button (trash icon in chat header) ────────────────────────────────── */

.sc-clear-btn {
  color: #adb5bd;
  font-size: 0.85rem;
}

.sc-clear-btn:hover {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.08);
}

