/**
 * FMM Helpdesk Module
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 *
 * @author    FMM Modules
 * @copyright FMM Modules
 * @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 *
 * @category  FMM Modules
 */
#helpdesk-customer {
  margin-top: 18px;
}

#helpdesk-customer .hd-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  padding: 18px;
}

#helpdesk-customer .hd-success {
  margin-bottom: 12px;
}

#helpdesk-customer .hd-tiles-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 22px;
  margin-top: 0;
  margin-bottom: 0;
}

/* Dashboard status carousel (many statuses) */
#helpdesk-customer .hd-tiles-carousel {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  flex: 1;
  min-width: 0;
}

#helpdesk-customer .hd-dashboard-top .hd-tiles-carousel {
  justify-content: center;
}

#helpdesk-customer .hd-tiles-carousel-viewport {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  /* Icons sit at top: -22px on .hd-tile; padding keeps them inside the clipping box */
  padding-top: 30px;
  box-sizing: border-box;
}

#helpdesk-customer .hd-tiles-pages-strip {
  display: flex;
  transition: transform 0.28s ease;
  will-change: transform;
}

#helpdesk-customer .hd-tiles-page {
  flex-shrink: 0;
  box-sizing: border-box;
}

#helpdesk-customer .hd-tiles-row--page {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 22px;
  padding-bottom: 4px;
}

#helpdesk-customer .hd-tiles-nav {
  flex: 0 0 auto;
  width: 36px;
  height: 40px;
  border: 1px solid #cfcfcf;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #444;
  padding: 0;
}

#helpdesk-customer .hd-tiles-nav:hover:not(:disabled) {
  background: #f5f5f5;
}

#helpdesk-customer .hd-tiles-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

#helpdesk-customer .hd-tiles-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #c8c8c8;
  cursor: pointer;
}

#helpdesk-customer .hd-tiles-dot.is-active {
  background: #333;
  transform: scale(1.2);
}

#helpdesk-customer .hd-tile--palette-1 { background: #0a9a7b; }
#helpdesk-customer .hd-tile--palette-1 .hd-tile-icon { color: #0a9a7b; }

#helpdesk-customer .hd-tile--palette-2 { background: #e74c3c; }
#helpdesk-customer .hd-tile--palette-2 .hd-tile-icon { color: #e74c3c; }

#helpdesk-customer .hd-tile--palette-3 { background: #2563eb; }
#helpdesk-customer .hd-tile--palette-3 .hd-tile-icon { color: #2563eb; }

#helpdesk-customer .hd-tile--palette-4 { background: #7c3aed; }
#helpdesk-customer .hd-tile--palette-4 .hd-tile-icon { color: #7c3aed; }

#helpdesk-customer .hd-tile--palette-5 { background: #ea580c; }
#helpdesk-customer .hd-tile--palette-5 .hd-tile-icon { color: #ea580c; }

#helpdesk-customer .hd-dashboard-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;
  margin-top: 10px;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  background: #fff;
  border-radius: 6px;
  padding: 22px 26px;
  /* box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08); */
}

#helpdesk-customer .hd-dashboard-top--no-avatar {
  justify-content: center;
}

#helpdesk-customer .hd-account-avatar {
  width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 110px;
  background: #f7f7f7;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 14px 10px;
}

#helpdesk-customer .hd-account-avatar img {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e5e5e5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

#helpdesk-customer .hd-account-avatar .hd-ticket-logout--avatar {
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: center;
  padding: 6px 4px;
  font-size: 11px;
  gap: 4px;
  white-space: nowrap;
}

#helpdesk-customer .hd-account-avatar .hd-ticket-logout--avatar svg {
  flex-shrink: 0;
}

#helpdesk-customer .hd-tile {
  width: 220px;
  height: 92px;
  border-radius: 2px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  user-select: none;
}

#helpdesk-customer .hd-tile .hd-tile-inner {
  text-align: center;
  line-height: 1.1;
}

