.happy-tag {
  color: var(--happy-tag-color);
  background-color: var(--happy-tag-bg);
}

.happy-user-country-flag {
  display: inline-block;
  width: 20px;
  height: 15px;
  object-fit: cover;
  vertical-align: middle;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

#helpdesk-settings-form {
  span {
    &.ViSelect2-selection {
      &.ViSelect2-selection--single {
        min-height: 40px;
        border: 1px solid rgba(34, 36, 38, .15);
      }
    }

  }
}

.happy_wrap_admin_page {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;

  .happy_tickets_list {
    flex: 1 1 100%;
    min-width: 0;

    &.happy_individual_ticket {
      flex: 1 1 calc(100% - 300px);
      max-width: calc(100% - 300px);
    }
  }

  .happy_sidebar_info_wrap {
    flex: 0 0 280px;
    width: 280px;

    .happy_sidebar_info_content {
      border: none;
      box-shadow: 0 0 3px 0 #a4b0be;
      border-radius: 5px;
      padding: 15px;
      box-sizing: border-box;
      background-color: #fff;
      margin-bottom: 20px;

      .happy-ticket-tools {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;

        .happy-field-group {
          width: 100%;
          display: flex;
          flex-direction: column;
          margin-bottom: 20px;
        }

        .happy-ticket-tools-actions {
          display: flex;
          flex-wrap: wrap;
          align-items: center;
          gap: 8px;

          .button,
          .happy-button {
            margin: 0;
          }
        }
      }
    }
  }
}

#happy_list_tickets {
  tbody {
    tr {
      cursor: pointer;
    }
  }

  .column-id {
    width: 60px;
  }
}

#happy-admin-list-ticket {
  table-layout: fixed;

  th,
  td {
    vertical-align: middle;

    &.hidden {
      display: none !important;
    }
  }

  .check-column {
    width: 2.5em;
    padding-left: 0;
    padding-right: 0;
    text-align: center;
    vertical-align: middle;

    input[type="checkbox"] {
      margin: 0;
      float: none;
      vertical-align: middle;
    }
  }

  .column-id {
    width: 52px;
    text-align: center;
    vertical-align: middle;
  }

  .column-status {
    width: 72px;
  }

  .column-ticket {
    width: 30%;
    overflow: visible;

    .row-actions {
      padding-top: 4px;
    }

    .row-actions .delete a {
      color: #b32d2e;
    }
  }
}

.happy-tickets-list-form {
  .tablenav.top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    height: auto;
    min-height: 30px;
    overflow: visible;
    margin-bottom: 10px;
    padding-top: 0;

    .alignleft,
    .bulkactions,
    .actions {
      float: none;
      display: inline-flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      margin: 0;
      padding: 0;
      height: auto;
      overflow: visible;
    }

    .tablenav-pages {
      float: none;
      margin-left: auto;
    }

    select,
    .button {
      margin: 0;
      vertical-align: middle;
    }
  }
}

.bulkactions {
  .happy-bulk-assign-wrap,
  .happy-bulk-categories-wrap {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin: 0;
    min-width: 240px;
    max-width: 280px;
    position: relative;
    z-index: 5;

    &[hidden] {
      display: none !important;
    }

    .ViSelect2-container {
      width: 260px !important;
      max-width: 100%;
      vertical-align: middle;

      .ViSelect2-selection--multiple {
        min-height: 30px;
        border: 1px solid #8c8f94;
        border-radius: 4px;
        background: #fff;
      }
    }
  }
}

body > .ViSelect2-container {
  z-index: 100100;
}

