.igd-proof-selections {
  width: calc(100% + 20px);
  margin-left: -20px;
  font-size: 15px;
  box-sizing: border-box;

  * {
    box-sizing: border-box;
  }

  &-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: #fff;
    padding: 10px 15px;
    border-bottom: 1px solid #E5E5E5;
    z-index: 99;
    position: sticky;
    top: 32px;

    .header-title {
      display: flex;
      flex-direction: column;

      &-wrap {
        display: flex;
        align-items: center;
        margin-right: auto;

        .header-icon {
          margin-right: 7px;
          width: 40px;
          height: 40px;
          border-radius: 50%;
          background: $igd_color;
          display: flex;
          align-items: center;
          justify-content: center;

          img {
            width: 22px;
            height: 22px;
            cursor: pointer;
          }

        }

        .igd-btn {

        }

      }

      h2 {
        margin: 0;
        font-size: 20px;
      }

      p {
        margin: 5px 0 0;
      }


    }

    .module-title-wrap {
      margin-left: auto;
      margin-right: 15px;

      .module-title-text {
        color: $igd_color;
        font-weight: 500;
        text-decoration: none;
        padding: 5px 3px;
        font-size: 15px;
      }

    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 10px;

      button {
        background: #EFEFEF;
        color: #555;
        border: none;
        border-radius: 5px;
        padding: 8px 12px;
        font-size: 1em;
        display: flex;
        align-items: center;
        cursor: pointer;
        transition: background .3s ease-in-out;
        gap: 5px;


      }
    }

    @media (max-width: 767px) {
      margin-left: -10px;
      margin-right: -10px;
      padding: 10px;
      top: -50px;

      .header-title {

        img {
          width: 30px;
          margin-right: 5px;
        }

        label {
          font-size: 1em;
        }

        .shortcode-title {
          height: 35px;
          min-height: unset;
          margin-left: auto;
          border-radius: 5px;
          color: #555;
          font-size: 14px;
          font-weight: 400;
          width: 150px;
        }

      }

      .header-actions {

        .add-new-btn {
          margin-left: auto;
        }

        button {
          overflow: hidden;
          padding: 7px;
          font-size: .8em;
          margin-left: 10px;
          height: 35px;

          &:first-child {
            margin-left: 0;
          }

          i {
            margin-right: 3px;
          }

          span {
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
          }
        }

      }

      &:has(.btn-back) {
        .header-title {

          img, label {
            display: none;
          }

        }

        .header-actions {
          justify-content: center;

          .shortcode-wrap {
            width: 90px;
            height: 35px;

            code {
              height: 35px;
              padding-top: 7px;
            }
          }

        }

      }

    }
  }

  &-content {
    display: flex;
    align-items: flex-start;
    padding: 20px;
  }

  &-sidebar {
    width: 300px;

    .filter-wrap {
      display: flex;
      flex-direction: column;

      .filter-title {
        margin: 0 0 15px 0;
        font-size: 1.1rem;
      }

      .filter-section {
        margin-bottom: 15px;
        border: 1px solid #E5E5E5;
        border-radius: 5px;
        background: #fff;
        padding: 15px;

        label {
          line-height: normal;
          font-size: .9rem;
          color: #555;
        }

        input[type="checkbox"] {
          margin-right: 7px;
          margin-top: 0;
        }

        &-title {
          margin: 0 0 5px 0;
          color: #444;
          display: flex;
          align-items: center;
          font-weight: 500;
          height: 30px;

          .clear-filters-btn {
            margin-left: auto;
            font-size: .8rem;
            cursor: pointer;
            font-weight: 400;
            color: rgba(0, 0, 0, 0.6);
            border: 1px solid #ccc;
            padding: 3px 7px;
            border-radius: 30px;
            background: #f5f5f5;
            transition: color .3s ease-in-out;
            height: 30px;
            gap: 0;
            margin-right: 7px;

            &:hover {
              color: #000;
              background: #e5e5e5;
            }

          }

        }

        &-items {
          display: flex;
          flex-direction: column;

          .filter-item {
            display: flex;
            align-items: center;
            padding: 5px 0;

            label {
              flex: 1;
              display: flex;
              align-items: center;
              cursor: pointer;
              font-size: .9rem;
              color: #555;
              border-radius: 5px;
              transition: all .3s ease-in-out;
              overflow: hidden;
              line-height: 1;

              i {
                &.dashicons-tag {
                  margin-right: 5px;
                }
              }

              .item-user {
                display: flex;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
                align-items: center;

                .user-image {
                  width: 22px;
                  border-radius: 3px;
                  margin-right: 5px;
                }

                .user-name {
                  font-size: .9rem;
                  color: #555;
                }

                .user-email {
                  font-size: .8rem;
                  color: #999;
                  overflow: hidden;
                  text-overflow: ellipsis;
                  white-space: nowrap;
                  margin-left: 3px;
                }

              }

            }

            &-name {
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
              max-width: 90%;
            }

            &-count {
              margin-left: auto;
              font-size: .9rem;
              color: #999;
            }

            &-actions {
              display: flex;
              align-items: center;
              gap: 10px;
              margin-top: 5px;

              i {
                transition: all 0.3s ease-in-out;
                cursor: pointer;
              }

              .action-separator {
                color: #999;
                border-right: 1px solid #ccc;
                height: 15px;
              }

              .components-button {
                padding: 0;
                height: auto;
                min-width: auto;
              }

              .dashicons-visibility {
                color: #3B82F6;

                &:hover {
                  color: #2563EB;
                  transform: scale(1.1);
                }
              }

              .dashicons-info {
                color: #4F46E5;

                &:hover {
                  color: #4338CA; // indigo-700 for hover
                  transform: scale(1.1);
                }
              }

              .dashicons-trash {
                color: #EF4444;

                &:hover {
                  color: #DC2626;
                  transform: scale(1.1);
                }
              }

              .dashicons-download {
                color: #3B82F6;

                &:hover {
                  color: #2563EB; // modern blue-600 for hover
                  transform: scale(1.1);
                }
              }

            }

            &:hover {
              background: #F9F9F9;
            }

          }

          .no-items {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            font-size: .9rem;
            color: #999;
            text-align: center;

            i {
              margin-right: 5px;
              color: #FF9458;
            }
          }

        }

        .igd-selection-details {
          color: #555;
          font-size: .9rem;

          a {
            padding: 0;
            color: #2271b1;
            text-decoration: none;
            height: auto;

            &:hover {
              color: #135e96;
              text-decoration: underline;
            }

          }
        }

      }

    }

  }

  &-body {
    flex: 1;
    margin-left: 20px;
    padding: 20px;
    background: #F9F9F9;
    border-radius: 7px;
    overflow: hidden;
    position: relative;

    .body-header {
      color: #444;
      font-weight: 500;
      border-bottom: 1px solid #E5E5E5;
      padding-bottom: 10px;
      margin: 0 0 15px 0;
      display: flex;
      align-items: center;

      .body-title {
        font-size: 1.1rem;
        margin: 0;
      }

      .body-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-left: auto;

        button {
          color: #555;
          background: #EFEFEF;
          padding: 5px 8px;

          &:hover {
            background: var(--color-primary-lighter);
          }

          i {
            margin-right: 0;
          }

        }

      }

    }

    .selections-list {
      display: flex;
      flex-wrap: wrap;

      &.igd-item-col-1 {
        .selection-item {
          width: 100%;
        }

        &:not(.list-view) {
          .selection-item {
            margin: 4px;
          }
        }

      }

      &.igd-item-col-2 {
        .selection-item {
          width: calc(50% - 14px);
        }
      }

      &.igd-item-col-3 {
        .selection-item {
          width: calc(33.33% - 14px);

          .selection-item-footer {
            .selection-item-size {
              display: none;
            }
          }

        }
      }

      &.igd-item-col-4 {
        .selection-item {
          width: calc(25% - 14px);
        }
      }

      &.igd-item-col-5 {
        .selection-item {
          width: calc(20% - 14px);
        }
      }

      &.igd-item-col-6 {
        .selection-item {
          width: calc(16.66% - 14px);
        }
      }

      &.igd-item-col-7 {
        .selection-item {
          width: calc(14.28% - 14px);
        }
      }

      &.igd-item-col-8 {
        .selection-item {
          width: calc(12.5% - 14px);
        }
      }

      /* Prevent text selection while dragging */
      .igd-noselect, .igd-noselect * {
        user-select: none !important;
      }

      /* Selection rectangle */
      .igd-selection-rect {
        position: absolute;
        border: 1px solid #2684ff;
        background-color: rgba(38, 132, 255, 0.2);
        pointer-events: none;
        z-index: 1000;
        display: none;
        border-radius: 4px;
      }

      /* Prevent text selection while dragging */
      .igd-noselect {
        user-select: none !important;
        -webkit-user-select: none !important;
        -moz-user-select: none !important;
      }


    }

    .selection-item {
      display: flex;
      border: 1px solid #eee;
      border-radius: 8px;
      background: #fff;
      position: relative;
      width: calc(20% - 8px);
      flex-direction: column;
      box-sizing: border-box;
      overflow: hidden;
      user-select: none;
      margin: 7px;

      &-details {
        flex: 1;
        display: flex;
        align-items: center;
        text-align: center;
        flex-wrap: wrap;
        padding: 10px;
        transition: all .3s ease-in-out;
        cursor: pointer;
        border-top: 1px solid #E5E5E5;
        background: #fff;

        h4 {
          margin: 0;
          font-size: .875rem;
          color: #333;
          font-weight: 500;
          line-height: 1.2;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          max-width: calc(100% - 30px);
          user-select: auto;
        }

        .description {
          font-size: 12px;
          color: #666;
          margin-top: 5px;
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
        }


      }

      &-thumbnail {
        height: 150px;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          -webkit-user-drag: none;
        }
      }

      &-tag {
        position: absolute;
        top: 10px;
        right: 10px;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        line-height: normal;
        display: inline-flex;
        align-items: center;

        i {
          margin-right: 3px;
          color: #fff;
          font-size: 18px;
          height: 18px;
          width: 18px;
        }

      }

      .selection-item-checkbox {
        margin-right: 7px;
        width: 18px;
        height: 18px;
        border-radius: 4px;
        background: #fff;
        border: 1px solid #ccc;
        cursor: pointer;
        z-index: 2;

        display: flex;
        align-items: center;
        justify-content: center;

        transition: background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;

        /* Check mark */
        &::after {
          content: "";
          width: 5px;
          height: 9px;
          border: solid #fff;
          border-width: 0 2px 2px 0;
          transform: rotate(45deg) scale(0);
          transform-origin: center;
          transition: transform 0.15s ease;
          margin-top: -5px;
        }

        /* Hover */
        &:hover {
          border-color: var(--color-primary);
        }

        /* Active (click feedback) */
        &:active {
          transform: scale(0.92);
        }

        /* Checked state */
        &.checked {
          background: var(--color-primary);
          border-color: var(--color-primary);

          &::after {
            transform: rotate(45deg) scale(1);
          }
        }

        /* Optional: focus-visible support if you later add tabindex */
        &:focus-visible {
          outline: none;
          box-shadow: 0 0 0 2px rgba(79, 90, 186, 0.35);
        }
      }

      &.active {
        border: 1px solid var(--color-primary);
        box-shadow: 0 0 15px rgba(0, 0, 0, .2);

        .selection-item-details {
          background: var(--color-primary-lighter);
        }
      }

      &:hover {
        box-shadow: 0 0 15px rgba(0, 0, 0, .1);

        .selection-item-details {
          background: #F9F9F9;
          box-shadow: 0 0 15px rgba(0, 0, 0, .2);
        }
      }

    }

    .selections-list {
      &.list-view {

        .selection-item {
          width: 100%;
          flex-direction: row;
          border-radius: 0;
          margin: 0 0 5px 0;

          &-thumbnail {
            height: 50px;
            width: 50px;
            margin-left: 40px;
          }

          &-details {
            flex-direction: row;
            justify-content: flex-start;
            border: 0;
          }

          &-checkbox {
            position: absolute;
            left: 10px;
          }

          &-tag {
            position: unset;
            margin-left: auto;
          }

        }
      }
    }

  }

}

