smart-sort-panel,
smart-column-panel,
smart-multi-column-filter-panel,
smart-colors-panel,
smart-grid-ai-panel,
smart-formatting-panel {
  display: block;
  min-width: 345px;
  width: var(--smart-grid-panel-default-width);
  height: var(--smart-grid-panel-default-height);
  padding: var(--smart-grid-panel-padding);
  overflow: auto;
  background: var(--smart-background);
  color: var(--smart-background-color);
  font-family: var(--smart-font-family);
  font-size: var(--smart-font-size);
}

smart-colors-panel {
  .tabs {
    width: 100%;
    height: 30px;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    margin-bottom: 5px;

    .tab {
      width: 50%;
      width: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      text-transform: uppercase;
      color: var(--smart-background-color);
      cursor: pointer;

      label {
        cursor: pointer;
      }

      &.active {
        color: var(--smart-primary);
        border-bottom: 2px solid var(--smart-primary);
        font-weight: bold;
      }
    }
  }
}

smart-group-panel {
  display: block;
  min-width: 345px;
  height: var(--smart-grid-panel-default-height);
  padding: var(--smart-grid-panel-padding);
  overflow: auto;
  background: var(--smart-background);
  color: var(--smart-background-color);
  font-family: var(--smart-font-family);
  font-size: var(--smart-font-size);
  width: var(--smart-grid-panel-default-width);

  &.smart-mobile {
    width: 345px;
  }
}

.smart-view-panel {
  display: block;
  background: var(--smart-background);
  color: var(--smart-background-color);
  font-family: var(--smart-font-family);
  font-size: var(--smart-font-size);
  min-height: 400px;
  height: 400px;
  max-height: 450px;
  width: 250px;
  padding: 0;
  overflow: hidden;

  smart-list-box input {
    border: none;
    border-radius: 0px;
    border-bottom: 2px solid var(--smart-border);
  }
}