#happy-threads.happy-admin-ticket-detail {
  width: 100%;

  .happy-wrap-list-tickets {
    width: 100%;
  }

  .happy-replies-container {
    width: 100%;
    border-radius: 8px;
  }

  .happy-replies-body {
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .happy-replies-wrap-list-items {
    display: block;
    width: 100%;
  }

  .happy-reply-item {
    display: block;
    margin: 0 0 24px;
    width: 90%;
    max-width: 90%;
    box-sizing: border-box;

    &.happy-reply-from-customer {
      margin-left: 0;
      margin-right: 10%;
      border: 1px solid #dde2e6;
      border-radius: 8px;
      overflow: hidden;

      .happy-reply-content {
        border-color: #dde2e6;
      }
    }

    &.happy-reply-from-supporter {
      margin-left: 10%;
      margin-right: 0;
      border: 1px solid #87ceeb;
      border-radius: 8px;
      overflow: hidden;

      .happy-reply-content {
        border-color: #87ceeb;
      }
    }

    .happy-reply-header {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      font-size: 14px;
      line-height: 1.43;
      background: #e6e6e6;
      color: #424d57;
      padding: 12px;
      border-radius: 8px 8px 0 0;

      .happy-reply-info {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;

        .happy-author-name {
          display: inline-flex;
          align-items: center;
          gap: 6px;
        }
      }

      .happy-author-role {
        padding: 3px 8px;
        font-size: 11px;
        background-color: #10c810;
        color: #fff;
        border-radius: 10px;
      }

      .happy-meta {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
      }

      .happy-reply-actions {
        display: flex;
        align-items: center;
        gap: 8px;
      }
    }

    .happy-reply-content {
      display: block;
      font-size: 15px;
      line-height: 1.5;
      padding: 12px 16px;
      border: 1px solid #dde2e6;
      border-top: 0;
      border-radius: 0 0 8px 8px;
      overflow: auto;
      overflow-wrap: anywhere;
      word-break: break-word;
      white-space: normal;
      color: #424d57;
      background: #fff;

      .happy-reply-message,
      .happy-reply-body {
        display: block;
        width: 100%;
      }

      .happy-reply-body {
        p, div, ul, ol, pre, blockquote {
          display: block;
          margin: 0 0 0.75em;
          max-width: 100%;
        }

        p:last-child,
        div:last-child {
          margin-bottom: 0;
        }

        img {
          max-width: 100%;
          height: auto;
        }

        blockquote,
        blockquote.happy-reply-quote {
          font-size: 90%;
          margin: 0.5em 0;
          padding-left: 1em;
          border-left: 3px solid #ccc;
        }

        a {
          color: #2271b1;
        }
      }

      .happy-reply-attachments {
        border-top: 1px solid #dde2e6;
        margin-top: 12px;
        padding-top: 12px;

        h6 {
          margin: 0 0 10px;
          font-size: 14px;
          font-weight: 600;
        }

        .happy-list-attachments {
          display: flex;
          flex-wrap: wrap;
          gap: 10px;
          margin: 0;
          padding: 0;
          list-style: none;

          li {
            margin: 0;
            list-style: none;
          }

          img {
            max-width: 120px;
            height: auto;
            display: block;
            border: 1px solid #dde2e6;
            border-radius: 4px;
          }
        }

        .wp-caption-text {
          margin: 4px 0 0;
          font-size: 12px;
        }
      }
    }
  }
}

