@use '../../../../shared/styles/panel-shared' as panel;

.shelf-creator {
  display: flex;
  flex-direction: column;
  min-width: 600px;

  @media (max-width: 640px) {
    min-width: auto;
    width: 100%;
  }
}

.panel-header {
  @include panel.panel-header;
}

.form-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-top: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);

  @media (max-width: 480px) {
    padding: 1rem;
    gap: 1rem;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;

  &.highlight-group {
    padding: 0.875rem;
  }

  @media (max-width: 480px) {
    gap: 0.375rem;

    &.highlight-group {
      padding: 0.625rem;
    }
  }
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);

  .label-icon {
    color: var(--primary-color);
  }

  .required-indicator {
    color: var(--p-red-500);
    margin-left: 0.125rem;
  }

  @media (max-width: 480px) {
    font-size: 0.875rem;
  }
}

.input-wrapper {
  position: relative;

  .input-full {
    width: 100%;
    padding-right: 2.5rem;
    box-sizing: border-box;
  }

  .input-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;

    &.success {
      color: var(--p-green-500);
    }
  }
}

.icon-select-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem;
  background: var(--ground-background);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;

  &:hover {
    background: var(--overlay-background);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  }

  i {
    font-size: 1.25rem;
  }

  .btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;

    .btn-title {
      font-size: 0.9375rem;
      font-weight: 600;
    }

    .btn-subtitle {
      font-size: 0.8rem;
      opacity: 0.85;
    }
  }

  @media (max-width: 480px) {
    padding: 0.75rem;
    gap: 0.5rem;

    i {
      font-size: 1.125rem;
    }

    .btn-content {
      .btn-title {
        font-size: 0.875rem;
      }

      .btn-subtitle {
        font-size: 0.75rem;
      }
    }
  }
}

.selected-icon-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--ground-background);

  .icon-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);

    app-icon-display {
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--primary-contrast-color);

      ::ng-deep i {
        color: var(--primary-contrast-color);
      }

      ::ng-deep img {
        filter: brightness(0) invert(1);
      }
    }
  }

  .icon-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;

    .icon-label {
      font-size: 0.8rem;
      color: var(--text-secondary-color);
    }

    .icon-name {
      font-size: 0.875rem;
      font-weight: 500;
      color: var(--text-color);
      font-family: monospace;
    }
  }

  @media (max-width: 480px) {
    padding: 0.625rem;
    gap: 0.5rem;

    .icon-preview {
      width: 36px;
      height: 36px;
    }

    .icon-info {
      .icon-label {
        font-size: 0.75rem;
      }

      .icon-name {
        font-size: 0.8rem;
      }
    }
  }
}

.dialog-footer {
  @include panel.dialog-footer;
  border-top: none;
}

.validation-message {
  @include panel.validation-message;
}