.smart-sort-panel,
.smart-group-panel {
  .smart-grid-panel-item.dragged {
    opacity: 0.7;
  }

  .smart-grid-panel-label-by {
    padding: 5px;
    width: 60px;
    flex-grow: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .smart-grid-panel-field-container {
    height: 100%;
    width: 100px;
    flex-grow: 3;
  }

  .smart-grid-panel-field-selection {
    height: 100%;
    width: 100%;
  }

  .smart-grid-panel-from {
    display: flex;
    justify-content: center;
    padding: 5px;
    width: 40px;
    flex-grow: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .smart-grid-panel-direction {
    display: flex;
    width: 115px;
    flex-grow: 2;
    height: 100%;
    background-color: var(--smart-surface);
    border-top-right-radius: var(--smart-border-top-right-radius);
    border-top-left-radius: var(--smart-border-top-left-radius);
    border-bottom-left-radius: var(--smart-border-bottom-left-radius);
    border-bottom-right-radius: var(--smart-border-bottom-right-radius);

    &:focus {
      outline: none;
      box-shadow: 0 0 0 1px var(--smart-primary);
    }

    >div {
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 3px;
      width: calc(50% - 6px);
      height: calc(100% - 6px);
      border-top-right-radius: var(--smart-border-top-right-radius);
      border-top-left-radius: var(--smart-border-top-left-radius);
      border-bottom-left-radius: var(--smart-border-bottom-left-radius);
      border-bottom-right-radius: var(--smart-border-bottom-right-radius);

      &.selected {
        background-color: var(--smart-primary);
        color: var(--smart-primary-color);
      }
    }
  }
}

.smart-sort-panel {
  &.smart-mobile {
    smart-input {
      max-width: 150px;
    }
  }

  .smart-grid-panel-maintain-sort {
    justify-content: flex-end;
    margin-top: 5px;
  }

  .smart-grid-panel-buttons-container {
    align-items: flex-start !important;
  }

  .smart-grid-panel-maintain-sort-button {
    font-family: var(--smart-font-family);
    font-size: var(--smart-font-size);

    &::before {
      font-family: var(--smart-font-family-icon);
      content: var(--smart-icon-check-empty);
      margin-right: 5px;
    }

    &[active] {
      color: var(--smart-primary);

      &::before {
        font-family: var(--smart-font-family-icon);
        content: var(--smart-icon-check-squared);
      }
    }
  }
}

.smart-view-panel,
.smart-sort-panel,
.smart-group-panel,
.smart-colors-panel,
.smart-grid-ai-panel,
.smart-multi-column-filter-panel {
  .smart-grid-panel-item-close-button {
    display: flex;
    justify-content: center;
    width: 20px;

    &:after {
      content: var(--smart-icon-close);
      font-family: var(--smart-font-family-icon);

      @media (pointer: coarse) {
        font-size: 16px;
      }
    }

    &:hover {
      color: var(--smart-ui-state-color-selected);
      background: var(--smart-ui-state-selected);
      border-color: var(--smart-ui-state-selected);
      cursor: pointer;
    }

    &:active,
    &:focus {
      color: var(--smart-primary);
    }

    &:focus {
      outline: none;
    }
  }

  .smart-grid-panel-item {
    display: flex;
    align-items: center;
    margin-top: calc(var(--smart-grid-panel-vertical-offset) / 2);
    margin-bottom: calc(var(--smart-grid-panel-vertical-offset) / 2);
    width: calc(100% - var(--smart-sortable-handle-size));
    height: var(--smart-grid-panel-item-height);
    min-height: var(--smart-grid-panel-item-height);
    background-color: var(--smart-background);
  }

  &[close-button-position="right"] {
    .smart-grid-panel-item-close-button {
      order: 1;
    }

    .smart-sortable-container {
      align-items: flex-end;
    }
  }
}

.smart-sort-panel,
.smart-group-panel,
.smart-column-panel,
.smart-colors-panel,
.smart-grid-ai-panel,
.smart-multi-column-filter-panel {
  .smart-grid-panel-container-footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }

  .smart-grid-panel-buttons-container {
    width: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;

    span {
      display: flex;
      align-items: center;
      padding: 5px;

      &:hover {
        color: var(--smart-ui-state-color-selected);
        background: var(--smart-ui-state-selected);
        border-color: var(--smart-ui-state-selected);
        cursor: pointer;
      }

      &:focus {
        outline: none;
      }
    }
  }
}

.smart-sort-panel {
  .smart-sortable-container {
    margin-bottom: var(--smart-grid-panel-padding);

    &:empty:after {
      content: attr(no-sorting);
      margin-top: calc(var(--smart-grid-panel-vertical-offset) / 2);
      margin-bottom: calc(var(--smart-grid-panel-vertical-offset) / 2);
      opacity: 0.7;
    }
  }

  .smart-grid-panel-container-footer {
    >smart-input {
      min-width: 215px;
      width: 40%;

      &.smart-mobile {
        min-width: 100px;
        width: 120px;
      }
    }
  }

  .smart-grid-panel-item-close-button {
    display: flex;
    align-items: center;
    padding: 5px;
  }

  .smart-grid-panel-buttons-container {
    .smart-grid-panel-apply-button {
      margin-left: 5px;
    }
  }
}

.smart-colors-panel,
.smart-grid-ai-panel,
.smart-multi-column-filter-panel {
  >.smart-container {
    display: grid;
    grid-auto-rows: 1fr max-content;
    grid-row-gap: var(--smart-grid-panel-padding);
  }

  &.smart-colors-panel {
    >.smart-container {
      grid-auto-rows: auto;
    }
  }
  .smart-filter-panel-items-container {
    overflow: auto;
    padding-top: 10px;

    &:empty:after {
      margin-top: calc(var(--smart-grid-panel-vertical-offset) / 2);
      margin-bottom: calc(var(--smart-grid-panel-vertical-offset) / 2);
      opacity: 0.7;
      content: attr(no-filters);
    }
  }

  .smart-filter-panel-add-filter-button {
    display: flex;
    align-items: center;
    padding: 5px;

    &:hover {
      color: var(--smart-ui-state-color-selected);
      background: var(--smart-ui-state-selected);
      border-color: var(--smart-ui-state-selected);
      cursor: pointer;
    }

    &:focus {
      outline: none;
    }
  }

  .smart-grid-panel-item {
    width: 100%;
    display: grid;
    columns: 5;
    grid-template-columns: var(--smart-multi-column-filter-panel-template-columns);
    grid-gap: var(--smart-grid-panel-padding);

    >* {
      width: 100%;
    }
  }

  .smart-grid-panel-item-close-button {
    display: flex;
    align-items: center;
    padding: 5px;
  }

  .smart-grid-panel-buttons-container {
    .smart-grid-panel-apply-button {
      margin-left: 5px;
    }
  }

  &[close-button-position="right"] {
    --smart-multi-column-filter-panel-template-columns: 60px 2fr 3fr 3fr 15px;
  }
}

.smart-kanban-column-panel {
  .smart-grid-panel-item {

    &::after,
    &::before {
      display: none !important;
    }
  }
}

.smart-group-panel {
  .smart-sortable-container {
    smart-column-panel {
      smart-sortable {
        margin-bottom: var(--smart-grid-panel-padding);
      }
    }

    &:empty:after {
      margin-top: calc(var(--smart-grid-panel-vertical-offset) / 2);
      margin-bottom: calc(var(--smart-grid-panel-vertical-offset) / 2);
      opacity: 0.7;
      content: attr(no-grouping);
    }
  }

  .smart-grid-panel-container-footer {
    >smart-input {
      min-width: 215px;
      width: 40%;

      &.smart-mobile {
        min-width: 100px;
        width: 120px;
      }
    }
  }

  .smart-grid-panel-item-close-button {
    display: flex;
    align-items: center;
    padding: 5px;
  }

  .smart-grid-panel-buttons-container {
    .smart-grid-panel-apply-button {
      margin-left: 5px;
    }
  }

  .smart-grid-panel-from,
  .smart-grid-panel-direction {
    display: none;
  }

  .smart-grid-panel-expand-collapse {
    justify-content: flex-end;
    margin-top: 10px;
    margin-bottom: 10px;
    ;
  }

  .smart-group-panel-expand-button {
    margin-left: 15px;
  }

  .smart-group-panel-expand-button[active],
  .smart-group-panel-collapse-button[active] {
    color: var(--smart-primary);
  }
}

.smart-format-panel {
  .smart-grid-panel-buttons-container {
    width: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;

    span {
      display: flex;
      align-items: center;
      padding: 5px;

      &:hover {
        color: var(--smart-ui-state-color-selected);
        background: var(--smart-ui-state-selected);
        border-color: var(--smart-ui-state-selected);
        cursor: pointer;
      }
    }

    .smart-grid-panel-apply-button {
      margin-left: 5px;
    }
  }

  &.smart-grid-panel-container-footer {
    display: flex;
    flex-direction: row;
    height: 50px;
    justify-content: center;
    padding: 15px;
  }
}

.smart-column-panel {
  --smart-grid-panel-item-height: 20px;
  min-width: 100px;

  >.smart-container,
  &.smart-container {
    display: flex;
    flex-direction: column;
  }

  smart-sortable {
    flex: 5;
    min-height: 50px;
    overflow: auto;
    max-height: var(--smart-column-panel-drop-down-height);
  }

  .smart-column-panel-find-container {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--smart-border);
    height: var(--smart-editor-height);
    position: relative;

    input {
      outline: none;
      border: none;
      width: calc(100% - 16px);
      height: 100%;
      font-family: var(--smart-font-family);
      font-size: var(--smart-font-size);
      background: var(--smart-grid-panel-background);
      color: var(--smart-grid-panel-color);
    }

    .clear-button {
      width: 16px;
      cursor: pointer;

      &:after {
        content: var(--smart-icon-cancel);
        font-family: var(--smart-font-family-icon);
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }

    &.no-results {
      &:after {
        content: attr(no-results);
        position: absolute;
        top: calc(100% + 10px);
      }
    }
  }

  .smart-column-panel-label {
    margin-left: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    &.icon {
      position: relative;
      padding-left: var(--smart-column-icon-size);

      &:after {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        width: var(--smart-column-icon-size);
        height: 100%;
        background-repeat: no-repeat;
        background-position: center;
      }
    }
  }

  .smart-grid-panel-buttons-container {
    width: 100%;
    justify-content: center;
    margin-top: 3px;

    .smart-grid-panel-apply-button {
      margin-left: 5px;
    }
  }

  .smart-grid-panel-container-footer {
    display: grid;
    grid-template-columns: auto auto;
  }



  .toggle-visibility {
    width: 16px;
    height: 16px;
    font-family: var(--smart-font-family-icon);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    &:after {
      content: var(--smart-icon-visibility);
    }

    &:focus {
      outline: none;
      color: var(--smart-primary);
    }

    &.disable-toggle {
      pointer-events: none;
      opacity: 0.5;
    }



    &.hidden {
      &:after {
        content: var(--smart-icon-visibility-off);
      }
    }
  }

  .clear-button {
    &:focus {
      outline: none;
      color: var(--smart-primary);
    }
  }

  .smart-grid-panel-item {
    display: flex;
    align-items: center;
    margin-top: calc(var(--smart-grid-panel-vertical-offset) / 2);
    margin-bottom: calc(var(--smart-grid-panel-vertical-offset) / 2);
    width: calc(100% - var(--smart-sortable-handle-size));
    height: var(--smart-grid-panel-item-height);
    min-height: var(--smart-grid-panel-item-height);
    background-color: var(--smart-background);

    &.group {

      &:before,
      &:after {
        opacity: 0 !important;
        pointer-events: none;
      }
    }

    &.indent {
      padding-left: 12px;
    }
  }
}

.smart-grid-panel-reset-button {
  text-decoration: underline;
  display: flex;
  align-items: center;
  cursor: pointer;
  text-transform: uppercase;
}

.smart-grid-panel-cancel-button {
  background: var(--smart-surface);
  color: var(--smart-surface-color);
  border: 1px solid var(--smart-border);
  border-radius: var(--smart-border-radius);
  padding: 5px 8px;
  min-width: 80px;
  text-transform: uppercase;
  display: flex;
  justify-content: center;
}

.smart-grid-panel-apply-button {
  border-radius: var(--smart-border-radius);
  padding: 5px 8px;
  min-width: 80px;
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  background: var(--smart-primary);
  color: var(--smart-primary-color);
  border: 1px solid var(--smart-primary);
}

/* --- Right-To-Left --- */

/* DataView */
.smart-data-view-header {
  padding: 3px;
  position: relative;
  display: grid;
  grid-template-areas: "states views customize filter sort format details delete . search";
  grid-template-columns: minmax(0px, max-content) minmax(0px, max-content) minmax(50px, max-content) minmax(50px, max-content) minmax(50px, max-content) minmax(50px, max-content) minmax(50px, max-content) 1fr 24px;
  grid-gap: 5px;
  grid-template-rows: 100%;
  background: var(--smart-surface);
  color: var(--smart-surface-color);
}

.smart-data-view-header-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  padding-left: 25px;
  height: 30px;
  margin-top: 5px;
  position: relative;
  cursor: pointer;
  border-top-right-radius: var(--smart-border-top-right-radius);
  border-top-left-radius: var(--smart-border-top-left-radius);
  border-bottom-left-radius: var(--smart-border-bottom-left-radius);
  border-bottom-right-radius: var(--smart-border-bottom-right-radius);

  &:after {
    position: absolute;
    font-family: var(--smart-font-family-icon);
    left: 8px;
  }

  &:active {
    color: var(--smart-ui-state-color-active);
    background-color: var(--smart-ui-state-active);
  }

  &:focus {
    outline: 1px solid var(--smart-primary);
  }

  &:hover {
    color: var(--smart-ui-state-color-hover);
    background-color: var(--smart-ui-state-hover);
  }

  &[aria-expanded="true"] {
    color: var(--smart-ui-state-color-selected);
    background-color: var(--smart-ui-state-selected);
    border-color: var(--smart-ui-state-border-selected);
  }

  &.smart-data-view-search-button:active {
    color: var(--smart-ui-state-active);
  }

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

.smart-data-view-header-drop-down {
  position: absolute;
  background-color: var(--smart-background);
  box-shadow: var(--smart-elevation-8);
  z-index: 9999;
  height: auto;
  transform: scaleY(1);
  transform-origin: top;
  opacity: 1;

  &.smart-mobile {
    --smart-font-size: 12px;
  }

  smart-colors-panel,
  smart-column-panel,
  smart-grid-ai-panel,
  smart-multi-column-filter-panel,
  smart-sort-panel {
    width: 100%;
    border: none;
  }

  &.smart-visibility-hidden {
    transform: scaleY(0);
    opacity: 0;
  }

  &.customize-panel {
    width: var(--smart-data-view-customize-panel-width);
  }

  &.colors-panel,
  &.filter-panel {
    width: var(--smart-data-view-filter-panel-width);
  }

  &.format-panel {
    max-height: 320px;
    overflow: auto;
  }

  &.sort-panel {
    width: var(--smart-data-view-sort-panel-width);
  }

  &.search-panel {
    width: var(--smart-data-view-search-panel-width);
    padding: var(--smart-data-view-padding);

    .smart-data-view-search-box {
      display: grid;
      grid-template-columns: 1fr 16px;
      grid-template-rows: 100%;
      grid-gap: 2px;
      align-items: center;

      &.matches {
        grid-template-columns: 1fr max-content 16px 16px 16px;

        .smart-data-view-search-next,
        .smart-data-view-search-prev {
          display: flex;
        }

        .smart-data-view-search-label {
          display: block;
        }
      }

      &.no-matches {
        grid-template-columns: 1fr max-content 16px;

        .smart-data-view-search-label {
          display: block;
        }
      }
    }

    input {
      outline: none;
      border: none;
      min-width: 0;
      padding: 0;
      font-family: var(--smart-font-family);
      font-size: var(--smart-font-size);
      background: var(--smart-background);
      color: var(--smart-background-color);
    }
  }
}

.smart-data-view-search-box {
  div:focus {
    outline: 1px solid var(--smart-primary);
  }
}

.smart-data-view-search-button {
  grid-area: search;
  margin-right: 0;
  padding: 0;

  &:after {
    content: var(--smart-icon-search);
  }
}

.smart-data-view-customize-button {
  grid-area: customize;

  &:after {
    content: var(--smart-icon-visibility-off);
  }


  &.hidden {
    background-color: #D0F0FD;
    color: #039BE5;
  }
}


.smart-data-view-ai-button {

  &.mobile {
    min-width: 30px;
  }

  &.mobile:after {
      content: '✨︎';
      display: block;
  }

  &.hidden {
    background-color: #D0F0FD;
    color: #039BE5;
  }
}

.smart-data-view-delete-button {
  grid-area: delete;

  &:after {
    content: var(--smart-icon-delete);
  }
}

.smart-data-view-details-button {
  grid-area: details;

  &:after {
    content: var(--smart-icon-resize-full);
  }
}

.smart-data-view-filter-button {
  grid-area: filter;

  &:after {
    content: var(--smart-icon-add-filter);
  }

  &.filtered {
    background-color: #D1F7C4;
    color: #0B8043;
  }
}

.smart-data-view-bold-button {
  grid-area: details;
  
  &:before {
    content: ' ';
    position: absolute;
    left: -2px;
    height: 80%;
    background: var(--smart-background-color);
    opacity: 0.7;
    width: 1px;
  }
  
  &:after {
    content: var(--smart-icon-bold);
  }
}
.smart-data-view-italic-button {
  grid-area: details;

  &:after {
    content: var(--smart-icon-italic);
  }
}
.smart-data-view-underline-button {
  grid-area: details;

  &:after {
    content: var(--smart-icon-underline);
  }
}
.smart-data-view-strikethrough-button {
  grid-area: details;

  &:after {
    content: var(--smart-icon-font);
    text-decoration: line-through;
  }
}
.smart-data-view-fontsize-button {
  grid-area: details;

  &:before {
    font-family: var(--smart-font-family-icon);
    content: var(--smart-icon-arrow-down);
    position: initial;
  }

  &:after {
    content: var(--smart-icon-fontsize);
  }
}
.smart-data-view-fontfamily-button {
  grid-area: details;

   &:before {
    font-family: var(--smart-font-family-icon);
    content: var(--smart-icon-arrow-down);
    position: initial;
  }

  &:after {
    content: var(--smart-icon-font);
  }
}
.smart-data-view-background-button {
  grid-area: details;

  &:after {
    content: var(--smart-icon-color-background);
    border-bottom: 2px solid var(--smart-surface-color);
  }
}
.smart-data-view-textcolor-button {
  grid-area: details;

  &:after {
    content: var(--smart-icon-font);
    border-bottom: 2px solid var(--smart-surface-color);
  }
}
.smart-data-view-sort-button {
  grid-area: sort;

  &:after {
    content: var(--smart-icon-sort);
  }

  &.sorted {
    background-color: #FFEBB6;
    color: #B88707;
  }
}

.smart-data-view-label-button {
  grid-area: group;

  &:after {
    content: var(--smart-icon-font);
  }

  &.grouped {
    background-color: #FFDAF6;
    color: #FF36C2;
  }
}

.smart-data-view-resource-button,
.smart-data-view-group-button {
  grid-area: group;

  &:after {
    content: var(--smart-icon-group);
  }

  &.grouped {
    background-color: #D0F0FD;
    color: #039BE5;
  }

  &.scheduler {
    &.grouped {
      background-color: #FFCFC9;
      color: #D50000;
    }

    &:after {
      content: var(--smart-icon-scheduler);
    }
  }
}

.smart-data-view-format-button {
  grid-area: format;

  &:after {
    content: var(--smart-icon-table);
  }

  &.formatted {
    background-color: var(--smart-primary);
    color: var(--smart-primary-color);
  }
}

.smart-data-view-colors-button {
  grid-area: format;

  &:after {
    content: var(--smart-icon-table);
  }

  &.formatted {
    background-color:#ECE1FD;
    color: #8C47FF;
  }
}


.smart-data-view-download-button {
  grid-area: download;

  &:after {
    content: var(--smart-icon-arrow-down);
    position: initial;
    margin-left: 8px;
  }

  &:before {
    font-family: var(--smart-font-family-icon);
    left: 8px;
    content: var(--smart-icon-download-alt);
    position: absolute;
  }

  &.formatted {
    background-color: var(--smart-primary);
    color: var(--smart-primary-color);
  }
}


.smart-data-view-views-button {
  grid-area: views;

  &:after {
    content: var(--smart-icon-arrow-down);
    content: var(--smart-icon-arrow-down);
    position: initial;
    margin-left: 8px;
  }

  &:before {
    font-family: var(--smart-font-family-icon);
    left: 8px;
    content: var(--smart-icon-grid-alt);
    position: absolute;
  }

  &.kanban:before {
    content: var(--smart-icon-kanban-alt);
  }

  &.card:before {
    content: var(--smart-icon-card-alt);
  }

  &.formatted {
    background-color: var(--smart-primary);
    color: var(--smart-primary-color);
  }
}


.smart-data-view-states-button {
  grid-area: states;
  border-right: 1px solid var(--smart-border);
  padding-right: 5px;

  &:before {
    font-family: var(--smart-font-family-icon);
    left: 8px;
    content: var(--smart-icon-menu);
    position: absolute;
  }

  &.formatted {
    background-color: var(--smart-primary);
    color: var(--smart-primary-color);
  }
}

.smart-grid-toolbar {
  .smart-data-view-header {
    height: 100%;
    display: flex;
  }

  .smart-data-view-header-button {
    margin-right: 0px;

    &.smart-disabled {
      pointer-events: none;
      opacity: 0.5;
    }
  }

  .smart-data-view-search-button {
    position: absolute;
    right: 30px;
    top: 0px;
  }
}

.smart-card-view,
.smart-kanban {
  .smart-data-view-header-button {
    margin-top: 0;
    height: 100%;

    &.smart-data-view-search-button {
      min-width: 30px;
    }
  }

  &:not([animation="none"]) {
    .smart-data-view-header-drop-down {
      transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
  }
}

.smart-data-view-header-drop-down[owner] {
  transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.smart-data-view-search-label {
  display: none;
  font-size: calc(var(--smart-font-size) - 3px);
  opacity: 0.7;
}

.smart-data-view-search-prev,
.smart-data-view-search-next {
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--smart-font-family-icon);
  font-size: 10px;
  display: none;
  background-color: var(--smart-surface);
  color: var(--smart-surface-color);
  height: 100%;

  &:hover {
    color: var(--smart-ui-state-color-hover);
    background-color: var(--smart-ui-state-hover);
  }

  &:active {
    color: var(--smart-ui-state-color-active);
    background-color: var(--smart-ui-state-active);
  }
}

.smart-data-view-search-prev {
  &:after {
    content: var(--smart-icon-arrow-up);
  }
}

.smart-data-view-search-next {
  &:after {
    content: var(--smart-icon-arrow-down);
  }
}

.smart-data-view-search-close {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--smart-font-family-icon);
  font-size: 10px;
  color: var(--smart-background-color);

  &:after {
    content: var(--smart-icon-close);
  }

  &:hover {
    color: var(--smart-ui-state-color-hover);
    background-color: var(--smart-ui-state-hover);
  }

  &:active {
    color: var(--smart-ui-state-color-active);
    background-color: var(--smart-ui-state-active);
  }
}

.smart-data-view-found {
  outline: 4px solid var(--smart-outline);
  outline-offset: -4px;
}

.smart-data-view-highlighted {
  box-shadow: 0px 0px 23px 1px var(--smart-primary);
  outline: 4px solid var(--smart-primary);
  outline-offset: -4px;
}

[header-position="bottom"] {
  .smart-data-view-header-drop-down {
    transform-origin: bottom;
  }
}

/* smart-formatting-panel */
.smart-formatting-panel {
  width: var(--smart-formatting-panel-default-width);
  min-height: 150px;
  padding: 0;
  overflow: visible;
  z-index: 999;

  >.smart-container {
    position: relative;
    min-height: inherit;
  }

  .smart-formatting-panel-items-container {
    width: 100%;
    height: 100%;
    padding: 0 calc(2 * var(--smart-grid-panel-padding));
    overflow: auto;
  }

  .smart-formatting-panel-item {
    >.format-label {
      grid-area: format-label;
      justify-self: end;
    }

    >.font-family-input {
      grid-area: font-family-input;
    }

    >.font-size-input {
      grid-area: font-size-input;
    }

    >.popup-button {
      display: flex;
      align-items: center;
      border: var(--smart-border-width) solid var(--smart-border);
      width: 100%;
      height: 100%;
      grid-area: popup-button;
      justify-content: center;
      cursor: pointer;
      font-size: 20px;
      font-weight: bold;
    }

    >.preview {
      display: flex;
      align-items: center;
      border: var(--smart-border-width) solid var(--smart-border);
      width: 100%;
      height: 100%;
      grid-area: preview;
      padding: 0 var(--smart-grid-panel-padding);
    }
  }

  .smart-add-new-button {
    display: block;
    position: absolute;
    bottom: calc(var(--smart-grid-panel-padding) - 5px);
    right: calc(var(--smart-grid-panel-padding) - 5px);
    width: var(--smart-formatting-panel-add-new-button-size);
    height: var(--smart-formatting-panel-add-new-button-size);
    border-radius: 50%;
    background-color: var(--smart-primary);
    color: var(--smart-primary-color);
    cursor: pointer;
    opacity: 0.3;

    &:after {
      content: '+';
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      font-size: 35px;
    }

    &:hover,
    &:focus {
      opacity: 1;
      transform: scale(1.2, 1.2);
    }

    &:focus {
      outline: none;
    }
  }

  .close-button,
  .popup-button {
    &:focus {
      outline: var(--smart-border-width) solid var(--smart-ui-state-border-active);
    }
  }

  &.scroll {
    .smart-add-new-button {
      right: calc(12px + var(--smart-grid-panel-padding));
      border-radius: 50%;
    }
  }

  &:not([animation="none"]) {
    .smart-add-new-button {
      transition: transform cubic-bezier(0.81, 0.27, 0, 0.93) 0.5s, opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
  }
}

.smart-formatting-panel-item {
  display: grid;
  grid-template-columns: auto 3fr 2fr var(--smart-formatting-panel-row-height) 1fr 0.5fr 1fr 1fr;
  grid-template-rows: var(--smart-formatting-panel-row-height) var(--smart-formatting-panel-row-height);
  grid-template-areas:
    "value-label columns-input condition-input condition-input first-value first-value first-value close-button"
    "format-label font-family-input font-size-input popup-button preview preview preview close-button";
  gap: var(--smart-grid-panel-padding);
  border-bottom: var(--smart-border-width) solid var(--smart-border);
  width: 100%;
  padding: calc(2 * var(--smart-grid-panel-padding)) 0;

  &:last-child {
    border-bottom: none;
  }

  >* {
    min-width: 0;
    max-width: none;
    min-height: 0;
    max-height: none;
    width: auto;
    align-self: center;
    justify-self: center;
  }

  >.value-label {
    grid-area: value-label;
    justify-self: end;
  }

  >.columns-input {
    grid-area: columns-input;
  }

  >.condition-input {
    grid-area: condition-input;
  }

  >.first-value {
    grid-area: first-value;
  }

  >.ampersand {
    grid-area: ampersand;
    display: none;
  }

  >.second-value {
    grid-area: second-value;
    display: none;
  }

  >.close-button {
    grid-area: close-button;
    position: relative;
    width: 16px;
    height: 16px;

    &:after {
      content: var(--smart-icon-close);
      display: flex;
      align-items: center;
      justify-content: center;
      position: absolute;
      width: 100%;
      height: 100%;
      font-size: 20px;
      font-family: 'smart-icons';
      opacity: 0.5;
      cursor: pointer;
    }
  }

  &.between {
    grid-template-areas:
      "value-label columns-input condition-input condition-input first-value ampersand second-value close-button"
      "format-label font-family-input font-size-input popup-button preview preview preview close-button";

    >.ampersand,
    >.second-value {
      display: block;
    }
  }
}

.smart-formatting-panel-popup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: var(--smart-formatting-panel-row-height) var(--smart-formatting-panel-row-height) auto var(--smart-formatting-panel-row-height);
  grid-template-areas:
    "header header"
    "code input"
    "colors colors"
    "apply cancel";
  gap: var(--smart-grid-panel-padding);
  position: absolute;
  border: var(--smart-border-width) solid var(--smart-border);
  border-top-right-radius: var(--smart-border-top-right-radius);
  border-top-left-radius: var(--smart-border-top-left-radius);
  border-bottom-left-radius: var(--border-bottom-left-radius);
  border-bottom-right-radius: var(--smart-border-bottom-right-radius);
  width: var(--smart-formatting-panel-popup-width);
  padding: var(--smart-grid-panel-padding);
  background-color: var(--smart-background);
  box-shadow: var(--smart-elevation-8);
  z-index: 9999;
  opacity: 1;
  transform: scale(1);
  transform-origin: top;
  font-family: var(--smart-font-family);
  font-size: var(--smart-font-size);

  >.color-code {
    border: var(--smart-border-width) solid var(--smart-border);
    width: 100%;
    height: 100%;
    grid-area: code;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding: var(--smart-grid-panel-padding);
    color: var(--smart-background-color);
  }

  .header {
    grid-area: header;
    display: flex;
    border: var(--smart-border-width) solid var(--smart-border);

    >div {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      width: 50%;
      height: 100%;
      text-transform: uppercase;
      font-weight: bold;
      cursor: pointer;
      color: var(--smart-background-color);

      &:focus {
        outline: var(--smart-border-width) solid var(--smart-ui-state-border-active);
      }

      &:first-child {
        border-right: var(--smart-border-width) solid var(--smart-border);
      }
    }

    >.selected {
      background-color: var(--smart-ui-state-selected);
      color: var(--smart-ui-state-color-selected);
    }
  }

  input {
    border: var(--smart-border-width) solid var(--smart-border);
    width: 100%;
    height: 100%;
    grid-area: input;
    background-color: var(--smart-background);
    cursor: pointer;

    &:focus {
      //outline: none;
      border-color: var(--smart-ui-state-border-focus);
      outline: var(--smart-border-width) solid var(--smart-ui-state-border-active);
    }
  }

  .colors-container {
    grid-area: colors;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-auto-rows: var(--smart-formatting-panel-color-box-height);
    gap: 3px;
    width: 100%;

    &:focus {
      outline: var(--smart-border-width) solid var(--smart-ui-state-border-active);
    }

    >div {
      border: var(--smart-border-width) solid var(--smart-border);
      cursor: pointer;

      &.selected {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;

        &:after {
          //content: var(--smart-icon-close);
          display: flex;
          align-items: center;
          justify-content: center;
          position: absolute;
          //width: 100%;
          height: 100%;
          font-size: 20px;
          font-family: 'smart-icons';
          //opacity: 0.5;
          cursor: pointer;

          border-radius: 50%;
          content: var(--smart-icon-check);
          background-color: var(--smart-background-color);
          color: var(--smart-background);
          width: var(--smart-formatting-panel-color-box-height);
          opacity: 1;
        }
      }
    }
  }

  >smart-button {
    --smart-button-padding: 0;
  }

  >.apply {
    grid-area: apply;
  }

  >.cancel {
    grid-area: cancel;
  }

  &:not([animation="none"]) {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)-out, opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1)-out, visibility 0.2s cubic-bezier(0.4, 0, 0.2, 1)-out;
  }

  &.smart-visibility-hidden {
    transform: scale(0);
    opacity: 0;
  }
}

@import 'rtl/_gridpanel';