.happy-wrap-reply-form {
  background: #fbfbfb;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 2px;

  .happy-button {
    margin: 1em 0 0 0;
  }
  .happy-wrap-attachments {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-direction: column;
    margin-top: 10px;

    .happy-attachments-form {
      width: 100%;
      display: flex;
      flex-wrap: wrap;

      .happy-wrap-btn-attachment {
        width: 100%;

        .happy_upload_button {
          margin: 0;
          font-size: 15px !important;
          padding: 10px 16px !important;
          line-height: 1;
          text-transform: none;
          height: auto;
          min-height: auto;
          outline: none;
          color: #ffffff;
          border: 1px solid #4384f5;
          background-color: #4384f5;
        }
      }

      .happy-wrap-btn-attachment-url-field {
        display: flex;
        flex-wrap: wrap;
        width: 100%;

        .happy-attachment-url-field {
          display: flex;
          width: 100%;
          align-items: center;
          margin: 5px 0;

          .happy-attachment-url-field-item {
            display: flex;
            width: 100%;
            align-items: center;
            border: 1px solid #bcc6d0;
            border-radius: 6px;

            label {
              background-color: #e5e5e5;
              width: 100px;
              display: flex;
              align-items: center;
              justify-content: center;
              text-align: center;
              height: 40px;
              border-radius: 6px 0 0 6px;
              margin: 0;
            }

            .happy_attachments_url {
              flex: 1 0 auto;
              padding: 10px;
              border: none !important;
              border-radius: 0 6px 6px 0;
              transition: background-color 0.2s ease 0s;
              background-color: #ffffff;
              height: 40px;
              outline: none !important;
              width: auto;
            }

            .happy-add-more-url {
              font-size: 35px;
              padding: 5px 10px;
              height: 40px;
              border-radius: 0 6px 6px 0;
              display: flex;
              align-items: center;
              justify-content: center;
              cursor: pointer;
              color: #ffffff;
              background-color: #4384f5;
              opacity: 0;
              visibility: hidden;

              &.happy-show {
                opacity: 1;
                visibility: visible;
              }
            }
          }


          .happy-delete-url {
            font-size: 21px;
            padding: 5px 10px;
            color: red;
            //border: solid 2px #2dcf2d;
            margin-left: 10px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            opacity: 0;
            visibility: hidden;

            &.happy-show {
              opacity: 1;
              visibility: visible;
            }
          }


        }

        .wrap-attachment-error {
          width: 100%;
          color: #f20b0b;
          font-size: 15px;
          margin: -10px 0 5px 0;

        }
      }
    }
  }
  .happy-submit-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;

    .happy-canned-wrapper {
      .happy-choose-canned {
        border: 1px solid #bcc6d0;
        border-radius: 6px;
        transition: background-color 0.2s ease 0s;
        background-color: #ffffff;
        height: 37px;
        outline: none;
      }

      .happy-canned-list {
        display: none;
      }
    }

    .happy-submit-reply {
      color: #ffffff;
      border: 1px solid #4384f5;
      background-color: #4384f5;
      margin: 0;
      font-size: 15px !important;
      padding: 10px 16px !important;
      line-height: 1;
      text-transform: none;
      height: auto;
      min-height: auto;

      &.happy-disabled {
        opacity: 0.5;
        cursor: no-drop;
      }
    }
  }

  .happy-form-error-wraps {
    color: #f20b0b;
    font-size: 15px;
  }
}

.happy-selected-attachments-container {
  display: flex;
  flex-wrap: wrap;

  .happy-selected-image {
    width: 30%;
    max-width: 128px;
    margin-bottom: 10px;
  }
}

#happy_list_tickets_filter {
  display: flex;

  & > label {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0 10px;
    font-weight: bold;

    input {
      height: 30px;
      border: 1px solid #3b3b3b;
    }
  }

  .happy-wrap-filter {
    .filters-group {
      padding: 0 10px;
      flex: 0 0 50%;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
    }
  }
}

.happy-edit-reply-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #eef5ff;
  border: 1px solid #4384f5;
  border-radius: 4px;
  color: #1d2327;
  font-size: 13px;

  .happy-cancel-edit-reply {
    margin-left: 8px;
    color: #b32d2e;
    text-decoration: underline;
  }
}

.happy-modal-overlay {
  position: fixed;
  opacity: 1;
  z-index: 999999999;
  overflow: visible;
  background-color: rgb(0 0 0 / 45%);
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: none;

  &.happy-active {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .happy-wrap-modal-content {
    max-width: 550px;
    width: 100%;
    background-color: #ffffff;
    border-radius: 6px;
    padding: 10px;
    position: relative;

    .happy-close-modal {
      position: absolute;
      top: -18px;
      right: -18px;
      width: 36px;
      height: 36px;
      cursor: pointer;
      z-index: 8040;
      background-image: url("../images/icon_sprite.png");
    }

    .happy-wrap-modal-form {
      display: none;

      &.happy-active {
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }

    .happy-wrap-modal-loading {
      display: none;
      text-align: center;
      font-weight: 700;
      font-size: 18px;

      &.happy-active {
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }

  }
}
