/* ============================================================
   CCare Kitchen - Support & Help System Styles
   ============================================================ */

#support-help-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1a56db;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(26,86,219,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s;
}
#support-help-btn:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(26,86,219,0.5); }

.support-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9100;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 80px 24px 90px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.support-modal-overlay.active { opacity: 1; pointer-events: all; }

.support-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 78vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  transform: translateY(20px);
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
}
.support-modal-overlay.active .support-modal { transform: translateY(0); }

.support-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
}
.support-modal-header h3 { margin: 0; font-size: 16px; font-weight: 600; color: #111827; }

.support-modal-tabs { display: flex; gap: 4px; padding: 12px 20px 0; border-bottom: 1px solid #e5e7eb; flex-shrink: 0; }
.support-tab-btn { padding: 8px 14px; border: none; background: none; cursor: pointer; font-size: 13px; font-weight: 500; color: #6b7280; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s, border-color 0.15s; }
.support-tab-btn.active { color: #1a56db; border-bottom-color: #1a56db; }

.support-modal-body { padding: 20px; flex: 1; overflow-y: auto; }

.support-form-group { margin-bottom: 14px; }
.support-form-group label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 4px; }
.support-form-group input,
.support-form-group select,
.support-form-group textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; color: #111827; background: white; box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s; font-family: inherit;
}
.support-form-group input:focus,
.support-form-group select:focus,
.support-form-group textarea:focus { outline: none; border-color: #1a56db; box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.support-form-group textarea { resize: vertical; min-height: 90px; }

.support-submit-btn { width: 100%; padding: 11px; background: #1a56db; color: white; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 4px; transition: background 0.15s; }
.support-submit-btn:hover { background: #1e429f; }
.support-submit-btn:disabled { background: #93c5fd; cursor: not-allowed; }

.support-ticket-item { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.support-ticket-item:hover { border-color: #1a56db; background: #f0f5ff; }
.support-ticket-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.support-ticket-num { font-size: 11px; color: #9ca3af; font-weight: 500; }
.support-ticket-subject { font-size: 14px; font-weight: 600; color: #111827; }
.support-ticket-desc { font-size: 12px; color: #6b7280; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.support-badge-status, .support-badge-priority, .support-badge-type {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.status-open { background: #dbeafe; color: #1d4ed8; }
.status-in_progress { background: #fef3c7; color: #92400e; }
.status-resolved { background: #d1fae5; color: #065f46; }
.status-closed { background: #f3f4f6; color: #6b7280; }
.priority-urgent { background: #fee2e2; color: #991b1b; }
.priority-high { background: #ffedd5; color: #9a3412; }
.priority-medium { background: #fef9c3; color: #854d0e; }
.priority-low { background: #f0fdf4; color: #166534; }
.type-bug { background: #fce7f3; color: #9d174d; }
.type-help { background: #ede9fe; color: #5b21b6; }
.type-other { background: #f3f4f6; color: #374151; }

.support-success { text-align: center; padding: 30px 20px; }
.support-success .success-icon { font-size: 48px; margin-bottom: 12px; }
.support-success h4 { margin: 0 0 8px; font-size: 18px; color: #111827; }
.support-success p { color: #6b7280; font-size: 14px; margin: 0 0 16px; }

.support-close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: #6b7280; padding: 2px 6px; border-radius: 4px; line-height: 1; }
.support-close-btn:hover { color: #111827; background: #f3f4f6; }

.support-empty { text-align: center; padding: 40px 20px; color: #9ca3af; font-size: 14px; }
.support-empty .empty-icon { font-size: 36px; margin-bottom: 8px; }

.support-back-btn { background: none; border: none; color: #1a56db; font-size: 13px; cursor: pointer; padding: 0; margin-bottom: 12px; display: flex; align-items: center; gap: 4px; }
.support-detail-desc { margin-top: 12px; padding: 12px; background: #f9fafb; border-radius: 8px; font-size: 13px; color: #374151; line-height: 1.5; border-left: 3px solid #1a56db; white-space: pre-wrap; }
.support-admin-note { margin-top: 10px; padding: 10px 12px; background: #fffbeb; border-radius: 8px; border-left: 3px solid #f59e0b; font-size: 13px; color: #374151; }
.support-admin-note strong { display: block; color: #92400e; font-size: 12px; margin-bottom: 2px; }

/* Admin Panel (inside admin tab) */
.support-admin-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.support-admin-filters select,
.support-admin-filters input { padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; color: #374151; background: white; }

.support-admin-table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.support-admin-table th { padding: 11px 14px; text-align: left; font-size: 12px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.support-admin-table td { padding: 12px 14px; font-size: 13px; color: #374151; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.support-admin-table tr:last-child td { border-bottom: none; }
.support-admin-table tr.support-admin-row:hover td { background: #f0f5ff; cursor: pointer; }

.support-admin-detail-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.support-admin-detail-modal { background: white; border-radius: 16px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.support-admin-detail-header { padding: 20px 24px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: flex-start; }
.support-admin-detail-body { padding: 24px; }
.support-admin-detail-body label { display: block; font-size: 12px; font-weight: 600; color: #6b7280; text-transform: uppercase; margin-bottom: 4px; margin-top: 14px; }
.support-admin-detail-body label:first-child { margin-top: 0; }
.support-admin-detail-body select,
.support-admin-detail-body textarea { width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; color: #111827; box-sizing: border-box; font-family: inherit; }
.support-admin-detail-body select:focus,
.support-admin-detail-body textarea:focus { outline: none; border-color: #1a56db; box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.support-admin-actions { display: flex; gap: 10px; margin-top: 20px; align-items: center; }
.support-btn-save { padding: 10px 20px; background: #1a56db; color: white; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.support-btn-save:hover { background: #1e429f; }
.support-btn-save:disabled { background: #93c5fd; cursor: not-allowed; }
.support-btn-cancel { padding: 10px 20px; background: #f3f4f6; color: #374151; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.support-btn-cancel:hover { background: #e5e7eb; }
.support-btn-delete { padding: 10px 16px; background: none; color: #dc2626; border: 1px solid #fca5a5; border-radius: 8px; font-size: 13px; cursor: pointer; margin-left: auto; }
.support-btn-delete:hover { background: #fee2e2; }

.support-loading { text-align: center; padding: 30px; color: #9ca3af; font-size: 14px; }

/* ── AI Help Box ──────────────────────────────────────────── */
.support-ai-box {
  background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
  border: 1.5px solid #c7d2fe;
  border-radius: 12px;
  padding: 14px 16px;
}

.support-ai-btn {
  padding: 9px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #1a56db;
  color: white;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.support-ai-btn:hover { background: #1e429f; }
.support-ai-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.support-ai-btn-ghost {
  background: white;
  color: #4b5563;
  border: 1px solid #d1d5db;
}
.support-ai-btn-ghost:hover { background: #f9fafb; }

/* AI Answer */
.support-ai-answer {
  margin-top: 12px;
  background: white;
  border-radius: 10px;
  border: 1px solid #c7d2fe;
  overflow: hidden;
}
.support-ai-answer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #1a56db;
  color: white;
  font-size: 12px;
  font-weight: 600;
}
.support-ai-answer-text {
  padding: 12px 14px;
  font-size: 14px;
  color: #111827;
  line-height: 1.6;
  white-space: pre-wrap;
}
.support-ai-answer-footer {
  padding: 8px 14px;
  background: #f8fafc;
  font-size: 12px;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
}
.support-ai-error {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  font-size: 13px;
  color: #9a3412;
}
.support-ai-thinking {
  padding: 12px;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  font-style: italic;
}