#helpdesk-customer .hd-tile .hd-tile-icon {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

#helpdesk-customer .hd-tile .hd-tile-title {
  text-transform: uppercase;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.4px;
  opacity: 0.95;
}

#helpdesk-customer .hd-tile .hd-tile-count {
  margin-top: 6px;
  font-weight: 700;
  font-size: 18px;
}

#helpdesk-customer .hd-tile--all { background: #f0b20d; }
#helpdesk-customer .hd-tile--open { background: #0a9a7b; }
#helpdesk-customer .hd-tile--closed { background: #e74c3c; }

#helpdesk-customer .hd-tile--all .hd-tile-icon {
  color: #f0b20d;
}

#helpdesk-customer .hd-tile--open .hd-tile-icon {
  color: #0a9a7b;
}

#helpdesk-customer .hd-tile--closed .hd-tile-icon {
  color: #e74c3c;
}

#helpdesk-customer .hd-tile.is-active {
  filter: brightness(1.05);
}

#helpdesk-customer .hd-dashboard-title {
  background: #e51d2b;
  color: #fff;
  text-align: center;
  font-weight: 800;
  border-radius: 6px;
  padding: 14px 30px;
  width: 310px;
  margin: 8px auto 16px;
  position: relative;
}

#helpdesk-customer .hd-dashboard-title:before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 18px solid #e51d2b;
}

#helpdesk-customer .hd-dashboard-heading {
  font-size: 22px;
  font-weight: 700;
  color: #3a3a3a;
  margin-top: 2px;
  margin-bottom: 10px;
  padding-left: 10px;
}

#helpdesk-customer .hd-list-toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 12px;
}

#helpdesk-customer .hd-list-title {
  font-weight: 700;
  color: #666;
}

#helpdesk-customer .hd-btn {
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

#helpdesk-customer .hd-btn--teal {
  background: #0a9a7b;
  color: #fff;
}

#helpdesk-customer .hd-btn--yellow {
  background: #f0b20d;
  color: #fff;
}

#helpdesk-customer .hd-btn--ghost {
  background: #fff;
  color: #0a9a7b;
  border-color: #0a9a7b;
}

#helpdesk-customer .hd-events-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#helpdesk-customer .hd-events-bar .hd-search input {
  height: 34px;
  border: 1px solid #dcdcdc;
  border-radius: 3px;
  padding: 0 10px;
  width: 220px;
}

#helpdesk-customer .hd-events-bar .hd-entries select {
  height: 34px;
  border: 1px solid #dcdcdc;
  border-radius: 3px;
  padding: 0 10px;
}

#helpdesk-customer .hd-table-wrap {
  overflow-x: auto;
}

#helpdesk-customer table.hd-table {
  width: 100%;
  border-collapse: collapse;
}

#helpdesk-customer table.hd-table thead th {
  background: #f7f7f7;
  border-bottom: 1px solid #ececec;
  color: #777;
  font-weight: 700;
  font-size: 12px;
  padding: 12px 10px;
  text-align: left;
}

#helpdesk-customer table.hd-table tbody td {
  border-top: 1px solid #efefef;
  padding: 12px 10px;
  font-size: 13px;
  color: #555;
}

#helpdesk-customer .hd-row-state--open { color: #0a9a7b; font-weight: 700; }
#helpdesk-customer .hd-row-state--closed { color: #e74c3c; font-weight: 700; }

#helpdesk-customer .hd-view-btn {
  background: #fff;
  border: 1px solid #cfcfcf;
  color: #555;
  border-radius: 3px;
  padding: 8px 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#helpdesk-customer #hd-create-ticket {
  margin-top: 18px;
  display: none;
}

#helpdesk-customer #hd-create-ticket.is-open {
  display: block;
}

/* Chat view */
#helpdesk-customer .hd-chat-topbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

