/* Support — login form, dashboard, ticket thread.
 * Builds on guides.css (same chrome).
 */

/* Dashboard pages get the wider marketing container — the narrow
   880px guides container is meant for long-form reading, not for
   ticket lists with metadata columns. The thread page inherits
   the narrower default since the message body reads better narrow. */
.support-dashboard-page .container { max-width: 1100px; }

/* Tab strip — mirrors the /admin tabstrip pattern (underline + active
   pill) so the support dashboard matches the admin look. The
   .device-tabs class from mydargo would also have worked but it isn't
   defined in dargostore's CSS. */
.support-tabstrip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.5rem 0 1.5rem;
  border-bottom: 2px solid #000;
}
.support-tab {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.55rem 1.1rem;
  background: transparent;
  color: #666;
  border: 2px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-bottom: -2px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}
.support-tab:hover { color: #000; background: #f0eadf; }
.support-tab.active { color: #000; background: #fff; border-color: #000; }

.support-card {
  background: #ffffff;
  border: 2px solid #000;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-hard-sm, 4px 4px 0 #000);
}
.support-field { margin-bottom: 0.9rem; }
.support-field label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}
.support-field input[type="email"],
.support-field input[type="text"],
.support-field select,
.support-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.6rem 0.8rem;
  border: 2px solid #000;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}
.support-field textarea {
  resize: vertical;
  min-height: 120px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
}
.support-btn-primary {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 1.25rem;
  background: #000;
  color: #fff;
  border: 2px solid #000;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-hard-sm, 4px 4px 0 #000);
}
.support-btn-primary:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}
.support-btn-outline {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 1.25rem;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  border-radius: 8px;
  cursor: pointer;
}
.support-btn-outline:hover { background: #f0eadf; }
.support-hint { font-size: 0.78rem; color: #555; margin-top: 0.75rem; text-align: center; }
.support-flash {
  background: #fef2f2;
  border: 2px solid #dc2626;
  color: #7f1d1d;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Dashboard */
.support-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.support-dashboard-header h1 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}
.support-dashboard-header p { color: #555; font-size: 0.88rem; margin: 0.4rem 0 0; }
.support-dashboard-header a { color: #111; font-weight: 600; }

.support-tab-count {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px;
  font-size: 0.7rem; font-weight: 700;
  background: rgba(0,0,0,0.08); color: inherit;
  border-radius: 100px; margin-left: 0.3rem;
}

.support-tab-pane.active { display: block; }
.support-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #888;
  font-style: italic;
  background: #fff;
  border: 2px dashed rgba(0,0,0,0.18);
  border-radius: 12px;
}

.support-ticket-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 2px solid #000;
  border-radius: 12px;
  box-shadow: var(--shadow-hard-sm, 4px 4px 0 #000);
  text-decoration: none;
  color: #111;
  margin-bottom: 0.65rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  gap: 0.75rem;
}
.support-ticket-row:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #000;
}
.support-ticket-row-main { flex: 1; min-width: 0; }
.support-ticket-row-title {
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-ticket-row-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: #666;
  flex-wrap: wrap;
}
.support-num { font-weight: 600; color: #111; }
.support-dot { color: #ccc; }

.support-status, .support-priority {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1.5px solid #000;
  flex-shrink: 0;
}
.support-status.status-open,
.support-status.status-awaiting_support { background: #fff5d6; color: #000; }
.support-status.status-awaiting_user { background: #d6e8ff; color: #000; }
.support-status.status-resolved,
.support-status.status-closed { background: #d6ffd6; color: #000; }

.support-priority { border: none; }
.support-priority.priority-low { background: #eeeeee; color: #555; }
.support-priority.priority-normal { background: #e0e7ff; color: #333; }
.support-priority.priority-high { background: #ffe9c4; color: #553a00; }
.support-priority.priority-urgent { background: #ffd6d6; color: #8a0000; }

/* Modal */
.support-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.support-modal.hidden { display: none; }
.support-modal-card {
  background: #fff;
  border: 2px solid #000;
  border-radius: 12px;
  padding: 1.5rem;
  width: min(560px, 92vw);
  box-shadow: 6px 6px 0 #000;
  max-height: 90vh;
  overflow-y: auto;
}
.support-modal-card h2 {
  margin: 0 0 1rem;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}
.support-modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Thread view */
.support-thread-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #000;
}
.support-thread-header h1 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.6rem;
  margin: 0 0 0.55rem;
  font-weight: 700;
}
.support-thread-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: #555;
  flex-wrap: wrap;
}
.support-thread { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.support-message {
  background: #fff;
  border: 2px solid #000;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-hard-sm, 4px 4px 0 #000);
}
.support-message.staff { background: #fafff0; border-color: #4d8d04; }
.support-message-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 0.45rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.support-message-author {
  font-weight: 600;
  color: #111;
}
.support-staff-badge {
  display: inline-block;
  font-size: 0.65rem; font-weight: 700;
  padding: 1px 6px; border-radius: 4px;
  background: #000; color: #fff;
  margin-left: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.support-message-body { font-size: 0.92rem; line-height: 1.55; color: #222; }
.support-message-body p { margin: 0 0 0.5rem; }
.support-message-body p:last-child { margin-bottom: 0; }
.support-message-body code {
  background: rgba(0,0,0,0.06);
  padding: 1px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.88em;
}
.support-message-body pre {
  background: #1a1a1a;
  color: #f5f5f0;
  padding: 0.85rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0.55rem 0;
}

.support-reply-form {
  background: #fff;
  border: 2px solid #000;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-hard-sm, 4px 4px 0 #000);
}
.support-reply-form h3 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}
.support-reply-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.92rem;
  padding: 0.6rem 0.8rem;
  border: 2px solid #000;
  border-radius: 8px;
  background: #fff;
  resize: vertical;
  box-sizing: border-box;
}
.support-reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}
.support-closed-note {
  padding: 1rem;
  background: #f0eadf;
  border: 2px dashed rgba(0,0,0,0.2);
  border-radius: 12px;
  text-align: center;
  color: #555;
  font-size: 0.9rem;
}
/* Resolve form — sits as a sibling below the reply form. Sibling so
   clicking Mark as resolved doesn't accidentally submit the reply
   form's required textarea. Visually quieter than the reply card so
   it reads as a secondary action. */
.support-resolve-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
  background: #f8f5ed;
  border: 2px dashed rgba(0,0,0,0.2);
  border-radius: 12px;
  font-size: 0.88rem;
  color: #555;
}
.support-resolve-form span { flex: 1; min-width: 220px; }

@media (max-width: 600px) {
  .support-dashboard-header h1 { font-size: 1.6rem; }
  .support-thread-header h1 { font-size: 1.3rem; }
}

/* ─── Attachments ───────────────────────────────────────────────── */
/* File input — wraps the native <input type="file"> in a friendly
   dashed-border block. The native control is hidden but still
   focusable + clickable. */
.support-attach-input {
  display: block;
  margin-top: 0.65rem;
  padding: 0.7rem 1rem;
  border: 2px dashed rgba(0,0,0,0.25);
  border-radius: 8px;
  background: #fafaf7;
  cursor: pointer;
  font-size: 0.85rem;
  color: #555;
  text-align: center;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.support-attach-input:hover {
  background: #f0eadf;
  border-color: rgba(0,0,0,0.45);
}
.support-attach-input input[type="file"] {
  display: block;
  margin: 0.45rem auto 0;
  font-family: inherit;
  font-size: 0.82rem;
}

/* Attachment list under a message body. Mixed grid — images flow
   left-to-right as thumbnails; non-image chips wrap as wide blocks. */
.support-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(0,0,0,0.12);
}
.support-attachment-image {
  display: block;
  border: 2px solid #000;
  border-radius: 8px;
  overflow: hidden;
  width: 140px; height: 140px;
  background: #fff;
  box-shadow: var(--shadow-hard-sm, 4px 4px 0 #000);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.support-attachment-image:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #000;
}
.support-attachment-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.support-attachment-file {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  background: #fff;
  border: 2px solid #000;
  border-radius: 8px;
  box-shadow: var(--shadow-hard-sm, 4px 4px 0 #000);
  text-decoration: none;
  color: #111;
  font-size: 0.85rem;
  max-width: 100%;
  min-width: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.support-attachment-file:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #000;
}
.support-attachment-icon { font-size: 1.05rem; flex-shrink: 0; }
.support-attachment-meta {
  display: flex; flex-direction: column;
  min-width: 0;
}
.support-attachment-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
.support-attachment-size {
  font-size: 0.75rem;
  color: #666;
}

/* ─── Dropzone (attachment picker with file list) ───────────────── */
.dargo-dropzone {
  margin-top: 0.7rem;
  border: 2px dashed rgba(0,0,0,0.25);
  border-radius: 10px;
  background: #fafaf7;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.dargo-dropzone.dragging {
  background: #f0eadf;
  border-color: #000;
  border-style: solid;
}
.dargo-dropzone-input {
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0;
}
.dargo-dropzone-trigger {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: color 0.12s ease;
}
.dargo-dropzone-trigger:hover { color: #000; }
.dargo-dropzone-list {
  list-style: none;
  margin: 0;
  padding: 0 0.65rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.dargo-dropzone-list[hidden] { display: none; }
.dargo-dropzone-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 2px solid #000;
  border-radius: 8px;
  box-shadow: 2px 2px 0 #000;
}
.dargo-dropzone-row img[data-thumb] {
  width: 40px; height: 40px;
  object-fit: cover;
  border: 1.5px solid #000;
  border-radius: 4px;
  flex-shrink: 0;
}
.dargo-dropzone-file-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: #f0eadf;
  border: 1.5px solid #000;
  border-radius: 4px;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.dargo-dropzone-row-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.dargo-dropzone-row-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dargo-dropzone-row-size {
  font-size: 0.72rem;
  color: #666;
}
.dargo-dropzone-row-remove {
  width: 28px; height: 28px;
  flex-shrink: 0;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  background: #fff;
  color: #555;
  border: 1.5px solid rgba(0,0,0,0.25);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.dargo-dropzone-row-remove:hover {
  background: #ffd6d6;
  color: #8a0000;
  border-color: #8a0000;
}

/* Welcome intro on the login page — calls out that anyone with an
   email can open a ticket here, regardless of whether they bought
   anything. Sits between the heading and the form. */
.support-intro {
  background: var(--card-bg-warm, #f8f5ed);
  border: 2px solid #000;
  border-left: 6px solid #76FF03;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #222;
  box-shadow: var(--shadow-hard-sm, 4px 4px 0 #000);
}
.support-intro strong { display: block; margin-bottom: 0.3rem; }
