.tui-grid {
  &-layer-state {
    z-index: 5 !important;
  }

  // &-layer-selection {
  //   width: calc(100% - 2px) !important;
  // }

  &-container {
    width: 100%;
    border-radius: 10px;
  }

  &-content-area {
    width: 100%;
    border: 0 !important;
  }

  // &-body-container {
  //   width: 100% !important;
  // }

  // &-table {
  //   width: 100% !important;
  // }

  // &-lside-area .tui-grid-body-area {
  //   margin-right: -11px;
  // }

  &-lside-area .tui-grid-scrollbar-left-bottom {
    display: none;
  }

  &-rside-area {

    .tui-grid-header-area,
    .tui-grid-summary-area {
      margin-right: $scrollbar-width;
    }
  }

  &-border-line-top,
  &-border-line-bottom {
    border: 0 !important;
  }

  &-cell {
    border-width: 1px !important;
  }

  &-cell-header {
    border-top: 0;
    font-weight: 400;
  }

  &-cell-header,
  &-cell-content,
  &-cell.tui-grid-cell-summary {
    // font-family: "Spoqa Han Sans Neo";
    font-size: 0.875rem;
    line-height: 1.25rem;
    letter-spacing: 0.0178571429em;
  }

  &-cell-content {
    font-weight: 400;
  }

}

.tui-grid-table{
  .tui-grid-cell-header,
  .tui-grid-cell-has-input .tui-grid-cell-content {
    padding: 8px;
  }
}

.treeGrid {
  .tui-grid {
    &-header-area {
      display: none;
    }

    &-cell {
      border: 0;
      background-color: transparent;
    }
  }
}

.tui-grid-scrollbar-right-top {
  z-index: 5;
}