#helpdesk-customer .hd-close-ticket-btn {
  background: #9fd6ef;
  border: none;
  border-radius: 3px;
  padding: 10px 16px;
  font-weight: 700;
  color: #0f2b3a;
}

#helpdesk-customer .hd-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Ticket detail page header (status cards + optional profile) */
#helpdesk-customer .hd-ticket-detail-header {
  margin-bottom: 18px;
}

#helpdesk-customer .hd-ticket-detail-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

#helpdesk-customer .hd-ticket-detail-maincol {
  flex: 1 1 154px;
  min-width: 200px;
}

#helpdesk-customer .hd-ticket-detail-id {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28px;
  font-weight: 700;
  color: #111;
  margin: 0 0 18px;
  line-height: 1.15;
}

#helpdesk-customer .hd-ticket-profile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 280px;
}

#helpdesk-customer .hd-ticket-profile img {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  object-fit: cover;
  background: #e9eef3;
  border: 1px solid #e0e0e0;
}

#helpdesk-customer .hd-ticket-profile-name {
  font-size: 16px;
  font-weight: 700;
  color: #222;
}

#helpdesk-customer .hd-ticket-profile-email {
  font-size: 13px;
  color: #666;
}

#helpdesk-customer .hd-ticket-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 14px;
  background: #ef4444;
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
  border-radius: 3px;
  border: none;
}

#helpdesk-customer .hd-ticket-logout:hover {
  filter: brightness(1.05);
}

#helpdesk-customer .hd-ticket-stat-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  flex: 1 1 420px;
  justify-content: flex-end;
  align-items: stretch;
  padding-top: 6px;
  margin-top: 3%;
}

#helpdesk-customer .hd-ticket-detail-header--guest .hd-ticket-detail-header-inner {
  flex-direction: column;
  align-items: stretch;
}

#helpdesk-customer .hd-ticket-detail-header--guest .hd-ticket-detail-maincol {
  flex: none;
  width: 100%;
}

#helpdesk-customer .hd-ticket-detail-header--guest .hd-ticket-detail-id {
  margin-bottom: 12px;
}

#helpdesk-customer .hd-ticket-detail-header--guest .hd-ticket-stat-cards {
  justify-content: flex-start;
  flex: 1 1 100%;
  padding-top: 0;
}

#helpdesk-customer .hd-stat-card {
  width: 200px;
  min-height: 96px;
  border-radius: 4px;
  color: #fff;
  padding: 28px 14px 16px;
  position: relative;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

#helpdesk-customer .hd-stat-card .hd-stat-card-icon {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

#helpdesk-customer .hd-stat-card .hd-stat-card-label {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.95;
}

#helpdesk-customer .hd-stat-card .hd-stat-card-value {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  word-break: break-word;
}

#helpdesk-customer .hd-stat-card--status {
  background: #eab308;
}

#helpdesk-customer .hd-stat-card--status .hd-stat-card-icon {
  color: #eab308;
}

#helpdesk-customer .hd-stat-card--created {
  background: #14b8a6;
}

#helpdesk-customer .hd-stat-card--created .hd-stat-card-icon {
  color: #14b8a6;
}

#helpdesk-customer .hd-stat-card--activity {
  background: #ef4444;
}

#helpdesk-customer .hd-stat-card--activity .hd-stat-card-icon {
  color: #ef4444;
}

#helpdesk-customer .hd-message {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

/* Admin: avatar left, bubble right. Customer: same DOM (avatar, bubble) but row-reverse + flex-start packs cluster to the right. */
#helpdesk-customer .hd-message--customer {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

#helpdesk-customer .hd-message--admin {
  justify-content: flex-start;
  flex-direction: row;
}

#helpdesk-customer .hd-avatar {
  width: 54px;
  flex: 0 0 54px;
  text-align: left;
}

#helpdesk-customer .hd-avatar img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #e9eef3;
  border: 2px solid #f3f6f9;
}