.igd-swal.igd-selection-info {

  .igd-selection-details {
    .user-email {
      font-size: 14px;
      color: #666;
    }
  }

  .swal2-title {
    margin-top: 15px;
  }


}

/* ------------------------------------
 * Proof Selections – List View
 * ---------------------------------- */
.igd-proof-selections-list {
  background: #fff;
  padding: 20px;
  min-height: calc(100vh - 63px);
  position: relative;

  /* -----------------------------
   * Filters
   * --------------------------- */
  .filters-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0 30px;

    .list-title-wrap {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;

      .selection-actions-wrap {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        padding: 7px 7px;
        background: #fff;
        border: 1px solid rgba(0, 0, 0, .08);
        border-radius: 30px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .05);

        .selection-left {
          display: flex;
          align-items: center;
          gap: 8px;
        }

        .selection-badge {
          background: $igd_color;
          color: #fff;
          font-size: 12px;
          font-weight: 600;
          padding: 4px 8px;
          border-radius: 20px;
          min-width: 28px;
          text-align: center;
        }

        .selection-text {
          font-size: 13px;
          color: #555;
        }

        .igd-clear-btn {
          background: rgba(0, 0, 0, 0.04);
          border: 1px solid rgba(0, 0, 0, 0.08);
          color: #555;
          font-size: 13px;
          padding: 5px 10px;
          border-radius: 16px;
          cursor: pointer;
          line-height: 1;
          height: 30px;

          &:hover {
            background: rgba(0, 0, 0, 0.08);
            color: #000;
          }
        }

        .selection-right {
          display: flex;
          gap: 8px;

          .igd-btn {
            height: 34px;
            font-size: 13px;
            padding: 0 12px;
          }

          .btn-danger {
            margin-left: 6px;
          }
        }

        .igd-btn {
          border-radius: 30px;
        }

      }
    }

    .list-title {
      font-size: 18px;
      font-weight: 500;
      color: rgba(0, 0, 0, 0.75);
      margin: 0;

      .list-count {
        font-size: 15px;
        font-weight: 400;
        color: #777;
        margin-left: 7px;
      }

    }

    .filter-item {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 7px;

      h4 {
        margin: 0;
        font-size: 13px;
        font-weight: 500;
        color: rgba(0, 0, 0, 0.7);
      }

      .igd-select {
        font-size: 13px;
        width: 200px;

        .igd-select__control {
          height: 40px;
          border-color: #ccd0d4;
        }
      }

      .components-select-control {
        width: 80px;

        .components-select-control__input {
          height: 40px;
        }

        .components-input-control__backdrop {
          border-radius: 30px;
          border: 1px solid #ccd0d4;
        }

      }

    }

    .filter-module {
      margin-left: auto;

      .igd-select {
        width: 250px;
      }
    }

    .filter-date {
      display: flex;
      align-items: center;
      gap: 6px;
      height: 40px;
      padding: 0 14px;
      margin-left: 30px;

      i {
        opacity: 0.7;
      }
    }
  }

  /* -----------------------------
   * Tooltip / Date Picker
   * --------------------------- */
  .statistics-tooltip-wrap {
    padding: 10px;

    .statistics-filter {
      .filter-options {
        .rdrDateRangePickerWrapper {
          font-size: 13px;
        }
      }
    }
  }

  /* -----------------------------
   * Table
   * --------------------------- */
  .igd-proof-selections-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;

    thead {
      background: #f6f7f7;

      th {
        padding: 12px 14px;
        font-size: 12px;
        font-weight: 600;
        text-align: left;
        color: #1d2327;
        border-bottom: 1px solid #e2e4e7;
        white-space: nowrap;

        &.col-id {
          width: 60px;
          text-align: center !important;
        }

      }
    }

    tbody {
      tr {
        transition: background-color 0.15s ease;

        &:hover {
          background: #f8f9fa;
        }
      }

      td {
        padding: 12px 14px;
        font-size: 13px;
        color: #1d2327;
        vertical-align: middle;
        border-bottom: 1px solid #f0f0f1;

        &:last-child {
          text-align: right;
        }

        &.col-id {
          button {
            font-weight: 500;
            color: $igd_color;
            font-size: 13px;
            cursor: pointer;
            transition: color 0.15s ease, border-color 0.15s ease;
            border-radius: 7px;
            padding: 0;

            &:hover {
              color: darken($igd_color, 10%);
              border-color: darken($igd_color, 10%);
            }
          }
        }

        .btn-view-submission {
          color: rgba(0, 0, 0, 0.6);
          text-decoration: none;
          font-size: 13px;
          padding: 6px 10px;
          border: 1px solid #ccc;
          border-radius: 30px;
          background: #fff;

          &:hover {
            background: $igd_color;
            border-color: #bbb;
            color: #FFF;
          }

        }

      }
    }

    .col-selection {
      width: 35px;
      text-align: center;
      padding-right: 0;
      padding-left: 15px;
    }

    .components-base-control__field {
      margin-bottom: 0;
      display: flex;
      align-items: center;

      .components-checkbox-control__input {
        border-color: rgba(#5c637e, 0.5);
        margin: 0;

        &-container {
          margin: 0;
        }

        &:checked {
          background: $igd_color_light;
          border-color: $igd_color_light;
        }

      }
    }
  }

  .empty-submissions {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #646970;
    font-size: 14px;
    flex-direction: column;
    text-align: center;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #ddd;
    width: 500px;
    max-width: 100%;
    margin: 40px auto;

    h5 {
      margin: 10px;
      font-size: 18px;
    }

    img {
      width: 200px;
      margin-bottom: 15px;
    }

    p {
      margin: 0;
    }

    .igd-btn {
      margin-top: 20px;
    }
  }

  /* -----------------------------
   * Buttons inside table
   * --------------------------- */
  .module-title-text,
  .user-text,
  .page-text {
    padding: 0;
    font-size: 13px;
    color: #2271b1;
    text-decoration: none;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;

    .user-image {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      object-fit: cover;
      border: 1px solid #ddd;
    }

    &:hover {
      color: #135e96;
      text-decoration: underline;
    }
  }

  .page-text {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* -----------------------------
   * Status Label
   * --------------------------- */
  .status-label {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;

    &.status-read {
      background: rgba(70, 180, 80, 0.15);
      color: #2e7d32;
    }

    &.status-unread {
      background: rgba(220, 50, 50, 0.12);
      color: #b32d2e;
    }
  }

  /* -----------------------------
   * Empty State
   * --------------------------- */
  tbody tr td[colspan] {
    text-align: center !important;
    padding: 40px 20px;
    color: #646970;
    font-size: 14px;
  }

  .igd-pro-modal-wrap {
    position: absolute;
    z-index: 9;

    .igd-pro-modal {
      &-close {
        display: none;
      }
    }

  }

  /* -----------------------------
   * Responsive
   * --------------------------- */
  @media (max-width: 1024px) {
    .filters-wrap {
      flex-direction: column;
    }

    .igd-proof-selections-table {
      font-size: 12px;

      thead {
        display: none;
      }

      tbody tr {
        display: block;
        border-bottom: 1px solid #e2e4e7;
        padding: 10px 0;
      }

      tbody td {
        display: flex;
        justify-content: space-between;
        padding: 6px 14px;
        border-bottom: none;

        &:before {
          content: attr(data-label);
          font-weight: 600;
          color: #646970;
        }
      }
    }
  }
}

.igd-proof-selections-pagination {
  margin-top: 40px;

  .igd-pagination {
    justify-content: center;
  }
}


