.lbaic-settings-dashboard {
  --lbaic-settings-dashboard-card-border-color: #EAEBF0;
  --lbaic-settings-dashboard-icon-bg: #F5F7FA;
  --lbaic-settings-dashboard-icon-color: #666666;
  --lbaic-settings-dashboard-up-color: #16A34A;
  --lbaic-settings-dashboard-down-color: #DC2626;
  --lbaic-settings-dashboard-card-value-color: #232323;

  &-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  // Grid container
  &-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;

    // Responsive breakpoints
    @include max-width($lbaic-settings-wp-3xl-breakpoint) {
      grid-template-columns: repeat(3, 1fr);
    }

    @include max-width($lbaic-settings-wp-xl-breakpoint) {
      grid-template-columns: repeat(2, 1fr);
    }

    @include max-width($lbaic-settings-wp-md-breakpoint) {
      grid-template-columns: repeat(1, 1fr);
    }
  }

  // Card
  &-card {
    background-color: var(--lbaic-settings-white);
    border: 1px solid var(--lbaic-settings-dashboard-card-border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.03);

    &.selectable {
      cursor: pointer;

      &:hover:not(&--selected) {
        border-color: var(--lbaic-settings-primary);
      }
    }

    // Selected state
    &--selected {
      border-color: var(--lbaic-settings-primary);
      box-shadow: 0 0 0 2px var(--lbaic-settings-primary);
    }

    // Card header
    &-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 16px;

      &-label {
        font-size: var(--lbaic-settings-fs-15);
        color: var(--lbaic-settings-dashboard-icon-color);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        &-skeleton {
          width: 120px;
          height: 18px;
        }
      }
    }

    // Icon container
    &-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      border-radius: 6px;
      background-color: var(--lbaic-settings-dashboard-icon-bg);
      color: var(--lbaic-settings-dashboard-icon-color);
      transition: all 0.2s ease-in-out;

      svg {
        width: 20px;
        height: 20px;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        fill: none;
      }

      &--selected {
        background-color: var(--lbaic-settings-primary);
        color: var(--lbaic-settings-white);
      }
    }

    // Trend indicator
    &-trend {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: var(--lbaic-settings-fs-12);
      font-weight: var(--lbaic-settings-fw-500);
      cursor: help;

      svg {
        width: 14px;
        height: 14px;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        fill: none;
      }

      &--up {
        color: var(--lbaic-settings-dashboard-up-color);
      }

      &--down {
        color: var(--lbaic-settings-dashboard-down-color);
      }
    }

    // Label
    &-label {
      font-size: var(--lbaic-settings-fs-13);
      line-height: var(--lbaic-settings-lh-16);
      color: var(--lbaic-settings-dashboard-icon-color);
      margin-bottom: 4px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    // Footer
    &-footer {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 8px;
    }

    // Values container
    &-values {
      display: flex;
      align-items: baseline;
      gap: 8px;
      min-width: 0;
      flex: 1;
    }

    // Main value
    &-value {
      font-size: var(--lbaic-settings-fs-28);
      font-weight: var(--lbaic-settings-fw-500);
      color: var(--lbaic-settings-dashboard-card-value-color);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    // Change value
    &-change {
      font-size: var(--lbaic-settings-fs-16);
      font-weight: var(--lbaic-settings-fw-500);
      white-space: nowrap;

      &--up {
        color: var(--lbaic-settings-dashboard-up-color);
      }

      &--down {
        color: var(--lbaic-settings-dashboard-down-color);
      }
    }

    // Logs button
    &-logs-btn {
      display: flex;
      align-items: center;
      gap: 2px;
      padding: 4px 8px;
      border-radius: 6px;
      background-color: var(--lbaic-settings-dashboard-icon-bg);
      color: var(--lbaic-settings-primary);
      font-size: 10px;
      font-weight: var(--lbaic-settings-fw-500);
      white-space: nowrap;
      flex-shrink: 0;
      border: none;
      cursor: pointer;
      transition: all 0.2s ease-in-out;

      svg {
        width: 10px;
        height: 10px;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        fill: none;
      }

      &:hover {
        background-color: var(--lbaic-settings-primary);
        color: var(--lbaic-settings-white);
      }

      &:focus {
        outline: none;
      }
    }
  }

  // Configure cards
  &-configure-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;

    &-item {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px;
      border-radius: 8px;
      border: 1px solid #EAEBF0;
      background-color: var(--lbaic-settings-white);
      cursor: pointer;
      transition: all 0.2s ease-in-out;

      &:hover {
        border-color: var(--lbaic-settings-primary);
      }

      &:focus {
        outline: none;
      }

      &-left {
        display: flex;
        align-items: center;
        gap: 12px;
      }

      &-icon {
        width: 16px;
        height: 16px;
        color: var(--lbaic-settings-dashboard-icon-color);
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        fill: none;
        flex-shrink: 0;
      }

      &-label {
        font-size: var(--lbaic-settings-fs-14);
        line-height: var(--lbaic-settings-lh-18);
        color: #232323;
      }

      &-toggle {
        width: 16px;
        height: 16px;
        color: #999999;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        fill: none;
        flex-shrink: 0;
        transition: color 0.2s ease-in-out;

        &--visible {
          color: var(--lbaic-settings-primary);
        }
      }
    }
  }

  // Shimmer animation
  @keyframes shimmer {
    0% {
      background-position: -1000px 0;
    }
    100% {
      background-position: 1000px 0;
    }
  }

  // Shimmer effect
  &-card-shimmer {
    background: linear-gradient(
      to right,
      #f0f0f0 0%,
      #e0e0e0 20%,
      #f0f0f0 40%,
      #f0f0f0 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 4px;
  }

  // Loading state
  &-card--loading {
    pointer-events: none;
    cursor: default;

    .lbaic-settings-dashboard-card-icon.lbaic-settings-dashboard-card-shimmer {
      width: 40px;
      height: 40px;
      border-radius: 6px;
    }

    .lbaic-settings-dashboard-card-trend.lbaic-settings-dashboard-card-shimmer {
      width: 50px;
      height: 16px;
    }

    .lbaic-settings-dashboard-card-label.lbaic-settings-dashboard-card-shimmer {
      width: 60%;
      height: 14px;
      margin-bottom: 4px;
    }

    .lbaic-settings-dashboard-card-value.lbaic-settings-dashboard-card-shimmer {
      width: 40px;
      height: 32px;
    }

    .lbaic-settings-dashboard-card-change.lbaic-settings-dashboard-card-shimmer {
      width: 30px;
      height: 20px;
    }

    .lbaic-settings-dashboard-card-logs-btn.lbaic-settings-dashboard-card-shimmer {
      width: 36px;
      height: 24px;
      border-radius: 6px;
    }
  }

  // Chart skeleton
  &-chart-skeleton {
    width: 100%;
    height: 300px;
    position: relative;
    display: flex;

    &-y-axis {
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 32px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 8px 0;
    }

    &-content {
      margin-left: 40px;
      height: 100%;
      flex: 1;
      display: flex;
      flex-direction: column;
    }

    &-grid {
      flex: 1;
      position: relative;
      border-left: 1px solid #f0f0f0;
      border-bottom: 1px solid #f0f0f0;
    }

    &-grid-line {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 1px;
      background-color: #f5f5f5;
    }

    &-bars {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: flex-end;
      justify-content: space-around;
      padding: 16px;
      gap: 8px;
    }

    &-bar {
      flex: 1;
      background-color: #f0f0f0;
      border-radius: 4px 4px 0 0;
    }

    &-x-axis {
      display: flex;
      justify-content: space-around;
      padding-top: 8px;
    }

    &-label {
      width: 32px;
      height: 10px;
      border-radius: 4px;
    }
  }
}