#helpdesk-customer .hd-avatar .hd-avatar-name {
  font-size: 11px;
  color: #777;
  margin-top: 4px;
}

#helpdesk-customer .hd-bubble {
  max-width: 70%;
  padding: 14px 18px;
  border-radius: 3px;
  position: relative;
}

#helpdesk-customer .hd-message--customer .hd-bubble {
  background: #a8d7ef;
}

#helpdesk-customer .hd-message--admin .hd-bubble {
  background: #7fc6d2;
}

#helpdesk-customer .hd-bubble:after {
  content: '';
  position: absolute;
  top: 16px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

#helpdesk-customer .hd-message--customer .hd-bubble:after {
  right: -8px;
  border-left: 8px solid #a8d7ef;
}

#helpdesk-customer .hd-message--admin .hd-bubble:after {
  left: -8px;
  border-right: 8px solid #7fc6d2;
}

#helpdesk-customer .hd-bubble-text {
  margin: 0;
  color: #0f2b3a;
  font-size: 13px;
  line-height: 1.45;
}

#helpdesk-customer .hd-bubble-meta {
  margin-top: 8px;
  font-size: 11px;
  color: #3e6d7e;
}

#helpdesk-customer .hd-composer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #ececec;
}

#helpdesk-customer .hd-composer .form-control,
#helpdesk-customer textarea.form-control {
  width: 100%;
}

#helpdesk-customer #r_message {
  min-height: 105px;
}

#helpdesk-customer .hd-composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

#helpdesk-customer .hd-send-btn {
  background: #1a73e8;
  border-radius: 4px;
  padding: 10px 16px;
  border: none;
  color: #fff;
  font-weight: 700;
}

#helpdesk-customer .hd-back-dashboard-btn {
  background: #1a9a73;
  border-radius: 4px;
  padding: 10px 16px;
  border: none;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

/* List pagination */
#helpdesk-customer .hd-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px 0 6px;
  flex-wrap: wrap;
}

#helpdesk-customer .hd-page-btn {
  background: #fff;
  border: 1px solid #cfcfcf;
  color: #555;
  border-radius: 3px;
  padding: 7px 12px;
  font-weight: 700;
  cursor: pointer;
}

#helpdesk-customer .hd-page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#helpdesk-customer .hd-page-info {
  color: #666;
  font-weight: 700;
  font-size: 12px;
}

#helpdesk-customer .hd-page-ellipsis {
  padding: 0 4px;
  color: #666;
  font-weight: 700;
}

/* Responsive adjustments (mobile) */
@media (max-width: 768px) {
  #helpdesk-customer .hd-ticket-detail-header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  #helpdesk-customer .hd-ticket-stat-cards {
    justify-content: center;
    flex: 1 1 auto;
  }

  #helpdesk-customer .hd-stat-card {
    width: 100%;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }

  #helpdesk-customer .hd-dashboard-top {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 16px 14px;
  }

  #helpdesk-customer .hd-dashboard-top--no-avatar {
    justify-content: center;
  }

  #helpdesk-customer .hd-account-avatar {
    flex: 0 0 auto;
    width: 90px;
    padding: 12px 10px;
  }

  #helpdesk-customer .hd-account-avatar img {
    width: 68px;
    height: 68px;
  }

  #helpdesk-customer .hd-tiles-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    width: 100%;
  }

  #helpdesk-customer .hd-tiles-row--page {
    flex-wrap: wrap;
    gap: 14px;
  }

  #helpdesk-customer .hd-tile {
    width: calc(33.333% - 10px);
    min-width: 140px;
    height: 90px;
  }

  #helpdesk-customer .hd-tiles-carousel {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  #helpdesk-customer .hd-tiles-row {
    gap: 12px;
  }

  #helpdesk-customer .hd-tile {
    width: 100%;
    min-width: 0;
    height: 92px;
  }
}

