@use "../../../variables/index" as *;

@use "../../../variables/dlt-c8y-icons-vars";

/**
 * C8Y Dashboard Modal - Dashboard selection modal styles
 *
 * Note: Uses $size-* tokens for spacing where applicable.
 *
 * Intentionally hardcoded values:
 * - Off-token spacing (15px): Grid gutter width, not in token system
 * - Component-specific sizes (28px, 125px): Icon area and preview list height
 * - Border widths (1px): Standard borders
 * - Positioning offset (1px): Fine-tuning
 * - Percentages (100%): Layout values
 * - Transition duration (0.35s): Animation timing
 * - Transform rotation (180deg): Icon rotation
 * - Line-height (28px): Icon alignment
 * - Typography font shorthand: Icon font specification
 */

.modal-body {
  .row {
    margin: 0 -15px;
    [class*='col-'] {
      padding-right: 15px;
      padding-left: 15px;
    }
  }
}

// Removed unused panel toggle button class - verified 0 usages: .btn-toggle-panel

.dashboard-preview-list {
  overflow-y: auto;
  margin-bottom: $size-10;
  max-height: 125px;
  border-top: 1px solid $component-border-color;
  border-bottom: 1px solid $component-border-color;
  > .dashboard-preview-item:first-child {
    border-top: 0;
  }
  > .dashboard-preview-item:last-child {
    border-bottom: 0;
  }
}

.dashboard-preview-item {
  position: relative;
  display: block;
  margin: 0;
  padding: $size-5 $size-10;
  min-height: $size-10;
  color: inherit;
  text-transform: none;
  font-weight: normal;
  font-size: 100%;
  cursor: pointer;
  &:hover {
    color: var(--brand-primary, var(--c8y-brand-primary));
  }
  input[type='radio'] {
    position: absolute;
    opacity: 0;
    &:checked ~ .preview-label {
      color: var(--brand-primary, var(--c8y-brand-primary));
      &::after {
        position: absolute;
        top: 1px;
        right: 0;
        width: 28px;
        height: 28px;
        color: var(--brand-primary, var(--c8y-brand-primary));
        content: dlt-c8y-icons-vars.$dlt-c8y-icon-check;
        text-align: center;
        font: normal normal normal $size-20/1 dlt-c8y-icons-vars.$icon-font-family;
        font-size: inherit;
        line-height: 28px;

        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
      }
    }
  }
}