@each $theme in dark, light {
  @include theme($theme);

  .v-application.#{$theme}-mode {
    .grid-title {
      font-weight: 600;
      font-size: 16px;
      line-height: 24px;
      letter-spacing: 0;
      color: map-deep-get($config,
        #{$theme},
        "tui-grid-title-color"
      );
    }
    
    .tui-grid {
      &-table {
        border: 1px solid;
        border-color: map-deep-get($config,
          #{$theme},
          "scrollbar-track"
        );

        .tui-grid-cell {
          border-color: map-deep-get($config,
            #{$theme},
            "tui-grid-cell-borderColor-darkmode"
          );
          border-style: map-deep-get($config,
            #{$theme},
            "tui-grid-cell-borderStyle-darkmode"
          );
        }
      }

      &-border-line-right{
        opacity: 0;
      }

      &-body-container{
        border-right: 1px solid;
        border-right-color: map-deep-get($config,
          #{$theme},
          "tui-grid-cell-borderColor"
        );
        width: auto !important;
      }

      &-container,
      &-summary-area {
        font-family: Inter;
        // color: #000000E0;
 
        & ::-webkit-scrollbar {
          width: $scrollbar-width !important;
          height: $scrollbar-width !important;
          -webkit-appearance: initial;
          background-color: map-deep-get($config,
            #{$theme},
            "scrollbar-track"
          ) !important;
          border-radius: 3px !important;
        }

        & ::-webkit-scrollbar-track {
          background-color: map-deep-get($config,
            #{$theme},
            "scrollbar-track"
          ) !important;
        }

        & ::-webkit-scrollbar-thumb {
          width: 50px !important;
          height: 50px !important;
          background-color: map-deep-get($config, #{$theme}, "scrollbar-thumb");
          border-radius: 3px;
        }

        .tui-grid-cell {

          &.tui-grid-cell-summary {
            color: map-deep-get($config,
              #{$theme},
              "tui-grid-cell-color"
            );
          }
        }
      }

      &-rside-area {
        background-color: map-deep-get($config, #{$theme}, "scrollbar-track");
      }

      &-scrollbar-left-bottom {
        background-color: map-deep-get($config, #{$theme}, "cardBackground");
        border-color: map-deep-get($config, #{$theme}, "cardBackground");
      }

      &-scrollbar-right-top {
        background-color: rgba(0, 0, 0, 0);
        border: none;
        // background-color: map-deep-get(
        //   $config,
        //   #{$theme},
        //   "tui-grid-header-backgroundColor"
        // );
        // border-left-color: map-deep-get(
        //   $config,
        //   #{$theme},
        //   "tui-grid-border-horziontal-color"
        // );
        // border-right-color: map-deep-get(
        //   $config,
        //   #{$theme},
        //   "tui-grid-border-horziontal-color"
        // );
        // border-bottom-color: map-deep-get(
        //   $config,
        //   #{$theme},
        //   "tui-grid-border-vertical-color"
        // );
      }

      &-scrollbar-right-bottom {
        width: $scrollbar-width !important;
        height: $scrollbar-width !important;
        // display: none !important;
        border-color: map-deep-get($config, #{$theme}, "scrollbar-track");
        background-color: map-deep-get($config, #{$theme}, "scrollbar-track");
        // border: none !important;
        // bottom: -1px;
        // right: -2px;
        box-sizing: border-box;
      }

      &-scrollbar-frozen-border,
      &-scrollbar-y-outer-border,
      &-scrollbar-y-inner-border {
        background-color: transparent !important;
        border-color: transparent !important;
      }

      // &-body-area {
      //   overflow: auto !important;
      // }

      &-container,
      &-layer-state,
      &-body-area,
      &-summary-area,
      &-cell {
        background-color: map-deep-get($config,
          #{$theme},
          "tui-grid-cell-backgroundColor"
        );
        border-color: map-deep-get($config,
          #{$theme},
          "tui-grid-border-vertical-color"
        );

        &-current-row{
          td {
            .custom-radio {
              .radio-mark{
                border-color: #1677ff;
                background-color: #fff;
                &::after {
                  content: "";
                  position: absolute;
                  top: 50%;
                  left: 50%;
                  transform: translate(-50%, -50%);
                  height: 11px;
                  width: 11px;
                  border-radius: 50%;
                  background-color: #1677ff;
                }
              }
            }
          }
        }
      }

      &-cell {
        &:last-child {
          padding-right: 1px;
          border-right: 1px solid ;
          border-right-color: map-deep-get($config,
            #{$theme},
            "tui-grid-cell-borderColor"
          );
          .tui-grid-cell-content {
            border-right: 1px solid ;
            border-right-color: map-deep-get($config,
              #{$theme},
              "tui-grid-cell-borderColor"
            );
          }
        }
      }

      &-cell-summary {
        text-align: center;
      }

      &-header-area,
      &-cell-header {
        // font-family: inherit;
        font-weight: 600;
        font-style: Semi Bold;
        background-color: map-deep-get($config,
          #{$theme},
          "tui-grid-header-backgroundColor"
        );
        border-color: map-deep-get($config,
          #{$theme},
          "tui-grid-border-vertical-color"
        );
        color: map-deep-get($config,
        #{$theme},
          "tui-grid-header-color"
        );

      }

      &-header-area {
        background-color: none;
        border: none;
      }

      &-row-odd,
      &-row-even {
        .tui-grid-cell-content {
          color: map-deep-get($config, #{$theme}, "tui-grid-cell-color");
        }

        &:hover {
          >.tui-grid-cell {
            background-color: map-deep-get($config,
              #{$theme},
              "tui-grid-cell-hover-backgroundColor"
            );

            .tui-grid-cell-content {
              color: map-deep-get($config, #{$theme}, "activate");
            }
          }
        }

      }

      &-cell {
        &.row-insert {
          background-color: map-deep-get($config,
            #{$theme},
            "tui-grid-cell-insert-color"
          );
        }

        &.row-modify {
          background-color: map-deep-get($config,
            #{$theme},
            "tui-grid-cell-modify-color"
          );
        }

        &.row-removed {
          background-color: map-deep-get($config,
            #{$theme},
            "tui-grid-cell-removed-color"
          );
        }

        &.row-disabled {
          color: map-deep-get($config,
            #{$theme},
            "tui-grid-cell-disabled-color"
          );

          .tui-grid-cell-content {
            color: map-deep-get($config, #{$theme}, "tui-grid-cell-disabled-color");
          }
        }

        &.row-selected {
          background-color: map-deep-get($config,
            #{$theme},
            "tui-grid-cell-selected-color"
          );

          .tui-grid-cell-content {
            color: map-deep-get($config, #{$theme}, "activate");
          }
        }
      }

      &-layer-focus-border {
        background-color: transparent;
      }

      &-cell-has-tree {
        .tui-grid-cell-content {
          padding: 0 !important;
        }
      }

      &-tree-extra-content {
        display: flex;
        align-items: center;
        position: relative;

        .tui-grid-tree-depth {
          width: 16px;
          height: 16px;
          position: relative;
          left: 0 !important;
          margin-right: 6px;
        }

      }

      &-btn-tree {
        width: 16px;
        height: 16px;
        margin-top: 0;
        padding-left: 0;
        margin-right: 6px;
        top: 0;
        left: 0 !important;

        i {
          margin-top: 0;
        }
      }

      &-tree-icon {
        margin-top: 0;
        top: 0;

        i {
          width: 16px;
          height: 16px;
          margin-left: 0;
          background-repeat: no-repeat;
          background-position: 0 0;

          @if $theme ==dark {
            background-image: url("data:image/svg+xml,%3Csvg id='ico_tree_item' xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cdefs%3E%3Cstyle%3E .cls-1, .cls-4 %7B fill: none; %7D .cls-1 %7B stroke: %23fff; opacity: 0.3; %7D .cls-2 %7B fill: %23fff; %7D .cls-3 %7B stroke: none; %7D %3C/style%3E%3C/defs%3E%3Cg id='사각형_703' data-name='사각형 703' class='cls-1'%3E%3Crect class='cls-3' width='16' height='16' rx='3'/%3E%3Crect class='cls-4' x='0.5' y='0.5' width='15' height='15' rx='2.5'/%3E%3C/g%3E%3Crect id='사각형_1384' data-name='사각형 1384' class='cls-2' width='8' height='1' rx='0.5' transform='translate(4 4.5)'/%3E%3Crect id='사각형_1386' data-name='사각형 1386' class='cls-2' width='8' height='1' rx='0.5' transform='translate(4 7.5)'/%3E%3Crect id='사각형_1387' data-name='사각형 1387' class='cls-2' width='8' height='1' rx='0.5' transform='translate(4 10.5)'/%3E%3C/svg%3E%0A");
          }

          @else {
            background-image: url("data:image/svg+xml,%3Csvg id='ico_tree_item' xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cdefs%3E%3Cstyle%3E .cls-2%7Bfill:%23a4aac3%7D %3C/style%3E%3C/defs%3E%3Cg id='사각형_703' data-name='사각형 703' style='stroke:%23a4aac3;fill:none'%3E%3Crect width='16' height='16' rx='3' style='stroke:none'/%3E%3Crect x='.5' y='.5' width='15' height='15' rx='2.5' style='fill:none'/%3E%3C/g%3E%3Crect id='사각형_1384' data-name='사각형 1384' class='cls-2' width='8' height='1' rx='.5' transform='translate(4 4.5)'/%3E%3Crect id='사각형_1386' data-name='사각형 1386' class='cls-2' width='8' height='1' rx='.5' transform='translate(4 7.5)'/%3E%3Crect id='사각형_1387' data-name='사각형 1387' class='cls-2' width='8' height='1' rx='.5' transform='translate(4 10.5)'/%3E%3C/svg%3E%0A");
          }
        }
      }

      &-tree-button-expand {
        .tui-grid-btn-tree {
          i {
            width: 16px;
            height: 16px;
            background-position: 0 0;

            @if $theme ==dark {
              background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%224%22%20fill%3D%22%23212224%22/%3E%3Crect%20x%3D%220.5%22%20y%3D%220.5%22%20width%3D%2215%22%20height%3D%2215%22%20rx%3D%223.5%22%20stroke%3D%22white%22%20stroke-opacity%3D%220.06%22/%3E%3Cpath%20d%3D%22M12.5998%208H2.99979%22%20stroke%3D%22white%22%20stroke-opacity%3D%220.85%22/%3E%3C/svg%3E");
            }

            @else {
              background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%224%22%20fill%3D%22white%22/%3E%3Crect%20x%3D%220.5%22%20y%3D%220.5%22%20width%3D%2215%22%20height%3D%2215%22%20rx%3D%223.5%22%20stroke%3D%22black%22%20stroke-opacity%3D%220.06%22/%3E%3Cpath%20d%3D%22M12.5997%208H2.99973%22%20stroke%3D%22black%22%20stroke-opacity%3D%220.88%22/%3E%3C/svg%3E");
            }
          }
        }
      }

      &-tree-button-collapse {
        .tui-grid-btn-tree {
          i {
            width: 16px;
            height: 16px;
            background-position: 0 0;

            @if $theme ==dark {
              background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%224%22%20fill%3D%22%23212224%22/%3E%3Crect%20x%3D%220.5%22%20y%3D%220.5%22%20width%3D%2215%22%20height%3D%2215%22%20rx%3D%223.5%22%20stroke%3D%22white%22%20stroke-opacity%3D%220.06%22/%3E%3Cpath%20d%3D%22M7.7998%203.00073V12.6007%22%20stroke%3D%22white%22%20stroke-opacity%3D%220.85%22/%3E%3Cpath%20d%3D%22M12.5999%207.80078L2.99985%207.80078%22%20stroke%3D%22white%22%20stroke-opacity%3D%220.85%22/%3E%3C/svg%3E");
            }

            @else {
              background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%224%22%20fill%3D%22white%22/%3E%3Crect%20x%3D%220.5%22%20y%3D%220.5%22%20width%3D%2215%22%20height%3D%2215%22%20rx%3D%223.5%22%20stroke%3D%22black%22%20stroke-opacity%3D%220.06%22/%3E%3Cpath%20d%3D%22M7.7998%203.00073V12.6007%22%20stroke%3D%22black%22%20stroke-opacity%3D%220.88%22/%3E%3Cpath%20d%3D%22M12.5997%207.80078L2.99973%207.80078%22%20stroke%3D%22black%22%20stroke-opacity%3D%220.88%22/%3E%3C/svg%3E");
            }
          }
        }
      }

      &-tree-button-expand,
      &-tree-button-collapse {
        .tui-grid-tree-icon {
          display: none;
        }
      }

      &-frozen-border {
        background-color: transparent;
      }
    }

    [class*="tui-grid-tree-wrapper"] {
      display: flex;
      align-items: center;
      padding-left: 0 !important;
    }
  }
}